diff --git a/.env b/.env deleted file mode 100644 index c471ff71e..000000000 --- a/.env +++ /dev/null @@ -1,60 +0,0 @@ -# Language code as supported by Sphinx: -# https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-language -LANGUAGE ?= pt_BR - -# Branch used in the project and in CPython -BRANCH := 3.13 - -############################ -# Environment variables for 'merge' target -############################ -# -# Version(s) that still receive(s) bug fixes, not only security-related fixes. -# Versions in this variable will have their translation replaced with changes -# in currently active version being translated. These will have pomerge's -# --overwrite flag set. -BUGFIXBRANCH ?= 3.12 - -# Version(s) that are considered security fixes or EOL. Let's make them more -# stable, with more predictable state. These versions will not have translated -# strings replaced with translations update. These will have pomerge's -# --no-overwrite flag set. -OLDERBRANCHES ?= 3.11 3.10 3.9 3.8 3.7 3.6 2.7 -# -############################ - - -############################ -# Environment variables for 'build' target -############################ -# -# If set to -W, warnings will be considered as errors. -# Set to "" keep warnings as is. -SPHINXERRORHANDLING := "-W" -# -############################ - -########################### -# Environment variables for 'tx-install' target -########################### -# -# Specific Transifex CLI Client version to install. -# If unset, latest version will be used. -TX_CLI_VERSION ?= '1.6.12' - -# Install directory of TX_CLI_DIR. Consider using a directory already -# in the PATH environment variable because install script will add this -# directory to PATH in your ~/.bashrc. -TX_CLI_DIR ?= $(shell realpath ~/.local/bin) - -############################ -# Paths and URLs -############################ -# -PYTHON ?= $(shell which python3) -CPYTHON_DIR := cpython -LOCALE_DIR := Doc/locales -LOGS_DIR := logs -VENV_DIR := .venv -# -####### diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index ba0b877fc..000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,27 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" - assignees: - - "rffontenelle" - commit-message: - prefix: "gha" - groups: - all-github-actions: - patterns: - - "*" - - - package-ecosystem: "pip" - directory: "/" - schedule: - interval: "weekly" - assignees: - - "rffontenelle" - commit-message: - prefix: "pip" - groups: - all-pip-packages: - patterns: - - "*" diff --git a/.github/problem-matchers/sphinx.json b/.github/problem-matchers/sphinx.json deleted file mode 100644 index a0299d893..000000000 --- a/.github/problem-matchers/sphinx.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "problemMatcher": [ - { - "owner": "sphinx-problem-matcher", - "pattern": [ - { - "regexp": "^(.*):(\\d+):\\s+(\\w*):\\s+(.*)$", - "file": 1, - "line": 2, - "severity": 3, - "message": 4 - } - ] - }, - { - "owner": "sphinx-problem-matcher-loose", - "pattern": [ - { - "_comment": "A bit of a looser pattern, doesn't look for line numbers, just looks for file names relying on them to start with / and end with .rst", - "regexp": "(\/.*\\.rst):\\s+(\\w*):\\s+(.*)$", - "file": 1, - "severity": 2, - "message": 3 - } - ] - }, - { - "owner": "sphinx-problem-matcher-loose-no-severity", - "pattern": [ - { - "_comment": "Looks for file names ending with .rst and line numbers but without severity", - "regexp": "^(.*\\.rst):(\\d+):(.*)$", - "file": 1, - "line": 2, - "message": 3 - } - ] - } - ] -} diff --git a/.github/scripts/list-obsolete.py b/.github/scripts/list-obsolete.py deleted file mode 100755 index 2c5434913..000000000 --- a/.github/scripts/list-obsolete.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python3 -# List PO files that no longer have a corresponding page in Python docs - -import os -import os.path -import sys -import subprocess - -def run(cmd): - return subprocess.check_output(cmd, shell=True, text=True) - -# Set POT root directory from command-line argument or hardcoded, then test it -pot_root = 'cpython/Doc/locales/pot/' - -if len(sys.argv) > 1: - pot_root = sys.argv[0] - -if not os.path.isdir(pot_root): - print(f'Unable to find the POT directory {pot_root}') - exit(1) - -# List PO files tracked by git -po_files = run('git ls-files | grep .po | tr "\n" " "').split() - -# Compare po vs pot, store po without corresponding pot -to_remove = [] -for file in sorted(po_files): - pot = os.path.join(pot_root, file + 't') - if not os.path.isfile(pot): - to_remove.append(file) - -# Exit if no obsolete, or print obsoletes files. -# If running in GitHub Actions, add a problem matcher to bring up the attention -if len(to_remove) == 0: - exit -else: - matcher = "" - if 'CI' in os.environ: - matcher = '::error::' - print(f'{matcher}The following files are absent in the documentation, hence they should be removed:\n') - for file in to_remove: - print(f'{matcher} ' + file) - print("") - exit(1) diff --git a/.github/scripts/prepmsg.sh b/.github/scripts/prepmsg.sh deleted file mode 100755 index 2111ab29a..000000000 --- a/.github/scripts/prepmsg.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -# Prepare message for Telegram notification -set -ex - -die() { echo "$0: error: $*" >&2; exit 1; } - -[ $# -ne 2 ] && die "Expected 1 input and 1 output files, got $#" -[ ! -f "$1" ] && die "Input file $1 not found, skipping." -[ -z "${GITHUB_REPOSITORY}" ] && die "GITHUB_REPOSITORY is empty." -[ -z "${GITHUB_RUN_ID}" ] && die "GITHUB_RUN_ID is empty." -[ -z "${GITHUB_JOB}" ] && die "GITHUB_JOB is empty." - -URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" - -input="$1" -output="$2" - -touch aux -if [[ "${GITHUB_JOB}" == "build" ]]; then - grep 'cpython/Doc/.*WARNING:' "$input" | \ - sed 's|.*/cpython/Doc/||' | \ - uniq | \ - sed 's|^|```\n|;s|$|\n```\n|' \ - > aux -elif [[ "${GITHUB_JOB}" == "lint" ]]; then - grep -P '^.*\.po:\d+:\s+.*\(.*\)$' "$input" | \ - sort -u | \ - sed 's|^|```\n|;s|$|\n```\n|' \ - > aux -else - die "Unexpected job name ${GITHUB_JOB}" -fi - -[[ $(cat aux) == "" ]] && die "Unexpected empty output message." - -echo "❌ *${GITHUB_JOB}* (ID [${GITHUB_RUN_ID}]($URL)):" > "$output"; -{ echo ""; cat aux; echo ""; } >> "$output" -rm aux diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml deleted file mode 100644 index 4f05a15ed..000000000 --- a/.github/workflows/check.yml +++ /dev/null @@ -1,235 +0,0 @@ -# Run some tests in the Python Doc translations - -name: Check - -on: - workflow_dispatch: - workflow_call: - pull_request: - branches: - - '3.13' - paths: - - '.github/workflows/check.yml' - - '.github/scripts/prepmsg.sh' - - '.github/scripts/list-obsolete.py' - - 'Makefile' - - 'requirements.txt' - - '*.po' - - '**/*.po' - push: - branches: - - '3.13' - paths: - - '.github/workflows/check.yml' - - '.github/scripts/prepmsg.sh' - - '.github/scripts/list-obsolete.py' - - 'Makefile' - - 'requirements.txt' - - '*.po' - - '**/*.po' - -permissions: - contents: read - -jobs: - # Build documentation handling warnings as errors. Always store logs. - # If success, make built docs artifact. If failure, notify telegram. - build: - name: Build translated docs - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4.1.7 - with: - fetch-depth: 5 - - - name: Set up Python 3 - uses: actions/setup-python@v5.1.1 - with: - python-version: '3' - - - name: Make sure the repository is up to date - if: github.event_name != 'pull_request' - run: git pull --rebase - - - name: Add problem matcher - uses: sphinx-doc/github-problem-matcher@v1.1 - - - name: Build docs - continue-on-error: true - id: build - run: | - make build - - - name: Upload artifact - docs - if: steps.build.outcome == 'success' - uses: actions/upload-artifact@v4.3.5 - with: - name: docs - path: cpython/Doc/build/html - - - name: Upload artifact - log files - if: always() - uses: actions/upload-artifact@v4.3.5 - with: - name: build-logs - path: logs/* - - - name: Prepare notification (only on error) - if: steps.build.outcome == 'failure' - id: prepare - run: .github/scripts/prepmsg.sh logs/build/err*.txt logs/notify.txt - env: - GITHUB_JOB: ${{ github.job }} - GITHUB_RUN_ID: ${{ github.run_id }} - GITHUB_REPOSITORY: ${{ github.repository }} - - - name: Notify via Telegram - if: steps.prepare.outcome == 'success' - uses: appleboy/telegram-action@v0.1.1 - with: - to: ${{ secrets.TELEGRAM_TO }} - token: ${{ secrets.TELEGRAM_TOKEN }} - format: markdown - disable_web_page_preview: true - message_file: logs/notify.txt - - - # Run sphinx-lint to find wrong reST syntax in PO files. Always store logs. - lint: - name: Lint translations - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4.1.7 - with: - fetch-depth: 5 - - - name: Set up Python 3 - uses: actions/setup-python@v5.1.1 - with: - python-version: '3' - - - name: Make sure the repository is up to date - if: github.event_name != 'pull_request' - run: git pull --rebase - - - name: Add problem matcher - uses: rffontenelle/sphinx-lint-problem-matcher@v1.0.0 - - - name: Run sphinx-lint - continue-on-error: true - id: lint - run: | - make lint - - - name: Upload artifact - log files - uses: actions/upload-artifact@v4.3.5 - with: - name: lint-logs - path: logs/* - - #- name: Prepare notification (only on error) - # if: step.lint.outcome == 'failure' - # id: prepare - # run: scripts/prepmsg.sh logs/build/err*.txt logs/notify.txt - # env: - # GITHUB_JOB: ${{ github.job }} - # GITHUB_RUN_ID: ${{ github.run_id }} - # GITHUB_REPOSITORY: ${{ github.repository }} - # - #- name: Notify via Telegram - # if: step.prepare.outcome == 'success' - # uses: appleboy/telegram-action@v0.1.1 - # with: - # to: ${{ secrets.TELEGRAM_TO }} - # token: ${{ secrets.TELEGRAM_TOKEN }} - # format: markdown - # disable_web_page_preview: true - # message_file: logs/notify.txt - - - # Spell check the PO files, and store them in logs/ directory - pospell: - name: Spell check translations - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4.1.7 - with: - fetch-depth: 5 - - - name: Set up Python 3 - uses: actions/setup-python@v5.1.1 - with: - python-version: '3' - - - name: Make sure the repository is up to date - if: github.event_name != 'pull_request' - run: git pull --rebase - - - name: Install Hunspell - run: sudo apt install hunspell hunspell-pt-br -y - - - name: Run pospell - continue-on-error: true - id: pospell - run: make spell - - - name: Upload artifact - log files - uses: actions/upload-artifact@v4.3.5 - with: - name: pospell-logs - path: logs/* - - - # Gather all strings in a single PO file, useful for Translation Memory - # Also run powrap, useful only for pull_request testing for dependabot - compendium: - runs-on: ubuntu-latest - steps: - - name: Check out ${{ github.repository }} - uses: actions/checkout@v4.1.7 - with: - fetch-depth: 5 - - - name: Set up Python 3 - uses: actions/setup-python@v5.1.1 - with: - python-version: '3' - - - name: Make sure the repository is up to date - if: github.event_name != 'pull_request' - run: git pull --rebase - - - name: Install dependencies - run: | - sudo apt update -y && sudo apt install gettext -y - pip3 install --upgrade pip - pip3 install -r requirements.txt - - - name: Generate compendium from PO files - run: | - pocompendium --correct compendium.po *.po **/*.po - powrap compendium.po - - - name: Upload artifact - uses: actions/upload-artifact@v4.3.5 - with: - name: compendium - path: compendium.po - - # List PO files that no longer have a corresponding page in Python docs - list-obsolete: - runs-on: ubuntu-latest - steps: - - name: Check out ${{ github.repository }} - uses: actions/checkout@v4.1.7 - - - name: Set up Python 3 - uses: actions/setup-python@v5.1.1 - with: - python-version: '3' - - - name: Generate POT files - run: make pot - - - name: List obsolete PO files, if any - run: python3 .github/scripts/list-obsolete.py diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml deleted file mode 100644 index ac0f2e7c1..000000000 --- a/.github/workflows/update.yml +++ /dev/null @@ -1,226 +0,0 @@ -name: Update - -on: - workflow_dispatch: - inputs: - BRANCH: - description: CPython branch to use - required: false - type: string - default: '3.13' - pull_request: - paths: - - '.github/workflows/update.yml' - - 'Makefile' - - 'requirements.txt' - branches: - - '3.13' - push: - paths: - - '.github/workflows/update.yml' - - 'Makefile' - - 'requirements.txt' - branches: - - '3.13' - schedule: - - cron: '0 23 * * *' - -permissions: - contents: read - -jobs: - # Download translations from Transifex, keep PO and Logs artifacts - pull: - name: Pull from Transifex - runs-on: ubuntu-latest - steps: - - name: Check out ${{ github.repository }} - uses: actions/checkout@v4.1.7 - - - name: Get branch name on push or schedule - if: | - github.event_name == 'push' || - github.event_name == 'schedule' - run: echo "BRANCH=${GITHUB_REF_NAME}" >>$GITHUB_ENV - - - name: Get branch name on pull - if: github.event_name == 'pull_request' - run: echo "BRANCH=${GITHUB_BASE_REF}" >>$GITHUB_ENV - - - name: Get branch name on manual run - if: github.event_name == 'workflow_dispatch' - run: echo "BRANCH=${{ github.event.inputs.BRANCH }}" >> $GITHUB_ENV - - - name: Check out CPython - uses: actions/checkout@v4.1.7 - with: - repository: python/cpython - ref: ${{ env.BRANCH }} - path: cpython - - - name: Set up Python 3 - uses: actions/setup-python@v5.1.1 - with: - python-version: '3' - cache: 'pip' - cache-dependency-path: | - 'requirements.txt' - 'cpython/requirements.txt' - - - name: Install dependencies - run: sudo apt update -y && sudo apt install gettext tree -y - - - name: Pull translations - run: | - make tx-config TX_CLI_DIR=/usr/local/bin - if [ "${{ github.event_name }}" != 'pull_request' ]; then - make pull -o tx-config TX_CLI_DIR=/usr/local/bin - fi - env: - TX_TOKEN: ${{ secrets.TX_TOKEN }} - - - name: Upload artifact - po files - uses: actions/upload-artifact@v4.3.5 - with: - name: translations - path: | - *.po - **/*.po - .tx/ - - - name: Upload artifact - log files - if: always() - uses: actions/upload-artifact@v4.3.5 - with: - name: pull-logs - path: | - logs/* - /tmp/*.log - - - # Job for getting po files downloaded and storing this repository - push: - name: Push to repo - needs: [pull] - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Check out ${{ github.repository }} - uses: actions/checkout@v4.1.7 - - - name: Download PO files - uses: actions/download-artifact@v4.1.8 - with: - name: translations - - # Exclude file with only changes in POT-Creation-Date - - name: Changed files - shell: bash - run: | - git diff -I'^"POT-Creation-Date: ' --numstat *.po **/*.po | cut -f3 - git ls-files -o --exclude-standard *.po **/*.po - - - name: Commit and push changes - if: | - github.repository == 'python/python-docs-pt-br' && - github.event_name != 'pull_request' - run: | - git config user.name github-actions - git config user.email github-actions@github.com - make push - - - # 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. - merge: - name: Merge into ${{ matrix.branch }} - needs: [push] - runs-on: ubuntu-latest - permissions: - contents: write - strategy: - fail-fast: false - max-parallel: 3 - matrix: - branch: ['3.12', '3.11', '3.10', '3.9', '3.8', '3.7', '3.6', '2.7'] - include: - - branch: 3.12 - overwrite: true - steps: - - name: Get branch name on push or schedule - if: | - github.event_name == 'push' || - github.event_name == 'schedule' - run: echo "CURRENT_BRANCH=${GITHUB_REF_NAME}" >>$GITHUB_ENV - - - name: Get branch name on pull - if: github.event_name == 'pull_request' - run: echo "CURRENT_BRANCH=${GITHUB_BASE_REF}" >>$GITHUB_ENV - - - name: Get branch name on manual run - if: github.event_name == 'workflow_dispatch' - run: echo "CURRENT_BRANCH=${{ github.event.inputs.BRANCH }}" >> $GITHUB_ENV - - - name: Check out source branch (${{ env.CURRENT_BRANCH }}) - uses: actions/checkout@v4.1.7 - with: - path: ${{ env.CURRENT_BRANCH }} - persist-credentials: false - - - name: Check out target branch (${{ matrix.branch }}) - uses: actions/checkout@v4.1.7 - with: - ref: ${{ matrix.branch }} - path: ${{ matrix.branch }} - - - name: Set up Python 3 - uses: actions/setup-python@v5.1.1 - with: - python-version: '3' - cache: 'pip' - cache-dependency-path: "${{ env.CURRENT_BRANCH }}/requirements.txt" - - - name: Install dependencies - run: | - sudo apt update -y && sudo apt install gettext -y - pip3 install pomerge powrap - - - name: Merge overwriting on stable release branch - if: ${{ matrix.overwrite == true }} - run: | - pomerge --from ${{ env.CURRENT_BRANCH }}/**/*.po --to ${{ matrix.branch }}/**/*.po - - - name: Merge without overwriting on EOL or security-fix release branch - if: ${{ matrix.overwrite != true }} - run: | - pomerge --no-overwrite --from ${{ env.CURRENT_BRANCH }}/**/*.po --to ${{ matrix.branch }}/**/*.po - - - name: Wrap catalog message files - run: | - powrap --modified -C ${{ matrix.branch }} - - #TODO: Solve make push to work with merge scenario - - name: Commit and push changes - if: | - github.repository == 'python/python-docs-pt-br' && - github.event_name != 'pull_request' - run: | - git config user.name github-actions - git config user.email github-actions@github.com - git diff -I'^"POT-Creation-Date: ' --numstat *.po **/*.po | cut -f3 | xargs -r git add - git add $(git ls-files -o --exclude-standard *.po **/*.po) .tx/config - git diff-index --cached --quiet HEAD || git commit -m "Merge ${{ env.CURRENT_BRANCH }} into ${{ matrix.branch }}" - working-directory: ${{ matrix.branch }} - - - # Call the check.yml workflow after updating to run some tests - call-build: - name: call - needs: push - if: github.event_name != 'pull_request' - uses: ./.github/workflows/check.yml - secrets: inherit diff --git a/.gitignore b/.gitignore index f5f9bf4ef..2a2ef4431 100644 --- a/.gitignore +++ b/.gitignore @@ -2,12 +2,8 @@ *.mo *.po~ -# we don't want venv directories -venv/ -.venv/ - # cpython checkout shouldn't be added cpython/ -# No need to keep logs -logs/ +# do not include potodo temporary file +.potodo/ diff --git a/.tx/config b/.tx/config index 56cdab6b6..bb81aebed 100644 --- a/.tx/config +++ b/.tx/config @@ -1,4790 +1,4120 @@ [main] host = https://www.transifex.com -[o:python-doc:p:python-newest:r:about] -file_filter = .//LC_MESSAGES/about.po -trans.pt_BR = about.po -source_file = ../../pot/about.pot +[o:python-doc:p:python-313:r:about] +file_filter = about.po type = PO minimum_perc = 0 resource_name = about replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:bugs] -file_filter = .//LC_MESSAGES/bugs.po -trans.pt_BR = bugs.po -source_file = ../../pot/bugs.pot +[o:python-doc:p:python-313:r:bugs] +file_filter = bugs.po type = PO minimum_perc = 0 resource_name = bugs 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 -trans.pt_BR = c-api/abstract.po -source_file = ../../pot/c-api/abstract.pot +[o:python-doc:p:python-313:r:builtins--constants] +file_filter = builtins/constants.po +type = PO +minimum_perc = 0 +resource_name = builtins--constants +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:builtins--exceptions] +file_filter = builtins/exceptions.po +type = PO +minimum_perc = 0 +resource_name = builtins--exceptions +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:builtins--functions] +file_filter = builtins/functions.po +type = PO +minimum_perc = 0 +resource_name = builtins--functions +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:builtins--index] +file_filter = builtins/index.po +type = PO +minimum_perc = 0 +resource_name = builtins--index +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:builtins--stdtypes] +file_filter = builtins/stdtypes.po +type = PO +minimum_perc = 0 +resource_name = builtins--stdtypes +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:c-api--abstract] +file_filter = c-api/abstract.po type = PO minimum_perc = 0 resource_name = c-api--abstract 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 -trans.pt_BR = c-api/allocation.po -source_file = ../../pot/c-api/allocation.pot +[o:python-doc:p:python-313:r:c-api--allocation] +file_filter = c-api/allocation.po type = PO minimum_perc = 0 resource_name = c-api--allocation 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 -trans.pt_BR = c-api/apiabiversion.po -source_file = ../../pot/c-api/apiabiversion.pot +[o:python-doc:p:python-313:r:c-api--apiabiversion] +file_filter = c-api/apiabiversion.po type = PO minimum_perc = 0 resource_name = c-api--apiabiversion 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 -trans.pt_BR = c-api/arg.po -source_file = ../../pot/c-api/arg.pot +[o:python-doc:p:python-313:r:c-api--arg] +file_filter = c-api/arg.po type = PO minimum_perc = 0 resource_name = c-api--arg 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 -trans.pt_BR = c-api/bool.po -source_file = ../../pot/c-api/bool.pot +[o:python-doc:p:python-313:r:c-api--bool] +file_filter = c-api/bool.po type = PO minimum_perc = 0 resource_name = c-api--bool 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 -trans.pt_BR = c-api/buffer.po -source_file = ../../pot/c-api/buffer.pot +[o:python-doc:p:python-313:r:c-api--buffer] +file_filter = c-api/buffer.po type = PO minimum_perc = 0 resource_name = c-api--buffer 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 -trans.pt_BR = c-api/bytearray.po -source_file = ../../pot/c-api/bytearray.pot +[o:python-doc:p:python-313:r:c-api--bytearray] +file_filter = c-api/bytearray.po type = PO minimum_perc = 0 resource_name = c-api--bytearray 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 -trans.pt_BR = c-api/bytes.po -source_file = ../../pot/c-api/bytes.pot +[o:python-doc:p:python-313:r:c-api--bytes] +file_filter = c-api/bytes.po type = PO minimum_perc = 0 resource_name = c-api--bytes 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 -trans.pt_BR = c-api/call.po -source_file = ../../pot/c-api/call.pot +[o:python-doc:p:python-313:r:c-api--call] +file_filter = c-api/call.po type = PO minimum_perc = 0 resource_name = c-api--call 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 -trans.pt_BR = c-api/capsule.po -source_file = ../../pot/c-api/capsule.pot +[o:python-doc:p:python-313:r:c-api--capsule] +file_filter = c-api/capsule.po type = PO minimum_perc = 0 resource_name = c-api--capsule 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 -trans.pt_BR = c-api/cell.po -source_file = ../../pot/c-api/cell.pot +[o:python-doc:p:python-313:r:c-api--cell] +file_filter = c-api/cell.po type = PO minimum_perc = 0 resource_name = c-api--cell 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 -trans.pt_BR = c-api/code.po -source_file = ../../pot/c-api/code.pot +[o:python-doc:p:python-313:r:c-api--code] +file_filter = c-api/code.po type = PO minimum_perc = 0 resource_name = c-api--code 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 -trans.pt_BR = c-api/codec.po -source_file = ../../pot/c-api/codec.pot +[o:python-doc:p:python-313:r:c-api--codec] +file_filter = c-api/codec.po type = PO minimum_perc = 0 resource_name = c-api--codec 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 -trans.pt_BR = c-api/complex.po -source_file = ../../pot/c-api/complex.pot +[o:python-doc:p:python-313:r:c-api--complex] +file_filter = c-api/complex.po type = PO minimum_perc = 0 resource_name = c-api--complex 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 -trans.pt_BR = c-api/concrete.po -source_file = ../../pot/c-api/concrete.pot +[o:python-doc:p:python-313:r:c-api--concrete] +file_filter = c-api/concrete.po type = PO minimum_perc = 0 resource_name = c-api--concrete 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 -trans.pt_BR = c-api/contextvars.po -source_file = ../../pot/c-api/contextvars.pot +[o:python-doc:p:python-313:r:c-api--contextvars] +file_filter = c-api/contextvars.po type = PO minimum_perc = 0 resource_name = c-api--contextvars 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 -trans.pt_BR = c-api/conversion.po -source_file = ../../pot/c-api/conversion.pot +[o:python-doc:p:python-313:r:c-api--conversion] +file_filter = c-api/conversion.po type = PO minimum_perc = 0 resource_name = c-api--conversion 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 -trans.pt_BR = c-api/coro.po -source_file = ../../pot/c-api/coro.pot +[o:python-doc:p:python-313:r:c-api--coro] +file_filter = c-api/coro.po type = PO minimum_perc = 0 resource_name = c-api--coro 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 -trans.pt_BR = c-api/datetime.po -source_file = ../../pot/c-api/datetime.pot +[o:python-doc:p:python-313:r:c-api--curses] +file_filter = c-api/curses.po +type = PO +minimum_perc = 0 +resource_name = c-api--curses +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:c-api--datetime] +file_filter = c-api/datetime.po type = PO minimum_perc = 0 resource_name = c-api--datetime 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 -trans.pt_BR = c-api/descriptor.po -source_file = ../../pot/c-api/descriptor.pot +[o:python-doc:p:python-313:r:c-api--descriptor] +file_filter = c-api/descriptor.po type = PO minimum_perc = 0 resource_name = c-api--descriptor 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 -trans.pt_BR = c-api/dict.po -source_file = ../../pot/c-api/dict.pot +[o:python-doc:p:python-313:r:c-api--dict] +file_filter = c-api/dict.po type = PO minimum_perc = 0 resource_name = c-api--dict 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 -trans.pt_BR = c-api/exceptions.po -source_file = ../../pot/c-api/exceptions.pot +[o:python-doc:p:python-313:r:c-api--exceptions] +file_filter = c-api/exceptions.po type = PO minimum_perc = 0 resource_name = c-api--exceptions 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 -trans.pt_BR = c-api/file.po -source_file = ../../pot/c-api/file.pot +[o:python-doc:p:python-313:r:c-api--file] +file_filter = c-api/file.po type = PO minimum_perc = 0 resource_name = c-api--file 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 -trans.pt_BR = c-api/float.po -source_file = ../../pot/c-api/float.pot +[o:python-doc:p:python-313:r:c-api--float] +file_filter = c-api/float.po type = PO minimum_perc = 0 resource_name = c-api--float 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 -trans.pt_BR = c-api/frame.po -source_file = ../../pot/c-api/frame.pot +[o:python-doc:p:python-313:r:c-api--frame] +file_filter = c-api/frame.po type = PO minimum_perc = 0 resource_name = c-api--frame 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 -trans.pt_BR = c-api/function.po -source_file = ../../pot/c-api/function.pot +[o:python-doc:p:python-313:r:c-api--function] +file_filter = c-api/function.po type = PO minimum_perc = 0 resource_name = c-api--function 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 -trans.pt_BR = c-api/gcsupport.po -source_file = ../../pot/c-api/gcsupport.pot +[o:python-doc:p:python-313:r:c-api--gcsupport] +file_filter = c-api/gcsupport.po type = PO minimum_perc = 0 resource_name = c-api--gcsupport 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 -trans.pt_BR = c-api/gen.po -source_file = ../../pot/c-api/gen.pot +[o:python-doc:p:python-313:r:c-api--gen] +file_filter = c-api/gen.po type = PO minimum_perc = 0 resource_name = c-api--gen 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 -trans.pt_BR = c-api/hash.po -source_file = ../../pot/c-api/hash.pot +[o:python-doc:p:python-313:r:c-api--hash] +file_filter = c-api/hash.po type = PO minimum_perc = 0 resource_name = c-api--hash 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 -trans.pt_BR = c-api/import.po -source_file = ../../pot/c-api/import.pot +[o:python-doc:p:python-313:r:c-api--import] +file_filter = c-api/import.po type = PO minimum_perc = 0 resource_name = c-api--import 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 -trans.pt_BR = c-api/index.po -source_file = ../../pot/c-api/index.pot +[o:python-doc:p:python-313:r:c-api--index] +file_filter = c-api/index.po type = PO minimum_perc = 0 resource_name = c-api--index 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 -trans.pt_BR = c-api/init.po -source_file = ../../pot/c-api/init.pot +[o:python-doc:p:python-313:r:c-api--init] +file_filter = c-api/init.po type = PO minimum_perc = 0 resource_name = c-api--init 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 -trans.pt_BR = c-api/init_config.po -source_file = ../../pot/c-api/init_config.pot +[o:python-doc:p:python-313:r:c-api--init_config] +file_filter = c-api/init_config.po type = PO minimum_perc = 0 resource_name = c-api--init_config 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 -trans.pt_BR = c-api/intro.po -source_file = ../../pot/c-api/intro.pot +[o:python-doc:p:python-313:r:c-api--intro] +file_filter = c-api/intro.po type = PO minimum_perc = 0 resource_name = c-api--intro 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 -trans.pt_BR = c-api/iter.po -source_file = ../../pot/c-api/iter.pot +[o:python-doc:p:python-313:r:c-api--iter] +file_filter = c-api/iter.po type = PO minimum_perc = 0 resource_name = c-api--iter 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 -trans.pt_BR = c-api/iterator.po -source_file = ../../pot/c-api/iterator.pot +[o:python-doc:p:python-313:r:c-api--iterator] +file_filter = c-api/iterator.po type = PO minimum_perc = 0 resource_name = c-api--iterator 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 -trans.pt_BR = c-api/list.po -source_file = ../../pot/c-api/list.pot +[o:python-doc:p:python-313:r:c-api--list] +file_filter = c-api/list.po type = PO minimum_perc = 0 resource_name = c-api--list 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 -trans.pt_BR = c-api/long.po -source_file = ../../pot/c-api/long.pot +[o:python-doc:p:python-313:r:c-api--long] +file_filter = c-api/long.po type = PO minimum_perc = 0 resource_name = c-api--long 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 -trans.pt_BR = c-api/mapping.po -source_file = ../../pot/c-api/mapping.pot +[o:python-doc:p:python-313:r:c-api--mapping] +file_filter = c-api/mapping.po type = PO minimum_perc = 0 resource_name = c-api--mapping 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 -trans.pt_BR = c-api/marshal.po -source_file = ../../pot/c-api/marshal.pot +[o:python-doc:p:python-313:r:c-api--marshal] +file_filter = c-api/marshal.po type = PO minimum_perc = 0 resource_name = c-api--marshal 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 -trans.pt_BR = c-api/memory.po -source_file = ../../pot/c-api/memory.pot +[o:python-doc:p:python-313:r:c-api--memory] +file_filter = c-api/memory.po type = PO minimum_perc = 0 resource_name = c-api--memory 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 -trans.pt_BR = c-api/memoryview.po -source_file = ../../pot/c-api/memoryview.pot +[o:python-doc:p:python-313:r:c-api--memoryview] +file_filter = c-api/memoryview.po type = PO minimum_perc = 0 resource_name = c-api--memoryview 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 -trans.pt_BR = c-api/method.po -source_file = ../../pot/c-api/method.pot +[o:python-doc:p:python-313:r:c-api--method] +file_filter = c-api/method.po type = PO minimum_perc = 0 resource_name = c-api--method 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 -trans.pt_BR = c-api/module.po -source_file = ../../pot/c-api/module.pot +[o:python-doc:p:python-313:r:c-api--module] +file_filter = c-api/module.po type = PO minimum_perc = 0 resource_name = c-api--module 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 -trans.pt_BR = c-api/monitoring.po -source_file = ../../pot/c-api/monitoring.pot +[o:python-doc:p:python-313:r:c-api--monitoring] +file_filter = c-api/monitoring.po type = PO minimum_perc = 0 resource_name = c-api--monitoring 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 -trans.pt_BR = c-api/none.po -source_file = ../../pot/c-api/none.pot +[o:python-doc:p:python-313:r:c-api--none] +file_filter = c-api/none.po type = PO minimum_perc = 0 resource_name = c-api--none 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 -trans.pt_BR = c-api/number.po -source_file = ../../pot/c-api/number.pot +[o:python-doc:p:python-313:r:c-api--number] +file_filter = c-api/number.po type = PO minimum_perc = 0 resource_name = c-api--number 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 -trans.pt_BR = c-api/object.po -source_file = ../../pot/c-api/object.pot +[o:python-doc:p:python-313:r:c-api--object] +file_filter = c-api/object.po type = PO minimum_perc = 0 resource_name = c-api--object 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 -trans.pt_BR = c-api/objimpl.po -source_file = ../../pot/c-api/objimpl.pot +[o:python-doc:p:python-313:r:c-api--objimpl] +file_filter = c-api/objimpl.po type = PO minimum_perc = 0 resource_name = c-api--objimpl 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 -trans.pt_BR = c-api/perfmaps.po -source_file = ../../pot/c-api/perfmaps.pot +[o:python-doc:p:python-313:r:c-api--perfmaps] +file_filter = c-api/perfmaps.po type = PO minimum_perc = 0 resource_name = c-api--perfmaps 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 -trans.pt_BR = c-api/refcounting.po -source_file = ../../pot/c-api/refcounting.pot +[o:python-doc:p:python-313:r:c-api--picklebuffer] +file_filter = c-api/picklebuffer.po +type = PO +minimum_perc = 0 +resource_name = c-api--picklebuffer +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:c-api--refcounting] +file_filter = c-api/refcounting.po type = PO minimum_perc = 0 resource_name = c-api--refcounting 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 -trans.pt_BR = c-api/reflection.po -source_file = ../../pot/c-api/reflection.pot +[o:python-doc:p:python-313:r:c-api--reflection] +file_filter = c-api/reflection.po type = PO minimum_perc = 0 resource_name = c-api--reflection 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 -trans.pt_BR = c-api/sequence.po -source_file = ../../pot/c-api/sequence.pot +[o:python-doc:p:python-313:r:c-api--sequence] +file_filter = c-api/sequence.po type = PO minimum_perc = 0 resource_name = c-api--sequence 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 -trans.pt_BR = c-api/set.po -source_file = ../../pot/c-api/set.pot +[o:python-doc:p:python-313:r:c-api--set] +file_filter = c-api/set.po type = PO minimum_perc = 0 resource_name = c-api--set 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 -trans.pt_BR = c-api/slice.po -source_file = ../../pot/c-api/slice.pot +[o:python-doc:p:python-313:r:c-api--slice] +file_filter = c-api/slice.po type = PO minimum_perc = 0 resource_name = c-api--slice 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 -trans.pt_BR = c-api/stable.po -source_file = ../../pot/c-api/stable.pot +[o:python-doc:p:python-313:r:c-api--stable] +file_filter = c-api/stable.po type = PO minimum_perc = 0 resource_name = c-api--stable 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 -trans.pt_BR = c-api/structures.po -source_file = ../../pot/c-api/structures.pot +[o:python-doc:p:python-313:r:c-api--structures] +file_filter = c-api/structures.po type = PO minimum_perc = 0 resource_name = c-api--structures 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 -trans.pt_BR = c-api/sys.po -source_file = ../../pot/c-api/sys.pot +[o:python-doc:p:python-313:r:c-api--sys] +file_filter = c-api/sys.po type = PO minimum_perc = 0 resource_name = c-api--sys 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 -trans.pt_BR = c-api/time.po -source_file = ../../pot/c-api/time.pot +[o:python-doc:p:python-313:r:c-api--time] +file_filter = c-api/time.po type = PO minimum_perc = 0 resource_name = c-api--time 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 -trans.pt_BR = c-api/tuple.po -source_file = ../../pot/c-api/tuple.pot +[o:python-doc:p:python-313:r:c-api--tuple] +file_filter = c-api/tuple.po type = PO minimum_perc = 0 resource_name = c-api--tuple 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 -trans.pt_BR = c-api/type.po -source_file = ../../pot/c-api/type.pot +[o:python-doc:p:python-313:r:c-api--type] +file_filter = c-api/type.po type = PO minimum_perc = 0 resource_name = c-api--type 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 -trans.pt_BR = c-api/typehints.po -source_file = ../../pot/c-api/typehints.pot +[o:python-doc:p:python-313:r:c-api--typehints] +file_filter = c-api/typehints.po type = PO minimum_perc = 0 resource_name = c-api--typehints 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 -trans.pt_BR = c-api/typeobj.po -source_file = ../../pot/c-api/typeobj.pot +[o:python-doc:p:python-313:r:c-api--typeobj] +file_filter = c-api/typeobj.po type = PO minimum_perc = 0 resource_name = c-api--typeobj 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 -trans.pt_BR = c-api/unicode.po -source_file = ../../pot/c-api/unicode.pot +[o:python-doc:p:python-313:r:c-api--unicode] +file_filter = c-api/unicode.po type = PO minimum_perc = 0 resource_name = c-api--unicode 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 -trans.pt_BR = c-api/utilities.po -source_file = ../../pot/c-api/utilities.pot +[o:python-doc:p:python-313:r:c-api--utilities] +file_filter = c-api/utilities.po type = PO minimum_perc = 0 resource_name = c-api--utilities 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 -trans.pt_BR = c-api/veryhigh.po -source_file = ../../pot/c-api/veryhigh.pot +[o:python-doc:p:python-313:r:c-api--veryhigh] +file_filter = c-api/veryhigh.po type = PO minimum_perc = 0 resource_name = c-api--veryhigh 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 -trans.pt_BR = c-api/weakref.po -source_file = ../../pot/c-api/weakref.pot +[o:python-doc:p:python-313:r:c-api--weakref] +file_filter = c-api/weakref.po type = PO minimum_perc = 0 resource_name = c-api--weakref replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:contents] -file_filter = .//LC_MESSAGES/contents.po -trans.pt_BR = contents.po -source_file = ../../pot/contents.pot +[o:python-doc:p:python-313:r:contents] +file_filter = contents.po type = PO minimum_perc = 0 resource_name = contents replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:copyright] -file_filter = .//LC_MESSAGES/copyright.po -trans.pt_BR = copyright.po -source_file = ../../pot/copyright.pot +[o:python-doc:p:python-313:r:copyright] +file_filter = copyright.po type = PO minimum_perc = 0 resource_name = copyright 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 -trans.pt_BR = deprecations/c-api-pending-removal-in-3.14.po -source_file = ../../pot/deprecations/c-api-pending-removal-in-3.14.pot +[o:python-doc:p:python-313:r:deprecations--c-api-pending-removal-in-3_14] +file_filter = deprecations/c-api-pending-removal-in-3.14.po type = PO minimum_perc = 0 resource_name = deprecations--c-api-pending-removal-in-3_14 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 -trans.pt_BR = deprecations/c-api-pending-removal-in-3.15.po -source_file = ../../pot/deprecations/c-api-pending-removal-in-3.15.pot +[o:python-doc:p:python-313:r:deprecations--c-api-pending-removal-in-3_15] +file_filter = deprecations/c-api-pending-removal-in-3.15.po type = PO minimum_perc = 0 resource_name = deprecations--c-api-pending-removal-in-3_15 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 -trans.pt_BR = deprecations/c-api-pending-removal-in-future.po -source_file = ../../pot/deprecations/c-api-pending-removal-in-future.pot +[o:python-doc:p:python-313:r:deprecations--c-api-pending-removal-in-3_16] +file_filter = deprecations/c-api-pending-removal-in-3.16.po +type = PO +minimum_perc = 0 +resource_name = deprecations--c-api-pending-removal-in-3_16 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:deprecations--c-api-pending-removal-in-future] +file_filter = deprecations/c-api-pending-removal-in-future.po type = PO minimum_perc = 0 resource_name = deprecations--c-api-pending-removal-in-future replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:deprecations--index] -file_filter = .//LC_MESSAGES/deprecations/index.po -trans.pt_BR = deprecations/index.po -source_file = ../../pot/deprecations/index.pot +[o:python-doc:p:python-313:r:deprecations--index] +file_filter = deprecations/index.po type = PO minimum_perc = 0 resource_name = deprecations--index 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 -trans.pt_BR = deprecations/pending-removal-in-3.13.po -source_file = ../../pot/deprecations/pending-removal-in-3.13.pot +[o:python-doc:p:python-313:r:deprecations--pending-removal-in-3_13] +file_filter = deprecations/pending-removal-in-3.13.po type = PO minimum_perc = 0 resource_name = deprecations--pending-removal-in-3_13 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 -trans.pt_BR = deprecations/pending-removal-in-3.14.po -source_file = ../../pot/deprecations/pending-removal-in-3.14.pot +[o:python-doc:p:python-313:r:deprecations--pending-removal-in-3_14] +file_filter = deprecations/pending-removal-in-3.14.po type = PO minimum_perc = 0 resource_name = deprecations--pending-removal-in-3_14 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 -trans.pt_BR = deprecations/pending-removal-in-3.15.po -source_file = ../../pot/deprecations/pending-removal-in-3.15.pot +[o:python-doc:p:python-313:r:deprecations--pending-removal-in-3_15] +file_filter = deprecations/pending-removal-in-3.15.po type = PO minimum_perc = 0 resource_name = deprecations--pending-removal-in-3_15 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 -trans.pt_BR = deprecations/pending-removal-in-3.16.po -source_file = ../../pot/deprecations/pending-removal-in-3.16.pot +[o:python-doc:p:python-313:r:deprecations--pending-removal-in-3_16] +file_filter = deprecations/pending-removal-in-3.16.po type = PO minimum_perc = 0 resource_name = deprecations--pending-removal-in-3_16 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 -trans.pt_BR = deprecations/pending-removal-in-future.po -source_file = ../../pot/deprecations/pending-removal-in-future.pot +[o:python-doc:p:python-313:r:deprecations--pending-removal-in-3_17] +file_filter = deprecations/pending-removal-in-3.17.po +type = PO +minimum_perc = 0 +resource_name = deprecations--pending-removal-in-3_17 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:deprecations--pending-removal-in-3_18] +file_filter = deprecations/pending-removal-in-3.18.po +type = PO +minimum_perc = 0 +resource_name = deprecations--pending-removal-in-3_18 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:deprecations--pending-removal-in-future] +file_filter = deprecations/pending-removal-in-future.po type = PO minimum_perc = 0 resource_name = deprecations--pending-removal-in-future replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:distributing--index] -file_filter = .//LC_MESSAGES/distributing/index.po -trans.pt_BR = distributing/index.po -source_file = ../../pot/distributing/index.pot +[o:python-doc:p:python-313:r:distributing--index] +file_filter = distributing/index.po type = PO minimum_perc = 0 resource_name = distributing--index replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:extending--building] -file_filter = .//LC_MESSAGES/extending/building.po -trans.pt_BR = extending/building.po -source_file = ../../pot/extending/building.pot +[o:python-doc:p:python-313:r:extending--building] +file_filter = extending/building.po type = PO minimum_perc = 0 resource_name = extending--building replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:extending--embedding] -file_filter = .//LC_MESSAGES/extending/embedding.po -trans.pt_BR = extending/embedding.po -source_file = ../../pot/extending/embedding.pot +[o:python-doc:p:python-313:r:extending--embedding] +file_filter = extending/embedding.po type = PO minimum_perc = 0 resource_name = extending--embedding replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:extending--extending] -file_filter = .//LC_MESSAGES/extending/extending.po -trans.pt_BR = extending/extending.po -source_file = ../../pot/extending/extending.pot +[o:python-doc:p:python-313:r:extending--extending] +file_filter = extending/extending.po type = PO minimum_perc = 0 resource_name = extending--extending replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:extending--index] -file_filter = .//LC_MESSAGES/extending/index.po -trans.pt_BR = extending/index.po -source_file = ../../pot/extending/index.pot +[o:python-doc:p:python-313:r:extending--index] +file_filter = extending/index.po type = PO minimum_perc = 0 resource_name = extending--index replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:extending--newtypes] -file_filter = .//LC_MESSAGES/extending/newtypes.po -trans.pt_BR = extending/newtypes.po -source_file = ../../pot/extending/newtypes.pot +[o:python-doc:p:python-313:r:extending--newtypes] +file_filter = extending/newtypes.po type = PO minimum_perc = 0 resource_name = extending--newtypes 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 -trans.pt_BR = extending/newtypes_tutorial.po -source_file = ../../pot/extending/newtypes_tutorial.pot +[o:python-doc:p:python-313:r:extending--newtypes_tutorial] +file_filter = extending/newtypes_tutorial.po type = PO minimum_perc = 0 resource_name = extending--newtypes_tutorial replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:extending--windows] -file_filter = .//LC_MESSAGES/extending/windows.po -trans.pt_BR = extending/windows.po -source_file = ../../pot/extending/windows.pot +[o:python-doc:p:python-313:r:extending--windows] +file_filter = extending/windows.po type = PO minimum_perc = 0 resource_name = extending--windows replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:faq--design] -file_filter = .//LC_MESSAGES/faq/design.po -trans.pt_BR = faq/design.po -source_file = ../../pot/faq/design.pot +[o:python-doc:p:python-313:r:faq--design] +file_filter = faq/design.po type = PO minimum_perc = 0 resource_name = faq--design replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:faq--extending] -file_filter = .//LC_MESSAGES/faq/extending.po -trans.pt_BR = faq/extending.po -source_file = ../../pot/faq/extending.pot +[o:python-doc:p:python-313:r:faq--extending] +file_filter = faq/extending.po type = PO minimum_perc = 0 resource_name = faq--extending replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:faq--general] -file_filter = .//LC_MESSAGES/faq/general.po -trans.pt_BR = faq/general.po -source_file = ../../pot/faq/general.pot +[o:python-doc:p:python-313:r:faq--general] +file_filter = faq/general.po type = PO minimum_perc = 0 resource_name = faq--general replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:faq--gui] -file_filter = .//LC_MESSAGES/faq/gui.po -trans.pt_BR = faq/gui.po -source_file = ../../pot/faq/gui.pot +[o:python-doc:p:python-313:r:faq--gui] +file_filter = faq/gui.po type = PO minimum_perc = 0 resource_name = faq--gui replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:faq--index] -file_filter = .//LC_MESSAGES/faq/index.po -trans.pt_BR = faq/index.po -source_file = ../../pot/faq/index.pot +[o:python-doc:p:python-313:r:faq--index] +file_filter = faq/index.po type = PO minimum_perc = 0 resource_name = faq--index replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:faq--installed] -file_filter = .//LC_MESSAGES/faq/installed.po -trans.pt_BR = faq/installed.po -source_file = ../../pot/faq/installed.pot +[o:python-doc:p:python-313:r:faq--installed] +file_filter = faq/installed.po type = PO minimum_perc = 0 resource_name = faq--installed replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:faq--library] -file_filter = .//LC_MESSAGES/faq/library.po -trans.pt_BR = faq/library.po -source_file = ../../pot/faq/library.pot +[o:python-doc:p:python-313:r:faq--library] +file_filter = faq/library.po type = PO minimum_perc = 0 resource_name = faq--library replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:faq--programming] -file_filter = .//LC_MESSAGES/faq/programming.po -trans.pt_BR = faq/programming.po -source_file = ../../pot/faq/programming.pot +[o:python-doc:p:python-313:r:faq--programming] +file_filter = faq/programming.po type = PO minimum_perc = 0 resource_name = faq--programming replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:faq--windows] -file_filter = .//LC_MESSAGES/faq/windows.po -trans.pt_BR = faq/windows.po -source_file = ../../pot/faq/windows.pot +[o:python-doc:p:python-313:r:faq--windows] +file_filter = faq/windows.po type = PO minimum_perc = 0 resource_name = faq--windows replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:glossary_] -file_filter = .//LC_MESSAGES/glossary.po -trans.pt_BR = glossary.po -source_file = ../../pot/glossary.pot +[o:python-doc:p:python-313:r:glossary_] +file_filter = glossary.po type = PO minimum_perc = 0 resource_name = glossary_ replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:howto--annotations] -file_filter = .//LC_MESSAGES/howto/annotations.po -trans.pt_BR = howto/annotations.po -source_file = ../../pot/howto/annotations.pot +[o:python-doc:p:python-313:r:howto--a-conceptual-overview-of-asyncio] +file_filter = howto/a-conceptual-overview-of-asyncio.po +type = PO +minimum_perc = 0 +resource_name = howto--a-conceptual-overview-of-asyncio +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:howto--annotations] +file_filter = howto/annotations.po type = PO minimum_perc = 0 resource_name = howto--annotations replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:howto--argparse] -file_filter = .//LC_MESSAGES/howto/argparse.po -trans.pt_BR = howto/argparse.po -source_file = ../../pot/howto/argparse.pot +[o:python-doc:p:python-313:r:howto--argparse] +file_filter = howto/argparse.po type = PO minimum_perc = 0 resource_name = howto--argparse replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:howto--clinic] -file_filter = .//LC_MESSAGES/howto/clinic.po -trans.pt_BR = howto/clinic.po -source_file = ../../pot/howto/clinic.pot +[o:python-doc:p:python-313:r:howto--argparse-optparse] +file_filter = howto/argparse-optparse.po +type = PO +minimum_perc = 0 +resource_name = howto--argparse-optparse +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:howto--clinic] +file_filter = howto/clinic.po type = PO minimum_perc = 0 resource_name = howto--clinic replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:howto--cporting] -file_filter = .//LC_MESSAGES/howto/cporting.po -trans.pt_BR = howto/cporting.po -source_file = ../../pot/howto/cporting.pot +[o:python-doc:p:python-313:r:howto--cporting] +file_filter = howto/cporting.po type = PO minimum_perc = 0 resource_name = howto--cporting replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:howto--curses] -file_filter = .//LC_MESSAGES/howto/curses.po -trans.pt_BR = howto/curses.po -source_file = ../../pot/howto/curses.pot +[o:python-doc:p:python-313:r:howto--curses] +file_filter = howto/curses.po type = PO minimum_perc = 0 resource_name = howto--curses replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:howto--descriptor] -file_filter = .//LC_MESSAGES/howto/descriptor.po -trans.pt_BR = howto/descriptor.po -source_file = ../../pot/howto/descriptor.pot +[o:python-doc:p:python-313:r:howto--descriptor] +file_filter = howto/descriptor.po type = PO minimum_perc = 0 resource_name = howto--descriptor replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:howto--enum] -file_filter = .//LC_MESSAGES/howto/enum.po -trans.pt_BR = howto/enum.po -source_file = ../../pot/howto/enum.pot +[o:python-doc:p:python-313:r:howto--enum] +file_filter = howto/enum.po type = PO minimum_perc = 0 resource_name = howto--enum 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 -trans.pt_BR = howto/free-threading-extensions.po -source_file = ../../pot/howto/free-threading-extensions.pot +[o:python-doc:p:python-313:r:howto--free-threading-extensions] +file_filter = howto/free-threading-extensions.po type = PO minimum_perc = 0 resource_name = howto--free-threading-extensions replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:howto--functional] -file_filter = .//LC_MESSAGES/howto/functional.po -trans.pt_BR = howto/functional.po -source_file = ../../pot/howto/functional.pot +[o:python-doc:p:python-313:r:howto--free-threading-python] +file_filter = howto/free-threading-python.po +type = PO +minimum_perc = 0 +resource_name = howto--free-threading-python +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:howto--functional] +file_filter = howto/functional.po type = PO minimum_perc = 0 resource_name = howto--functional 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 -trans.pt_BR = howto/gdb_helpers.po -source_file = ../../pot/howto/gdb_helpers.pot +[o:python-doc:p:python-313:r:howto--gdb_helpers] +file_filter = howto/gdb_helpers.po type = PO minimum_perc = 0 resource_name = howto--gdb_helpers replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:howto--index] -file_filter = .//LC_MESSAGES/howto/index.po -trans.pt_BR = howto/index.po -source_file = ../../pot/howto/index.pot +[o:python-doc:p:python-313:r:howto--index] +file_filter = howto/index.po type = PO minimum_perc = 0 resource_name = howto--index replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:howto--instrumentation] -file_filter = .//LC_MESSAGES/howto/instrumentation.po -trans.pt_BR = howto/instrumentation.po -source_file = ../../pot/howto/instrumentation.pot +[o:python-doc:p:python-313:r:howto--instrumentation] +file_filter = howto/instrumentation.po type = PO minimum_perc = 0 resource_name = howto--instrumentation replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:howto--ipaddress] -file_filter = .//LC_MESSAGES/howto/ipaddress.po -trans.pt_BR = howto/ipaddress.po -source_file = ../../pot/howto/ipaddress.pot +[o:python-doc:p:python-313:r:howto--ipaddress] +file_filter = howto/ipaddress.po type = PO minimum_perc = 0 resource_name = howto--ipaddress 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 -trans.pt_BR = howto/isolating-extensions.po -source_file = ../../pot/howto/isolating-extensions.pot +[o:python-doc:p:python-313:r:howto--isolating-extensions] +file_filter = howto/isolating-extensions.po type = PO minimum_perc = 0 resource_name = howto--isolating-extensions replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:howto--logging] -file_filter = .//LC_MESSAGES/howto/logging.po -trans.pt_BR = howto/logging.po -source_file = ../../pot/howto/logging.pot +[o:python-doc:p:python-313:r:howto--logging] +file_filter = howto/logging.po type = PO minimum_perc = 0 resource_name = howto--logging 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 -trans.pt_BR = howto/logging-cookbook.po -source_file = ../../pot/howto/logging-cookbook.pot +[o:python-doc:p:python-313:r:howto--logging-cookbook] +file_filter = howto/logging-cookbook.po type = PO minimum_perc = 0 resource_name = howto--logging-cookbook replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:howto--mro] -file_filter = .//LC_MESSAGES/howto/mro.po -trans.pt_BR = howto/mro.po -source_file = ../../pot/howto/mro.pot +[o:python-doc:p:python-313:r:howto--mro] +file_filter = howto/mro.po type = PO minimum_perc = 0 resource_name = howto--mro 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 -trans.pt_BR = howto/perf_profiling.po -source_file = ../../pot/howto/perf_profiling.pot +[o:python-doc:p:python-313:r:howto--perf_profiling] +file_filter = howto/perf_profiling.po type = PO minimum_perc = 0 resource_name = howto--perf_profiling replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:howto--pyporting] -file_filter = .//LC_MESSAGES/howto/pyporting.po -trans.pt_BR = howto/pyporting.po -source_file = ../../pot/howto/pyporting.pot +[o:python-doc:p:python-313:r:howto--pyporting] +file_filter = howto/pyporting.po type = PO minimum_perc = 0 resource_name = howto--pyporting replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:howto--regex] -file_filter = .//LC_MESSAGES/howto/regex.po -trans.pt_BR = howto/regex.po -source_file = ../../pot/howto/regex.pot +[o:python-doc:p:python-313:r:howto--regex] +file_filter = howto/regex.po type = PO minimum_perc = 0 resource_name = howto--regex replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:howto--sockets] -file_filter = .//LC_MESSAGES/howto/sockets.po -trans.pt_BR = howto/sockets.po -source_file = ../../pot/howto/sockets.pot +[o:python-doc:p:python-313:r:howto--sockets] +file_filter = howto/sockets.po type = PO minimum_perc = 0 resource_name = howto--sockets replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:howto--sorting] -file_filter = .//LC_MESSAGES/howto/sorting.po -trans.pt_BR = howto/sorting.po -source_file = ../../pot/howto/sorting.pot +[o:python-doc:p:python-313:r:howto--sorting] +file_filter = howto/sorting.po type = PO minimum_perc = 0 resource_name = howto--sorting replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:howto--timerfd] -file_filter = .//LC_MESSAGES/howto/timerfd.po -trans.pt_BR = howto/timerfd.po -source_file = ../../pot/howto/timerfd.pot +[o:python-doc:p:python-313:r:howto--timerfd] +file_filter = howto/timerfd.po type = PO minimum_perc = 0 resource_name = howto--timerfd replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:howto--unicode] -file_filter = .//LC_MESSAGES/howto/unicode.po -trans.pt_BR = howto/unicode.po -source_file = ../../pot/howto/unicode.pot +[o:python-doc:p:python-313:r:howto--unicode] +file_filter = howto/unicode.po type = PO minimum_perc = 0 resource_name = howto--unicode replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:howto--urllib2] -file_filter = .//LC_MESSAGES/howto/urllib2.po -trans.pt_BR = howto/urllib2.po -source_file = ../../pot/howto/urllib2.pot +[o:python-doc:p:python-313:r:howto--urllib2] +file_filter = howto/urllib2.po type = PO minimum_perc = 0 resource_name = howto--urllib2 replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:installing--index] -file_filter = .//LC_MESSAGES/installing/index.po -trans.pt_BR = installing/index.po -source_file = ../../pot/installing/index.pot +[o:python-doc:p:python-313:r:installing--index] +file_filter = installing/index.po type = PO minimum_perc = 0 resource_name = installing--index replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--__future__] -file_filter = .//LC_MESSAGES/library/__future__.po -trans.pt_BR = library/__future__.po -source_file = ../../pot/library/__future__.pot +[o:python-doc:p:python-313:r:library--abc] +file_filter = library/abc.po type = PO minimum_perc = 0 -resource_name = library--__future__ -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--__main__] -file_filter = .//LC_MESSAGES/library/__main__.po -trans.pt_BR = library/__main__.po -source_file = ../../pot/library/__main__.pot -type = PO -minimum_perc = 0 -resource_name = library--__main__ -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--_thread] -file_filter = .//LC_MESSAGES/library/_thread.po -trans.pt_BR = library/_thread.po -source_file = ../../pot/library/_thread.pot -type = PO -minimum_perc = 0 -resource_name = library--_thread +resource_name = library--abc replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--abc] -file_filter = .//LC_MESSAGES/library/abc.po -trans.pt_BR = library/abc.po -source_file = ../../pot/library/abc.pot +[o:python-doc:p:python-313:r:library--aifc] +file_filter = library/aifc.po type = PO minimum_perc = 0 -resource_name = library--abc +resource_name = library--aifc replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--allos] -file_filter = .//LC_MESSAGES/library/allos.po -trans.pt_BR = library/allos.po -source_file = ../../pot/library/allos.pot +[o:python-doc:p:python-313:r:library--allos] +file_filter = library/allos.po type = PO minimum_perc = 0 resource_name = library--allos replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--archiving] -file_filter = .//LC_MESSAGES/library/archiving.po -trans.pt_BR = library/archiving.po -source_file = ../../pot/library/archiving.pot +[o:python-doc:p:python-313:r:library--archiving] +file_filter = library/archiving.po type = PO minimum_perc = 0 resource_name = library--archiving replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--argparse] -file_filter = .//LC_MESSAGES/library/argparse.po -trans.pt_BR = library/argparse.po -source_file = ../../pot/library/argparse.pot +[o:python-doc:p:python-313:r:library--argparse] +file_filter = library/argparse.po type = PO minimum_perc = 0 resource_name = library--argparse replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--array] -file_filter = .//LC_MESSAGES/library/array.po -trans.pt_BR = library/array.po -source_file = ../../pot/library/array.pot +[o:python-doc:p:python-313:r:library--array] +file_filter = library/array.po type = PO minimum_perc = 0 resource_name = library--array replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--ast] -file_filter = .//LC_MESSAGES/library/ast.po -trans.pt_BR = library/ast.po -source_file = ../../pot/library/ast.pot +[o:python-doc:p:python-313:r:library--ast] +file_filter = library/ast.po type = PO minimum_perc = 0 resource_name = library--ast replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--asyncio] -file_filter = .//LC_MESSAGES/library/asyncio.po -trans.pt_BR = library/asyncio.po -source_file = ../../pot/library/asyncio.pot +[o:python-doc:p:python-313:r:library--asynchat] +file_filter = library/asynchat.po +type = PO +minimum_perc = 0 +resource_name = library--asynchat +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:library--asyncio] +file_filter = library/asyncio.po type = PO minimum_perc = 0 resource_name = library--asyncio 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 -trans.pt_BR = library/asyncio-api-index.po -source_file = ../../pot/library/asyncio-api-index.pot +[o:python-doc:p:python-313:r:library--asyncio-api-index] +file_filter = library/asyncio-api-index.po type = PO minimum_perc = 0 resource_name = library--asyncio-api-index 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 -trans.pt_BR = library/asyncio-dev.po -source_file = ../../pot/library/asyncio-dev.pot +[o:python-doc:p:python-313:r:library--asyncio-dev] +file_filter = library/asyncio-dev.po type = PO minimum_perc = 0 resource_name = library--asyncio-dev 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 -trans.pt_BR = library/asyncio-eventloop.po -source_file = ../../pot/library/asyncio-eventloop.pot +[o:python-doc:p:python-313:r:library--asyncio-eventloop] +file_filter = library/asyncio-eventloop.po type = PO minimum_perc = 0 resource_name = library--asyncio-eventloop 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 -trans.pt_BR = library/asyncio-exceptions.po -source_file = ../../pot/library/asyncio-exceptions.pot +[o:python-doc:p:python-313:r:library--asyncio-exceptions] +file_filter = library/asyncio-exceptions.po type = PO minimum_perc = 0 resource_name = library--asyncio-exceptions 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 -trans.pt_BR = library/asyncio-extending.po -source_file = ../../pot/library/asyncio-extending.pot +[o:python-doc:p:python-313:r:library--asyncio-extending] +file_filter = library/asyncio-extending.po type = PO minimum_perc = 0 resource_name = library--asyncio-extending 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 -trans.pt_BR = library/asyncio-future.po -source_file = ../../pot/library/asyncio-future.pot +[o:python-doc:p:python-313:r:library--asyncio-future] +file_filter = library/asyncio-future.po type = PO minimum_perc = 0 resource_name = library--asyncio-future 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 -trans.pt_BR = library/asyncio-llapi-index.po -source_file = ../../pot/library/asyncio-llapi-index.pot +[o:python-doc:p:python-313:r:library--asyncio-llapi-index] +file_filter = library/asyncio-llapi-index.po type = PO minimum_perc = 0 resource_name = library--asyncio-llapi-index 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 -trans.pt_BR = library/asyncio-platforms.po -source_file = ../../pot/library/asyncio-platforms.pot +[o:python-doc:p:python-313:r:library--asyncio-platforms] +file_filter = library/asyncio-platforms.po type = PO minimum_perc = 0 resource_name = library--asyncio-platforms 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 -trans.pt_BR = library/asyncio-policy.po -source_file = ../../pot/library/asyncio-policy.pot +[o:python-doc:p:python-313:r:library--asyncio-policy] +file_filter = library/asyncio-policy.po type = PO minimum_perc = 0 resource_name = library--asyncio-policy 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 -trans.pt_BR = library/asyncio-protocol.po -source_file = ../../pot/library/asyncio-protocol.pot +[o:python-doc:p:python-313:r:library--asyncio-protocol] +file_filter = library/asyncio-protocol.po type = PO minimum_perc = 0 resource_name = library--asyncio-protocol 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 -trans.pt_BR = library/asyncio-queue.po -source_file = ../../pot/library/asyncio-queue.pot +[o:python-doc:p:python-313:r:library--asyncio-queue] +file_filter = library/asyncio-queue.po type = PO minimum_perc = 0 resource_name = library--asyncio-queue 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 -trans.pt_BR = library/asyncio-runner.po -source_file = ../../pot/library/asyncio-runner.pot +[o:python-doc:p:python-313:r:library--asyncio-runner] +file_filter = library/asyncio-runner.po type = PO minimum_perc = 0 resource_name = library--asyncio-runner 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 -trans.pt_BR = library/asyncio-stream.po -source_file = ../../pot/library/asyncio-stream.pot +[o:python-doc:p:python-313:r:library--asyncio-stream] +file_filter = library/asyncio-stream.po type = PO minimum_perc = 0 resource_name = library--asyncio-stream 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 -trans.pt_BR = library/asyncio-subprocess.po -source_file = ../../pot/library/asyncio-subprocess.pot +[o:python-doc:p:python-313:r:library--asyncio-subprocess] +file_filter = library/asyncio-subprocess.po type = PO minimum_perc = 0 resource_name = library--asyncio-subprocess 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 -trans.pt_BR = library/asyncio-sync.po -source_file = ../../pot/library/asyncio-sync.pot +[o:python-doc:p:python-313:r:library--asyncio-sync] +file_filter = library/asyncio-sync.po type = PO minimum_perc = 0 resource_name = library--asyncio-sync 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 -trans.pt_BR = library/asyncio-task.po -source_file = ../../pot/library/asyncio-task.pot +[o:python-doc:p:python-313:r:library--asyncio-task] +file_filter = library/asyncio-task.po type = PO minimum_perc = 0 resource_name = library--asyncio-task replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--atexit] -file_filter = .//LC_MESSAGES/library/atexit.po -trans.pt_BR = library/atexit.po -source_file = ../../pot/library/atexit.pot +[o:python-doc:p:python-313:r:library--asyncore] +file_filter = library/asyncore.po +type = PO +minimum_perc = 0 +resource_name = library--asyncore +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:library--atexit] +file_filter = library/atexit.po type = PO minimum_perc = 0 resource_name = library--atexit 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 -trans.pt_BR = library/audit_events.po -source_file = ../../pot/library/audit_events.pot +[o:python-doc:p:python-313:r:library--audioop] +file_filter = library/audioop.po +type = PO +minimum_perc = 0 +resource_name = library--audioop +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:library--audit_events] +file_filter = library/audit_events.po type = PO minimum_perc = 0 resource_name = library--audit_events replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--base64] -file_filter = .//LC_MESSAGES/library/base64.po -trans.pt_BR = library/base64.po -source_file = ../../pot/library/base64.pot +[o:python-doc:p:python-313:r:library--base64] +file_filter = library/base64.po type = PO minimum_perc = 0 resource_name = library--base64 replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--bdb] -file_filter = .//LC_MESSAGES/library/bdb.po -trans.pt_BR = library/bdb.po -source_file = ../../pot/library/bdb.pot +[o:python-doc:p:python-313:r:library--bdb] +file_filter = library/bdb.po type = PO minimum_perc = 0 resource_name = library--bdb replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--binary] -file_filter = .//LC_MESSAGES/library/binary.po -trans.pt_BR = library/binary.po -source_file = ../../pot/library/binary.pot +[o:python-doc:p:python-313:r:library--binary] +file_filter = library/binary.po type = PO minimum_perc = 0 resource_name = library--binary replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--binascii] -file_filter = .//LC_MESSAGES/library/binascii.po -trans.pt_BR = library/binascii.po -source_file = ../../pot/library/binascii.pot +[o:python-doc:p:python-313:r:library--binascii] +file_filter = library/binascii.po type = PO minimum_perc = 0 resource_name = library--binascii replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--bisect] -file_filter = .//LC_MESSAGES/library/bisect.po -trans.pt_BR = library/bisect.po -source_file = ../../pot/library/bisect.pot +[o:python-doc:p:python-313:r:library--bisect] +file_filter = library/bisect.po type = PO minimum_perc = 0 resource_name = library--bisect replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--builtins] -file_filter = .//LC_MESSAGES/library/builtins.po -trans.pt_BR = library/builtins.po -source_file = ../../pot/library/builtins.pot +[o:python-doc:p:python-313:r:library--builtins] +file_filter = library/builtins.po type = PO minimum_perc = 0 resource_name = library--builtins replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--bz2] -file_filter = .//LC_MESSAGES/library/bz2.po -trans.pt_BR = library/bz2.po -source_file = ../../pot/library/bz2.pot +[o:python-doc:p:python-313:r:library--bz2] +file_filter = library/bz2.po type = PO minimum_perc = 0 resource_name = library--bz2 replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--calendar] -file_filter = .//LC_MESSAGES/library/calendar.po -trans.pt_BR = library/calendar.po -source_file = ../../pot/library/calendar.pot +[o:python-doc:p:python-313:r:library--calendar] +file_filter = library/calendar.po type = PO minimum_perc = 0 resource_name = library--calendar replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--cmath] -file_filter = .//LC_MESSAGES/library/cmath.po -trans.pt_BR = library/cmath.po -source_file = ../../pot/library/cmath.pot +[o:python-doc:p:python-313:r:library--cgi] +file_filter = library/cgi.po +type = PO +minimum_perc = 0 +resource_name = library--cgi +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:library--cgitb] +file_filter = library/cgitb.po +type = PO +minimum_perc = 0 +resource_name = library--cgitb +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:library--chunk] +file_filter = library/chunk.po +type = PO +minimum_perc = 0 +resource_name = library--chunk +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:library--cmath] +file_filter = library/cmath.po type = PO minimum_perc = 0 resource_name = library--cmath replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--cmd] -file_filter = .//LC_MESSAGES/library/cmd.po -trans.pt_BR = library/cmd.po -source_file = ../../pot/library/cmd.pot +[o:python-doc:p:python-313:r:library--cmd] +file_filter = library/cmd.po type = PO minimum_perc = 0 resource_name = library--cmd replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--cmdline] -file_filter = .//LC_MESSAGES/library/cmdline.po -trans.pt_BR = library/cmdline.po -source_file = ../../pot/library/cmdline.pot +[o:python-doc:p:python-313:r:library--cmdline] +file_filter = library/cmdline.po type = PO minimum_perc = 0 resource_name = library--cmdline replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--code] -file_filter = .//LC_MESSAGES/library/code.po -trans.pt_BR = library/code.po -source_file = ../../pot/library/code.pot +[o:python-doc:p:python-313:r:library--cmdlinelibs] +file_filter = library/cmdlinelibs.po +type = PO +minimum_perc = 0 +resource_name = library--cmdlinelibs +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:library--code] +file_filter = library/code.po type = PO minimum_perc = 0 resource_name = library--code replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--codecs] -file_filter = .//LC_MESSAGES/library/codecs.po -trans.pt_BR = library/codecs.po -source_file = ../../pot/library/codecs.pot +[o:python-doc:p:python-313:r:library--codecs] +file_filter = library/codecs.po type = PO minimum_perc = 0 resource_name = library--codecs replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--codeop] -file_filter = .//LC_MESSAGES/library/codeop.po -trans.pt_BR = library/codeop.po -source_file = ../../pot/library/codeop.pot +[o:python-doc:p:python-313:r:library--codeop] +file_filter = library/codeop.po type = PO minimum_perc = 0 resource_name = library--codeop replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--collections] -file_filter = .//LC_MESSAGES/library/collections.po -trans.pt_BR = library/collections.po -source_file = ../../pot/library/collections.pot +[o:python-doc:p:python-313:r:library--collections] +file_filter = library/collections.po type = PO minimum_perc = 0 resource_name = library--collections 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 -trans.pt_BR = library/collections.abc.po -source_file = ../../pot/library/collections.abc.pot +[o:python-doc:p:python-313:r:library--collections_abc] +file_filter = library/collections.abc.po type = PO minimum_perc = 0 resource_name = library--collections_abc replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--colorsys] -file_filter = .//LC_MESSAGES/library/colorsys.po -trans.pt_BR = library/colorsys.po -source_file = ../../pot/library/colorsys.pot +[o:python-doc:p:python-313:r:library--colorsys] +file_filter = library/colorsys.po type = PO minimum_perc = 0 resource_name = library--colorsys replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--compileall] -file_filter = .//LC_MESSAGES/library/compileall.po -trans.pt_BR = library/compileall.po -source_file = ../../pot/library/compileall.pot +[o:python-doc:p:python-313:r:library--compileall] +file_filter = library/compileall.po type = PO minimum_perc = 0 resource_name = library--compileall replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--concurrency] -file_filter = .//LC_MESSAGES/library/concurrency.po -trans.pt_BR = library/concurrency.po -source_file = ../../pot/library/concurrency.pot +[o:python-doc:p:python-313:r:library--concurrency] +file_filter = library/concurrency.po type = PO minimum_perc = 0 resource_name = library--concurrency replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--concurrent] -file_filter = .//LC_MESSAGES/library/concurrent.po -trans.pt_BR = library/concurrent.po -source_file = ../../pot/library/concurrent.pot +[o:python-doc:p:python-313:r:library--concurrent] +file_filter = library/concurrent.po type = PO minimum_perc = 0 resource_name = library--concurrent 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 -trans.pt_BR = library/concurrent.futures.po -source_file = ../../pot/library/concurrent.futures.pot +[o:python-doc:p:python-313:r:library--concurrent_futures] +file_filter = library/concurrent.futures.po type = PO minimum_perc = 0 resource_name = library--concurrent_futures replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--configparser] -file_filter = .//LC_MESSAGES/library/configparser.po -trans.pt_BR = library/configparser.po -source_file = ../../pot/library/configparser.pot +[o:python-doc:p:python-313:r:library--configparser] +file_filter = library/configparser.po type = PO minimum_perc = 0 resource_name = library--configparser replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--constants] -file_filter = .//LC_MESSAGES/library/constants.po -trans.pt_BR = library/constants.po -source_file = ../../pot/library/constants.pot +[o:python-doc:p:python-313:r:library--contextlib] +file_filter = library/contextlib.po type = PO minimum_perc = 0 -resource_name = library--constants +resource_name = library--contextlib replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--contextlib] -file_filter = .//LC_MESSAGES/library/contextlib.po -trans.pt_BR = library/contextlib.po -source_file = ../../pot/library/contextlib.pot +[o:python-doc:p:python-313:r:library--contextvars] +file_filter = library/contextvars.po type = PO minimum_perc = 0 -resource_name = library--contextlib +resource_name = library--contextvars replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--contextvars] -file_filter = .//LC_MESSAGES/library/contextvars.po -trans.pt_BR = library/contextvars.po -source_file = ../../pot/library/contextvars.pot +[o:python-doc:p:python-313:r:library--copy] +file_filter = library/copy.po type = PO minimum_perc = 0 -resource_name = library--contextvars +resource_name = library--copy replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--copy] -file_filter = .//LC_MESSAGES/library/copy.po -trans.pt_BR = library/copy.po -source_file = ../../pot/library/copy.pot +[o:python-doc:p:python-313:r:library--copyreg] +file_filter = library/copyreg.po type = PO minimum_perc = 0 -resource_name = library--copy +resource_name = library--copyreg replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--copyreg] -file_filter = .//LC_MESSAGES/library/copyreg.po -trans.pt_BR = library/copyreg.po -source_file = ../../pot/library/copyreg.pot +[o:python-doc:p:python-313:r:library--crypt] +file_filter = library/crypt.po type = PO minimum_perc = 0 -resource_name = library--copyreg +resource_name = library--crypt replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--crypto] -file_filter = .//LC_MESSAGES/library/crypto.po -trans.pt_BR = library/crypto.po -source_file = ../../pot/library/crypto.pot +[o:python-doc:p:python-313:r:library--crypto] +file_filter = library/crypto.po type = PO minimum_perc = 0 resource_name = library--crypto replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--csv] -file_filter = .//LC_MESSAGES/library/csv.po -trans.pt_BR = library/csv.po -source_file = ../../pot/library/csv.pot +[o:python-doc:p:python-313:r:library--csv] +file_filter = library/csv.po type = PO minimum_perc = 0 resource_name = library--csv replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--ctypes] -file_filter = .//LC_MESSAGES/library/ctypes.po -trans.pt_BR = library/ctypes.po -source_file = ../../pot/library/ctypes.pot +[o:python-doc:p:python-313:r:library--ctypes] +file_filter = library/ctypes.po type = PO minimum_perc = 0 resource_name = library--ctypes replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--curses] -file_filter = .//LC_MESSAGES/library/curses.po -trans.pt_BR = library/curses.po -source_file = ../../pot/library/curses.pot +[o:python-doc:p:python-313:r:library--curses] +file_filter = library/curses.po type = PO minimum_perc = 0 resource_name = library--curses 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 -trans.pt_BR = library/curses.ascii.po -source_file = ../../pot/library/curses.ascii.pot +[o:python-doc:p:python-313:r:library--curses_ascii] +file_filter = library/curses.ascii.po type = PO minimum_perc = 0 resource_name = library--curses_ascii 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 -trans.pt_BR = library/curses.panel.po -source_file = ../../pot/library/curses.panel.pot +[o:python-doc:p:python-313:r:library--curses_panel] +file_filter = library/curses.panel.po type = PO minimum_perc = 0 resource_name = library--curses_panel replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--custominterp] -file_filter = .//LC_MESSAGES/library/custominterp.po -trans.pt_BR = library/custominterp.po -source_file = ../../pot/library/custominterp.pot +[o:python-doc:p:python-313:r:library--custominterp] +file_filter = library/custominterp.po type = PO minimum_perc = 0 resource_name = library--custominterp replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--dataclasses] -file_filter = .//LC_MESSAGES/library/dataclasses.po -trans.pt_BR = library/dataclasses.po -source_file = ../../pot/library/dataclasses.pot +[o:python-doc:p:python-313:r:library--dataclasses] +file_filter = library/dataclasses.po type = PO minimum_perc = 0 resource_name = library--dataclasses replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--datatypes] -file_filter = .//LC_MESSAGES/library/datatypes.po -trans.pt_BR = library/datatypes.po -source_file = ../../pot/library/datatypes.pot +[o:python-doc:p:python-313:r:library--datatypes] +file_filter = library/datatypes.po type = PO minimum_perc = 0 resource_name = library--datatypes replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--datetime] -file_filter = .//LC_MESSAGES/library/datetime.po -trans.pt_BR = library/datetime.po -source_file = ../../pot/library/datetime.pot +[o:python-doc:p:python-313:r:library--datetime] +file_filter = library/datetime.po type = PO minimum_perc = 0 resource_name = library--datetime replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--dbm] -file_filter = .//LC_MESSAGES/library/dbm.po -trans.pt_BR = library/dbm.po -source_file = ../../pot/library/dbm.pot +[o:python-doc:p:python-313:r:library--dbm] +file_filter = library/dbm.po type = PO minimum_perc = 0 resource_name = library--dbm replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--debug] -file_filter = .//LC_MESSAGES/library/debug.po -trans.pt_BR = library/debug.po -source_file = ../../pot/library/debug.pot +[o:python-doc:p:python-313:r:library--debug] +file_filter = library/debug.po type = PO minimum_perc = 0 resource_name = library--debug replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--decimal] -file_filter = .//LC_MESSAGES/library/decimal.po -trans.pt_BR = library/decimal.po -source_file = ../../pot/library/decimal.pot +[o:python-doc:p:python-313:r:library--decimal] +file_filter = library/decimal.po type = PO minimum_perc = 0 resource_name = library--decimal replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--development] -file_filter = .//LC_MESSAGES/library/development.po -trans.pt_BR = library/development.po -source_file = ../../pot/library/development.pot +[o:python-doc:p:python-313:r:library--development] +file_filter = library/development.po type = PO minimum_perc = 0 resource_name = library--development replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--devmode] -file_filter = .//LC_MESSAGES/library/devmode.po -trans.pt_BR = library/devmode.po -source_file = ../../pot/library/devmode.pot +[o:python-doc:p:python-313:r:library--devmode] +file_filter = library/devmode.po type = PO minimum_perc = 0 resource_name = library--devmode replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--dialog] -file_filter = .//LC_MESSAGES/library/dialog.po -trans.pt_BR = library/dialog.po -source_file = ../../pot/library/dialog.pot +[o:python-doc:p:python-313:r:library--dialog] +file_filter = library/dialog.po type = PO minimum_perc = 0 resource_name = library--dialog replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--difflib] -file_filter = .//LC_MESSAGES/library/difflib.po -trans.pt_BR = library/difflib.po -source_file = ../../pot/library/difflib.pot +[o:python-doc:p:python-313:r:library--difflib] +file_filter = library/difflib.po type = PO minimum_perc = 0 resource_name = library--difflib replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--dis] -file_filter = .//LC_MESSAGES/library/dis.po -trans.pt_BR = library/dis.po -source_file = ../../pot/library/dis.pot +[o:python-doc:p:python-313:r:library--dis] +file_filter = library/dis.po type = PO minimum_perc = 0 resource_name = library--dis replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--distribution] -file_filter = .//LC_MESSAGES/library/distribution.po -trans.pt_BR = library/distribution.po -source_file = ../../pot/library/distribution.pot +[o:python-doc:p:python-313:r:library--distribution] +file_filter = library/distribution.po type = PO minimum_perc = 0 resource_name = library--distribution replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--doctest] -file_filter = .//LC_MESSAGES/library/doctest.po -trans.pt_BR = library/doctest.po -source_file = ../../pot/library/doctest.pot +[o:python-doc:p:python-313:r:library--distutils] +file_filter = library/distutils.po +type = PO +minimum_perc = 0 +resource_name = library--distutils +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:library--doctest] +file_filter = library/doctest.po type = PO minimum_perc = 0 resource_name = library--doctest replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--email] -file_filter = .//LC_MESSAGES/library/email.po -trans.pt_BR = library/email.po -source_file = ../../pot/library/email.pot +[o:python-doc:p:python-313:r:library--email] +file_filter = library/email.po type = PO minimum_perc = 0 resource_name = library--email 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 -trans.pt_BR = library/email.charset.po -source_file = ../../pot/library/email.charset.pot +[o:python-doc:p:python-313:r:library--email_charset] +file_filter = library/email.charset.po type = PO minimum_perc = 0 resource_name = library--email_charset 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 -trans.pt_BR = library/email.compat32-message.po -source_file = ../../pot/library/email.compat32-message.pot +[o:python-doc:p:python-313:r:library--email_compat32-message] +file_filter = library/email.compat32-message.po type = PO minimum_perc = 0 resource_name = library--email_compat32-message 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 -trans.pt_BR = library/email.contentmanager.po -source_file = ../../pot/library/email.contentmanager.pot +[o:python-doc:p:python-313:r:library--email_contentmanager] +file_filter = library/email.contentmanager.po type = PO minimum_perc = 0 resource_name = library--email_contentmanager 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 -trans.pt_BR = library/email.encoders.po -source_file = ../../pot/library/email.encoders.pot +[o:python-doc:p:python-313:r:library--email_encoders] +file_filter = library/email.encoders.po type = PO minimum_perc = 0 resource_name = library--email_encoders 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 -trans.pt_BR = library/email.errors.po -source_file = ../../pot/library/email.errors.pot +[o:python-doc:p:python-313:r:library--email_errors] +file_filter = library/email.errors.po type = PO minimum_perc = 0 resource_name = library--email_errors 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 -trans.pt_BR = library/email.examples.po -source_file = ../../pot/library/email.examples.pot +[o:python-doc:p:python-313:r:library--email_examples] +file_filter = library/email.examples.po type = PO minimum_perc = 0 resource_name = library--email_examples 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 -trans.pt_BR = library/email.generator.po -source_file = ../../pot/library/email.generator.pot +[o:python-doc:p:python-313:r:library--email_generator] +file_filter = library/email.generator.po type = PO minimum_perc = 0 resource_name = library--email_generator 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 -trans.pt_BR = library/email.header.po -source_file = ../../pot/library/email.header.pot +[o:python-doc:p:python-313:r:library--email_header] +file_filter = library/email.header.po type = PO minimum_perc = 0 resource_name = library--email_header 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 -trans.pt_BR = library/email.headerregistry.po -source_file = ../../pot/library/email.headerregistry.pot +[o:python-doc:p:python-313:r:library--email_headerregistry] +file_filter = library/email.headerregistry.po type = PO minimum_perc = 0 resource_name = library--email_headerregistry 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 -trans.pt_BR = library/email.iterators.po -source_file = ../../pot/library/email.iterators.pot +[o:python-doc:p:python-313:r:library--email_iterators] +file_filter = library/email.iterators.po type = PO minimum_perc = 0 resource_name = library--email_iterators 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 -trans.pt_BR = library/email.message.po -source_file = ../../pot/library/email.message.pot +[o:python-doc:p:python-313:r:library--email_message] +file_filter = library/email.message.po type = PO minimum_perc = 0 resource_name = library--email_message 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 -trans.pt_BR = library/email.mime.po -source_file = ../../pot/library/email.mime.pot +[o:python-doc:p:python-313:r:library--email_mime] +file_filter = library/email.mime.po type = PO minimum_perc = 0 resource_name = library--email_mime 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 -trans.pt_BR = library/email.parser.po -source_file = ../../pot/library/email.parser.pot +[o:python-doc:p:python-313:r:library--email_parser] +file_filter = library/email.parser.po type = PO minimum_perc = 0 resource_name = library--email_parser 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 -trans.pt_BR = library/email.policy.po -source_file = ../../pot/library/email.policy.pot +[o:python-doc:p:python-313:r:library--email_policy] +file_filter = library/email.policy.po type = PO minimum_perc = 0 resource_name = library--email_policy 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 -trans.pt_BR = library/email.utils.po -source_file = ../../pot/library/email.utils.pot +[o:python-doc:p:python-313:r:library--email_utils] +file_filter = library/email.utils.po type = PO minimum_perc = 0 resource_name = library--email_utils replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--ensurepip] -file_filter = .//LC_MESSAGES/library/ensurepip.po -trans.pt_BR = library/ensurepip.po -source_file = ../../pot/library/ensurepip.pot +[o:python-doc:p:python-313:r:library--ensurepip] +file_filter = library/ensurepip.po type = PO minimum_perc = 0 resource_name = library--ensurepip replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--enum] -file_filter = .//LC_MESSAGES/library/enum.po -trans.pt_BR = library/enum.po -source_file = ../../pot/library/enum.pot +[o:python-doc:p:python-313:r:library--enum] +file_filter = library/enum.po type = PO minimum_perc = 0 resource_name = library--enum replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--errno] -file_filter = .//LC_MESSAGES/library/errno.po -trans.pt_BR = library/errno.po -source_file = ../../pot/library/errno.pot +[o:python-doc:p:python-313:r:library--errno] +file_filter = library/errno.po type = PO minimum_perc = 0 resource_name = library--errno replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--exceptions] -file_filter = .//LC_MESSAGES/library/exceptions.po -trans.pt_BR = library/exceptions.po -source_file = ../../pot/library/exceptions.pot -type = PO -minimum_perc = 0 -resource_name = library--exceptions -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--faulthandler] -file_filter = .//LC_MESSAGES/library/faulthandler.po -trans.pt_BR = library/faulthandler.po -source_file = ../../pot/library/faulthandler.pot +[o:python-doc:p:python-313:r:library--faulthandler] +file_filter = library/faulthandler.po type = PO minimum_perc = 0 resource_name = library--faulthandler replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--fcntl] -file_filter = .//LC_MESSAGES/library/fcntl.po -trans.pt_BR = library/fcntl.po -source_file = ../../pot/library/fcntl.pot +[o:python-doc:p:python-313:r:library--fcntl] +file_filter = library/fcntl.po type = PO minimum_perc = 0 resource_name = library--fcntl replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--filecmp] -file_filter = .//LC_MESSAGES/library/filecmp.po -trans.pt_BR = library/filecmp.po -source_file = ../../pot/library/filecmp.pot +[o:python-doc:p:python-313:r:library--filecmp] +file_filter = library/filecmp.po type = PO minimum_perc = 0 resource_name = library--filecmp replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--fileformats] -file_filter = .//LC_MESSAGES/library/fileformats.po -trans.pt_BR = library/fileformats.po -source_file = ../../pot/library/fileformats.pot +[o:python-doc:p:python-313:r:library--fileformats] +file_filter = library/fileformats.po type = PO minimum_perc = 0 resource_name = library--fileformats replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--fileinput] -file_filter = .//LC_MESSAGES/library/fileinput.po -trans.pt_BR = library/fileinput.po -source_file = ../../pot/library/fileinput.pot +[o:python-doc:p:python-313:r:library--fileinput] +file_filter = library/fileinput.po type = PO minimum_perc = 0 resource_name = library--fileinput replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--filesys] -file_filter = .//LC_MESSAGES/library/filesys.po -trans.pt_BR = library/filesys.po -source_file = ../../pot/library/filesys.pot +[o:python-doc:p:python-313:r:library--filesys] +file_filter = library/filesys.po type = PO minimum_perc = 0 resource_name = library--filesys replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--fnmatch] -file_filter = .//LC_MESSAGES/library/fnmatch.po -trans.pt_BR = library/fnmatch.po -source_file = ../../pot/library/fnmatch.pot +[o:python-doc:p:python-313:r:library--fnmatch] +file_filter = library/fnmatch.po type = PO minimum_perc = 0 resource_name = library--fnmatch replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--fractions] -file_filter = .//LC_MESSAGES/library/fractions.po -trans.pt_BR = library/fractions.po -source_file = ../../pot/library/fractions.pot +[o:python-doc:p:python-313:r:library--fractions] +file_filter = library/fractions.po type = PO minimum_perc = 0 resource_name = library--fractions replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--frameworks] -file_filter = .//LC_MESSAGES/library/frameworks.po -trans.pt_BR = library/frameworks.po -source_file = ../../pot/library/frameworks.pot +[o:python-doc:p:python-313:r:library--frameworks] +file_filter = library/frameworks.po type = PO minimum_perc = 0 resource_name = library--frameworks replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--ftplib] -file_filter = .//LC_MESSAGES/library/ftplib.po -trans.pt_BR = library/ftplib.po -source_file = ../../pot/library/ftplib.pot +[o:python-doc:p:python-313:r:library--ftplib] +file_filter = library/ftplib.po type = PO minimum_perc = 0 resource_name = library--ftplib replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--functional] -file_filter = .//LC_MESSAGES/library/functional.po -trans.pt_BR = library/functional.po -source_file = ../../pot/library/functional.pot +[o:python-doc:p:python-313:r:library--functional] +file_filter = library/functional.po type = PO minimum_perc = 0 resource_name = library--functional replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--functions] -file_filter = .//LC_MESSAGES/library/functions.po -trans.pt_BR = library/functions.po -source_file = ../../pot/library/functions.pot +[o:python-doc:p:python-313:r:library--functools] +file_filter = library/functools.po type = PO minimum_perc = 0 -resource_name = library--functions +resource_name = library--functools replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--functools] -file_filter = .//LC_MESSAGES/library/functools.po -trans.pt_BR = library/functools.po -source_file = ../../pot/library/functools.pot +[o:python-doc:p:python-313:r:library--__future__] +file_filter = library/__future__.po type = PO minimum_perc = 0 -resource_name = library--functools +resource_name = library--__future__ replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--gc] -file_filter = .//LC_MESSAGES/library/gc.po -trans.pt_BR = library/gc.po -source_file = ../../pot/library/gc.pot +[o:python-doc:p:python-313:r:library--gc] +file_filter = library/gc.po type = PO minimum_perc = 0 resource_name = library--gc replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--getopt] -file_filter = .//LC_MESSAGES/library/getopt.po -trans.pt_BR = library/getopt.po -source_file = ../../pot/library/getopt.pot +[o:python-doc:p:python-313:r:library--getopt] +file_filter = library/getopt.po type = PO minimum_perc = 0 resource_name = library--getopt replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--getpass] -file_filter = .//LC_MESSAGES/library/getpass.po -trans.pt_BR = library/getpass.po -source_file = ../../pot/library/getpass.pot +[o:python-doc:p:python-313:r:library--getpass] +file_filter = library/getpass.po type = PO minimum_perc = 0 resource_name = library--getpass replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--gettext] -file_filter = .//LC_MESSAGES/library/gettext.po -trans.pt_BR = library/gettext.po -source_file = ../../pot/library/gettext.pot +[o:python-doc:p:python-313:r:library--gettext] +file_filter = library/gettext.po type = PO minimum_perc = 0 resource_name = library--gettext replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--glob] -file_filter = .//LC_MESSAGES/library/glob.po -trans.pt_BR = library/glob.po -source_file = ../../pot/library/glob.pot +[o:python-doc:p:python-313:r:library--glob] +file_filter = library/glob.po type = PO minimum_perc = 0 resource_name = library--glob replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--graphlib] -file_filter = .//LC_MESSAGES/library/graphlib.po -trans.pt_BR = library/graphlib.po -source_file = ../../pot/library/graphlib.pot +[o:python-doc:p:python-313:r:library--graphlib] +file_filter = library/graphlib.po type = PO minimum_perc = 0 resource_name = library--graphlib replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--grp] -file_filter = .//LC_MESSAGES/library/grp.po -trans.pt_BR = library/grp.po -source_file = ../../pot/library/grp.pot +[o:python-doc:p:python-313:r:library--grp] +file_filter = library/grp.po type = PO minimum_perc = 0 resource_name = library--grp replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--gzip] -file_filter = .//LC_MESSAGES/library/gzip.po -trans.pt_BR = library/gzip.po -source_file = ../../pot/library/gzip.pot +[o:python-doc:p:python-313:r:library--gzip] +file_filter = library/gzip.po type = PO minimum_perc = 0 resource_name = library--gzip replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--hashlib] -file_filter = .//LC_MESSAGES/library/hashlib.po -trans.pt_BR = library/hashlib.po -source_file = ../../pot/library/hashlib.pot +[o:python-doc:p:python-313:r:library--hashlib] +file_filter = library/hashlib.po type = PO minimum_perc = 0 resource_name = library--hashlib replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--heapq] -file_filter = .//LC_MESSAGES/library/heapq.po -trans.pt_BR = library/heapq.po -source_file = ../../pot/library/heapq.pot +[o:python-doc:p:python-313:r:library--heapq] +file_filter = library/heapq.po type = PO minimum_perc = 0 resource_name = library--heapq replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--hmac] -file_filter = .//LC_MESSAGES/library/hmac.po -trans.pt_BR = library/hmac.po -source_file = ../../pot/library/hmac.pot +[o:python-doc:p:python-313:r:library--hmac] +file_filter = library/hmac.po type = PO minimum_perc = 0 resource_name = library--hmac replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--html] -file_filter = .//LC_MESSAGES/library/html.po -trans.pt_BR = library/html.po -source_file = ../../pot/library/html.pot +[o:python-doc:p:python-313:r:library--html] +file_filter = library/html.po type = PO minimum_perc = 0 resource_name = library--html 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 -trans.pt_BR = library/html.entities.po -source_file = ../../pot/library/html.entities.pot +[o:python-doc:p:python-313:r:library--html_entities] +file_filter = library/html.entities.po type = PO minimum_perc = 0 resource_name = library--html_entities 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 -trans.pt_BR = library/html.parser.po -source_file = ../../pot/library/html.parser.pot +[o:python-doc:p:python-313:r:library--html_parser] +file_filter = library/html.parser.po type = PO minimum_perc = 0 resource_name = library--html_parser replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--http] -file_filter = .//LC_MESSAGES/library/http.po -trans.pt_BR = library/http.po -source_file = ../../pot/library/http.pot +[o:python-doc:p:python-313:r:library--http] +file_filter = library/http.po type = PO minimum_perc = 0 resource_name = library--http 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 -trans.pt_BR = library/http.client.po -source_file = ../../pot/library/http.client.pot +[o:python-doc:p:python-313:r:library--http_client] +file_filter = library/http.client.po type = PO minimum_perc = 0 resource_name = library--http_client 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 -trans.pt_BR = library/http.cookiejar.po -source_file = ../../pot/library/http.cookiejar.pot +[o:python-doc:p:python-313:r:library--http_cookiejar] +file_filter = library/http.cookiejar.po type = PO minimum_perc = 0 resource_name = library--http_cookiejar 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 -trans.pt_BR = library/http.cookies.po -source_file = ../../pot/library/http.cookies.pot +[o:python-doc:p:python-313:r:library--http_cookies] +file_filter = library/http.cookies.po type = PO minimum_perc = 0 resource_name = library--http_cookies 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 -trans.pt_BR = library/http.server.po -source_file = ../../pot/library/http.server.pot +[o:python-doc:p:python-313:r:library--http_server] +file_filter = library/http.server.po type = PO minimum_perc = 0 resource_name = library--http_server replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--i18n] -file_filter = .//LC_MESSAGES/library/i18n.po -trans.pt_BR = library/i18n.po -source_file = ../../pot/library/i18n.pot +[o:python-doc:p:python-313:r:library--i18n] +file_filter = library/i18n.po type = PO minimum_perc = 0 resource_name = library--i18n replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--idle] -file_filter = .//LC_MESSAGES/library/idle.po -trans.pt_BR = library/idle.po -source_file = ../../pot/library/idle.pot +[o:python-doc:p:python-313:r:library--idle] +file_filter = library/idle.po type = PO minimum_perc = 0 resource_name = library--idle replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--imaplib] -file_filter = .//LC_MESSAGES/library/imaplib.po -trans.pt_BR = library/imaplib.po -source_file = ../../pot/library/imaplib.pot +[o:python-doc:p:python-313:r:library--imaplib] +file_filter = library/imaplib.po type = PO minimum_perc = 0 resource_name = library--imaplib replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--importlib] -file_filter = .//LC_MESSAGES/library/importlib.po -trans.pt_BR = library/importlib.po -source_file = ../../pot/library/importlib.pot +[o:python-doc:p:python-313:r:library--imghdr] +file_filter = library/imghdr.po +type = PO +minimum_perc = 0 +resource_name = library--imghdr +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:library--imp] +file_filter = library/imp.po +type = PO +minimum_perc = 0 +resource_name = library--imp +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:library--importlib] +file_filter = library/importlib.po type = PO minimum_perc = 0 resource_name = library--importlib 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 -trans.pt_BR = library/importlib.metadata.po -source_file = ../../pot/library/importlib.metadata.pot +[o:python-doc:p:python-313:r:library--importlib_metadata] +file_filter = library/importlib.metadata.po type = PO minimum_perc = 0 resource_name = library--importlib_metadata 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 -trans.pt_BR = library/importlib.resources.po -source_file = ../../pot/library/importlib.resources.pot +[o:python-doc:p:python-313:r:library--importlib_resources] +file_filter = library/importlib.resources.po type = PO minimum_perc = 0 resource_name = library--importlib_resources 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 -trans.pt_BR = library/importlib.resources.abc.po -source_file = ../../pot/library/importlib.resources.abc.pot +[o:python-doc:p:python-313:r:library--importlib_resources_abc] +file_filter = library/importlib.resources.abc.po type = PO minimum_perc = 0 resource_name = library--importlib_resources_abc replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--index] -file_filter = .//LC_MESSAGES/library/index.po -trans.pt_BR = library/index.po -source_file = ../../pot/library/index.pot +[o:python-doc:p:python-313:r:library--index] +file_filter = library/index.po type = PO minimum_perc = 0 resource_name = library--index replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--inspect] -file_filter = .//LC_MESSAGES/library/inspect.po -trans.pt_BR = library/inspect.po -source_file = ../../pot/library/inspect.pot +[o:python-doc:p:python-313:r:library--inspect] +file_filter = library/inspect.po type = PO minimum_perc = 0 resource_name = library--inspect replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--internet] -file_filter = .//LC_MESSAGES/library/internet.po -trans.pt_BR = library/internet.po -source_file = ../../pot/library/internet.pot +[o:python-doc:p:python-313:r:library--internet] +file_filter = library/internet.po type = PO minimum_perc = 0 resource_name = library--internet replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--intro] -file_filter = .//LC_MESSAGES/library/intro.po -trans.pt_BR = library/intro.po -source_file = ../../pot/library/intro.pot +[o:python-doc:p:python-313:r:library--intro] +file_filter = library/intro.po type = PO minimum_perc = 0 resource_name = library--intro replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--io] -file_filter = .//LC_MESSAGES/library/io.po -trans.pt_BR = library/io.po -source_file = ../../pot/library/io.pot +[o:python-doc:p:python-313:r:library--io] +file_filter = library/io.po type = PO minimum_perc = 0 resource_name = library--io replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--ipaddress] -file_filter = .//LC_MESSAGES/library/ipaddress.po -trans.pt_BR = library/ipaddress.po -source_file = ../../pot/library/ipaddress.pot +[o:python-doc:p:python-313:r:library--ipaddress] +file_filter = library/ipaddress.po type = PO minimum_perc = 0 resource_name = library--ipaddress replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--ipc] -file_filter = .//LC_MESSAGES/library/ipc.po -trans.pt_BR = library/ipc.po -source_file = ../../pot/library/ipc.pot +[o:python-doc:p:python-313:r:library--ipc] +file_filter = library/ipc.po type = PO minimum_perc = 0 resource_name = library--ipc replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--itertools] -file_filter = .//LC_MESSAGES/library/itertools.po -trans.pt_BR = library/itertools.po -source_file = ../../pot/library/itertools.pot +[o:python-doc:p:python-313:r:library--itertools] +file_filter = library/itertools.po type = PO minimum_perc = 0 resource_name = library--itertools replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--json] -file_filter = .//LC_MESSAGES/library/json.po -trans.pt_BR = library/json.po -source_file = ../../pot/library/json.pot +[o:python-doc:p:python-313:r:library--json] +file_filter = library/json.po type = PO minimum_perc = 0 resource_name = library--json replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--keyword] -file_filter = .//LC_MESSAGES/library/keyword.po -trans.pt_BR = library/keyword.po -source_file = ../../pot/library/keyword.pot +[o:python-doc:p:python-313:r:library--keyword] +file_filter = library/keyword.po type = PO minimum_perc = 0 resource_name = library--keyword replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--language] -file_filter = .//LC_MESSAGES/library/language.po -trans.pt_BR = library/language.po -source_file = ../../pot/library/language.pot +[o:python-doc:p:python-313:r:library--language] +file_filter = library/language.po type = PO minimum_perc = 0 resource_name = library--language replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--linecache] -file_filter = .//LC_MESSAGES/library/linecache.po -trans.pt_BR = library/linecache.po -source_file = ../../pot/library/linecache.pot +[o:python-doc:p:python-313:r:library--linecache] +file_filter = library/linecache.po type = PO minimum_perc = 0 resource_name = library--linecache replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--locale] -file_filter = .//LC_MESSAGES/library/locale.po -trans.pt_BR = library/locale.po -source_file = ../../pot/library/locale.pot +[o:python-doc:p:python-313:r:library--locale] +file_filter = library/locale.po type = PO minimum_perc = 0 resource_name = library--locale replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--logging] -file_filter = .//LC_MESSAGES/library/logging.po -trans.pt_BR = library/logging.po -source_file = ../../pot/library/logging.pot +[o:python-doc:p:python-313:r:library--logging] +file_filter = library/logging.po type = PO minimum_perc = 0 resource_name = library--logging 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 -trans.pt_BR = library/logging.config.po -source_file = ../../pot/library/logging.config.pot +[o:python-doc:p:python-313:r:library--logging_config] +file_filter = library/logging.config.po type = PO minimum_perc = 0 resource_name = library--logging_config 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 -trans.pt_BR = library/logging.handlers.po -source_file = ../../pot/library/logging.handlers.pot +[o:python-doc:p:python-313:r:library--logging_handlers] +file_filter = library/logging.handlers.po type = PO minimum_perc = 0 resource_name = library--logging_handlers replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--lzma] -file_filter = .//LC_MESSAGES/library/lzma.po -trans.pt_BR = library/lzma.po -source_file = ../../pot/library/lzma.pot +[o:python-doc:p:python-313:r:library--lzma] +file_filter = library/lzma.po type = PO minimum_perc = 0 resource_name = library--lzma replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--mailbox] -file_filter = .//LC_MESSAGES/library/mailbox.po -trans.pt_BR = library/mailbox.po -source_file = ../../pot/library/mailbox.pot +[o:python-doc:p:python-313:r:library--mailbox] +file_filter = library/mailbox.po type = PO minimum_perc = 0 resource_name = library--mailbox replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--markup] -file_filter = .//LC_MESSAGES/library/markup.po -trans.pt_BR = library/markup.po -source_file = ../../pot/library/markup.pot +[o:python-doc:p:python-313:r:library--mailcap] +file_filter = library/mailcap.po +type = PO +minimum_perc = 0 +resource_name = library--mailcap +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:library--__main__] +file_filter = library/__main__.po +type = PO +minimum_perc = 0 +resource_name = library--__main__ +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:library--markup] +file_filter = library/markup.po type = PO minimum_perc = 0 resource_name = library--markup replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--marshal] -file_filter = .//LC_MESSAGES/library/marshal.po -trans.pt_BR = library/marshal.po -source_file = ../../pot/library/marshal.pot +[o:python-doc:p:python-313:r:library--marshal] +file_filter = library/marshal.po type = PO minimum_perc = 0 resource_name = library--marshal replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--math] -file_filter = .//LC_MESSAGES/library/math.po -trans.pt_BR = library/math.po -source_file = ../../pot/library/math.pot +[o:python-doc:p:python-313:r:library--math] +file_filter = library/math.po type = PO minimum_perc = 0 resource_name = library--math replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--mimetypes] -file_filter = .//LC_MESSAGES/library/mimetypes.po -trans.pt_BR = library/mimetypes.po -source_file = ../../pot/library/mimetypes.pot +[o:python-doc:p:python-313:r:library--mimetypes] +file_filter = library/mimetypes.po type = PO minimum_perc = 0 resource_name = library--mimetypes replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--mm] -file_filter = .//LC_MESSAGES/library/mm.po -trans.pt_BR = library/mm.po -source_file = ../../pot/library/mm.pot +[o:python-doc:p:python-313:r:library--mm] +file_filter = library/mm.po type = PO minimum_perc = 0 resource_name = library--mm replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--mmap] -file_filter = .//LC_MESSAGES/library/mmap.po -trans.pt_BR = library/mmap.po -source_file = ../../pot/library/mmap.pot +[o:python-doc:p:python-313:r:library--mmap] +file_filter = library/mmap.po type = PO minimum_perc = 0 resource_name = library--mmap replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--modulefinder] -file_filter = .//LC_MESSAGES/library/modulefinder.po -trans.pt_BR = library/modulefinder.po -source_file = ../../pot/library/modulefinder.pot +[o:python-doc:p:python-313:r:library--modulefinder] +file_filter = library/modulefinder.po type = PO minimum_perc = 0 resource_name = library--modulefinder replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--modules] -file_filter = .//LC_MESSAGES/library/modules.po -trans.pt_BR = library/modules.po -source_file = ../../pot/library/modules.pot +[o:python-doc:p:python-313:r:library--modules] +file_filter = library/modules.po type = PO minimum_perc = 0 resource_name = library--modules replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--msvcrt] -file_filter = .//LC_MESSAGES/library/msvcrt.po -trans.pt_BR = library/msvcrt.po -source_file = ../../pot/library/msvcrt.pot +[o:python-doc:p:python-313:r:library--msilib] +file_filter = library/msilib.po +type = PO +minimum_perc = 0 +resource_name = library--msilib +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:library--msvcrt] +file_filter = library/msvcrt.po type = PO minimum_perc = 0 resource_name = library--msvcrt replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--multiprocessing] -file_filter = .//LC_MESSAGES/library/multiprocessing.po -trans.pt_BR = library/multiprocessing.po -source_file = ../../pot/library/multiprocessing.pot +[o:python-doc:p:python-313:r:library--multiprocessing] +file_filter = library/multiprocessing.po type = PO minimum_perc = 0 resource_name = library--multiprocessing 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 -trans.pt_BR = library/multiprocessing.shared_memory.po -source_file = ../../pot/library/multiprocessing.shared_memory.pot +[o:python-doc:p:python-313:r:library--multiprocessing_shared_memory] +file_filter = library/multiprocessing.shared_memory.po type = PO minimum_perc = 0 resource_name = library--multiprocessing_shared_memory replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--netdata] -file_filter = .//LC_MESSAGES/library/netdata.po -trans.pt_BR = library/netdata.po -source_file = ../../pot/library/netdata.pot +[o:python-doc:p:python-313:r:library--netdata] +file_filter = library/netdata.po type = PO minimum_perc = 0 resource_name = library--netdata replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--netrc] -file_filter = .//LC_MESSAGES/library/netrc.po -trans.pt_BR = library/netrc.po -source_file = ../../pot/library/netrc.pot +[o:python-doc:p:python-313:r:library--netrc] +file_filter = library/netrc.po type = PO minimum_perc = 0 resource_name = library--netrc replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--numbers] -file_filter = .//LC_MESSAGES/library/numbers.po -trans.pt_BR = library/numbers.po -source_file = ../../pot/library/numbers.pot +[o:python-doc:p:python-313:r:library--nis] +file_filter = library/nis.po +type = PO +minimum_perc = 0 +resource_name = library--nis +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:library--nntplib] +file_filter = library/nntplib.po +type = PO +minimum_perc = 0 +resource_name = library--nntplib +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:library--numbers] +file_filter = library/numbers.po type = PO minimum_perc = 0 resource_name = library--numbers replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--numeric] -file_filter = .//LC_MESSAGES/library/numeric.po -trans.pt_BR = library/numeric.po -source_file = ../../pot/library/numeric.pot +[o:python-doc:p:python-313:r:library--numeric] +file_filter = library/numeric.po type = PO minimum_perc = 0 resource_name = library--numeric replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--operator] -file_filter = .//LC_MESSAGES/library/operator.po -trans.pt_BR = library/operator.po -source_file = ../../pot/library/operator.pot +[o:python-doc:p:python-313:r:library--operator] +file_filter = library/operator.po type = PO minimum_perc = 0 resource_name = library--operator replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--optparse] -file_filter = .//LC_MESSAGES/library/optparse.po -trans.pt_BR = library/optparse.po -source_file = ../../pot/library/optparse.pot +[o:python-doc:p:python-313:r:library--optparse] +file_filter = library/optparse.po type = PO minimum_perc = 0 resource_name = library--optparse replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--os] -file_filter = .//LC_MESSAGES/library/os.po -trans.pt_BR = library/os.po -source_file = ../../pot/library/os.pot +[o:python-doc:p:python-313:r:library--os] +file_filter = library/os.po type = PO minimum_perc = 0 resource_name = library--os 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 -trans.pt_BR = library/os.path.po -source_file = ../../pot/library/os.path.pot +[o:python-doc:p:python-313:r:library--os_path] +file_filter = library/os.path.po type = PO minimum_perc = 0 resource_name = library--os_path replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--pathlib] -file_filter = .//LC_MESSAGES/library/pathlib.po -trans.pt_BR = library/pathlib.po -source_file = ../../pot/library/pathlib.pot +[o:python-doc:p:python-313:r:library--ossaudiodev] +file_filter = library/ossaudiodev.po +type = PO +minimum_perc = 0 +resource_name = library--ossaudiodev +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:library--pathlib] +file_filter = library/pathlib.po type = PO minimum_perc = 0 resource_name = library--pathlib replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--pdb] -file_filter = .//LC_MESSAGES/library/pdb.po -trans.pt_BR = library/pdb.po -source_file = ../../pot/library/pdb.pot +[o:python-doc:p:python-313:r:library--pdb] +file_filter = library/pdb.po type = PO minimum_perc = 0 resource_name = library--pdb replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--persistence] -file_filter = .//LC_MESSAGES/library/persistence.po -trans.pt_BR = library/persistence.po -source_file = ../../pot/library/persistence.pot +[o:python-doc:p:python-313:r:library--persistence] +file_filter = library/persistence.po type = PO minimum_perc = 0 resource_name = library--persistence replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--pickle] -file_filter = .//LC_MESSAGES/library/pickle.po -trans.pt_BR = library/pickle.po -source_file = ../../pot/library/pickle.pot +[o:python-doc:p:python-313:r:library--pickle] +file_filter = library/pickle.po type = PO minimum_perc = 0 resource_name = library--pickle replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--pickletools] -file_filter = .//LC_MESSAGES/library/pickletools.po -trans.pt_BR = library/pickletools.po -source_file = ../../pot/library/pickletools.pot +[o:python-doc:p:python-313:r:library--pickletools] +file_filter = library/pickletools.po type = PO minimum_perc = 0 resource_name = library--pickletools replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--pkgutil] -file_filter = .//LC_MESSAGES/library/pkgutil.po -trans.pt_BR = library/pkgutil.po -source_file = ../../pot/library/pkgutil.pot +[o:python-doc:p:python-313:r:library--pipes] +file_filter = library/pipes.po +type = PO +minimum_perc = 0 +resource_name = library--pipes +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:library--pkgutil] +file_filter = library/pkgutil.po type = PO minimum_perc = 0 resource_name = library--pkgutil replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--platform] -file_filter = .//LC_MESSAGES/library/platform.po -trans.pt_BR = library/platform.po -source_file = ../../pot/library/platform.pot +[o:python-doc:p:python-313:r:library--platform] +file_filter = library/platform.po type = PO minimum_perc = 0 resource_name = library--platform replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--plistlib] -file_filter = .//LC_MESSAGES/library/plistlib.po -trans.pt_BR = library/plistlib.po -source_file = ../../pot/library/plistlib.pot +[o:python-doc:p:python-313:r:library--plistlib] +file_filter = library/plistlib.po type = PO minimum_perc = 0 resource_name = library--plistlib replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--poplib] -file_filter = .//LC_MESSAGES/library/poplib.po -trans.pt_BR = library/poplib.po -source_file = ../../pot/library/poplib.pot +[o:python-doc:p:python-313:r:library--poplib] +file_filter = library/poplib.po type = PO minimum_perc = 0 resource_name = library--poplib replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--posix] -file_filter = .//LC_MESSAGES/library/posix.po -trans.pt_BR = library/posix.po -source_file = ../../pot/library/posix.pot +[o:python-doc:p:python-313:r:library--posix] +file_filter = library/posix.po type = PO minimum_perc = 0 resource_name = library--posix replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--pprint] -file_filter = .//LC_MESSAGES/library/pprint.po -trans.pt_BR = library/pprint.po -source_file = ../../pot/library/pprint.pot +[o:python-doc:p:python-313:r:library--pprint] +file_filter = library/pprint.po type = PO minimum_perc = 0 resource_name = library--pprint replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--profile] -file_filter = .//LC_MESSAGES/library/profile.po -trans.pt_BR = library/profile.po -source_file = ../../pot/library/profile.pot +[o:python-doc:p:python-313:r:library--profile] +file_filter = library/profile.po type = PO minimum_perc = 0 resource_name = library--profile replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--pty] -file_filter = .//LC_MESSAGES/library/pty.po -trans.pt_BR = library/pty.po -source_file = ../../pot/library/pty.pot +[o:python-doc:p:python-313:r:library--pty] +file_filter = library/pty.po type = PO minimum_perc = 0 resource_name = library--pty replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--pwd] -file_filter = .//LC_MESSAGES/library/pwd.po -trans.pt_BR = library/pwd.po -source_file = ../../pot/library/pwd.pot +[o:python-doc:p:python-313:r:library--pwd] +file_filter = library/pwd.po type = PO minimum_perc = 0 resource_name = library--pwd 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 -trans.pt_BR = library/py_compile.po -source_file = ../../pot/library/py_compile.pot +[o:python-doc:p:python-313:r:library--pyclbr] +file_filter = library/pyclbr.po type = PO minimum_perc = 0 -resource_name = library--py_compile +resource_name = library--pyclbr replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--pyclbr] -file_filter = .//LC_MESSAGES/library/pyclbr.po -trans.pt_BR = library/pyclbr.po -source_file = ../../pot/library/pyclbr.pot +[o:python-doc:p:python-313:r:library--py_compile] +file_filter = library/py_compile.po type = PO minimum_perc = 0 -resource_name = library--pyclbr +resource_name = library--py_compile replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--pydoc] -file_filter = .//LC_MESSAGES/library/pydoc.po -trans.pt_BR = library/pydoc.po -source_file = ../../pot/library/pydoc.pot +[o:python-doc:p:python-313:r:library--pydoc] +file_filter = library/pydoc.po type = PO minimum_perc = 0 resource_name = library--pydoc replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--pyexpat] -file_filter = .//LC_MESSAGES/library/pyexpat.po -trans.pt_BR = library/pyexpat.po -source_file = ../../pot/library/pyexpat.pot +[o:python-doc:p:python-313:r:library--pyexpat] +file_filter = library/pyexpat.po type = PO minimum_perc = 0 resource_name = library--pyexpat replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--python] -file_filter = .//LC_MESSAGES/library/python.po -trans.pt_BR = library/python.po -source_file = ../../pot/library/python.pot +[o:python-doc:p:python-313:r:library--python] +file_filter = library/python.po type = PO minimum_perc = 0 resource_name = library--python replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--queue] -file_filter = .//LC_MESSAGES/library/queue.po -trans.pt_BR = library/queue.po -source_file = ../../pot/library/queue.pot +[o:python-doc:p:python-313:r:library--queue] +file_filter = library/queue.po type = PO minimum_perc = 0 resource_name = library--queue replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--quopri] -file_filter = .//LC_MESSAGES/library/quopri.po -trans.pt_BR = library/quopri.po -source_file = ../../pot/library/quopri.pot +[o:python-doc:p:python-313:r:library--quopri] +file_filter = library/quopri.po type = PO minimum_perc = 0 resource_name = library--quopri replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--random] -file_filter = .//LC_MESSAGES/library/random.po -trans.pt_BR = library/random.po -source_file = ../../pot/library/random.pot +[o:python-doc:p:python-313:r:library--random] +file_filter = library/random.po type = PO minimum_perc = 0 resource_name = library--random replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--re] -file_filter = .//LC_MESSAGES/library/re.po -trans.pt_BR = library/re.po -source_file = ../../pot/library/re.pot +[o:python-doc:p:python-313:r:library--re] +file_filter = library/re.po type = PO minimum_perc = 0 resource_name = library--re replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--readline] -file_filter = .//LC_MESSAGES/library/readline.po -trans.pt_BR = library/readline.po -source_file = ../../pot/library/readline.pot +[o:python-doc:p:python-313:r:library--readline] +file_filter = library/readline.po type = PO minimum_perc = 0 resource_name = library--readline replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--reprlib] -file_filter = .//LC_MESSAGES/library/reprlib.po -trans.pt_BR = library/reprlib.po -source_file = ../../pot/library/reprlib.pot +[o:python-doc:p:python-313:r:library--removed] +file_filter = library/removed.po +type = PO +minimum_perc = 0 +resource_name = library--removed +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:library--reprlib] +file_filter = library/reprlib.po type = PO minimum_perc = 0 resource_name = library--reprlib replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--resource] -file_filter = .//LC_MESSAGES/library/resource.po -trans.pt_BR = library/resource.po -source_file = ../../pot/library/resource.pot +[o:python-doc:p:python-313:r:library--resource] +file_filter = library/resource.po type = PO minimum_perc = 0 resource_name = library--resource replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--rlcompleter] -file_filter = .//LC_MESSAGES/library/rlcompleter.po -trans.pt_BR = library/rlcompleter.po -source_file = ../../pot/library/rlcompleter.pot +[o:python-doc:p:python-313:r:library--rlcompleter] +file_filter = library/rlcompleter.po type = PO minimum_perc = 0 resource_name = library--rlcompleter replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--runpy] -file_filter = .//LC_MESSAGES/library/runpy.po -trans.pt_BR = library/runpy.po -source_file = ../../pot/library/runpy.pot +[o:python-doc:p:python-313:r:library--runpy] +file_filter = library/runpy.po type = PO minimum_perc = 0 resource_name = library--runpy replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--sched] -file_filter = .//LC_MESSAGES/library/sched.po -trans.pt_BR = library/sched.po -source_file = ../../pot/library/sched.pot +[o:python-doc:p:python-313:r:library--sched] +file_filter = library/sched.po type = PO minimum_perc = 0 resource_name = library--sched replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--secrets] -file_filter = .//LC_MESSAGES/library/secrets.po -trans.pt_BR = library/secrets.po -source_file = ../../pot/library/secrets.pot +[o:python-doc:p:python-313:r:library--secrets] +file_filter = library/secrets.po type = PO minimum_perc = 0 resource_name = library--secrets 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 -trans.pt_BR = library/security_warnings.po -source_file = ../../pot/library/security_warnings.pot +[o:python-doc:p:python-313:r:library--security_warnings] +file_filter = library/security_warnings.po type = PO minimum_perc = 0 resource_name = library--security_warnings replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--select] -file_filter = .//LC_MESSAGES/library/select.po -trans.pt_BR = library/select.po -source_file = ../../pot/library/select.pot +[o:python-doc:p:python-313:r:library--select] +file_filter = library/select.po type = PO minimum_perc = 0 resource_name = library--select replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--selectors] -file_filter = .//LC_MESSAGES/library/selectors.po -trans.pt_BR = library/selectors.po -source_file = ../../pot/library/selectors.pot +[o:python-doc:p:python-313:r:library--selectors] +file_filter = library/selectors.po type = PO minimum_perc = 0 resource_name = library--selectors replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--shelve] -file_filter = .//LC_MESSAGES/library/shelve.po -trans.pt_BR = library/shelve.po -source_file = ../../pot/library/shelve.pot +[o:python-doc:p:python-313:r:library--shelve] +file_filter = library/shelve.po type = PO minimum_perc = 0 resource_name = library--shelve replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--shlex] -file_filter = .//LC_MESSAGES/library/shlex.po -trans.pt_BR = library/shlex.po -source_file = ../../pot/library/shlex.pot +[o:python-doc:p:python-313:r:library--shlex] +file_filter = library/shlex.po type = PO minimum_perc = 0 resource_name = library--shlex replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--shutil] -file_filter = .//LC_MESSAGES/library/shutil.po -trans.pt_BR = library/shutil.po -source_file = ../../pot/library/shutil.pot +[o:python-doc:p:python-313:r:library--shutil] +file_filter = library/shutil.po type = PO minimum_perc = 0 resource_name = library--shutil replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--signal] -file_filter = .//LC_MESSAGES/library/signal.po -trans.pt_BR = library/signal.po -source_file = ../../pot/library/signal.pot +[o:python-doc:p:python-313:r:library--signal] +file_filter = library/signal.po type = PO minimum_perc = 0 resource_name = library--signal replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--site] -file_filter = .//LC_MESSAGES/library/site.po -trans.pt_BR = library/site.po -source_file = ../../pot/library/site.pot +[o:python-doc:p:python-313:r:library--site] +file_filter = library/site.po type = PO minimum_perc = 0 resource_name = library--site replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--smtplib] -file_filter = .//LC_MESSAGES/library/smtplib.po -trans.pt_BR = library/smtplib.po -source_file = ../../pot/library/smtplib.pot +[o:python-doc:p:python-313:r:library--smtpd] +file_filter = library/smtpd.po +type = PO +minimum_perc = 0 +resource_name = library--smtpd +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:library--smtplib] +file_filter = library/smtplib.po type = PO minimum_perc = 0 resource_name = library--smtplib replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--socket] -file_filter = .//LC_MESSAGES/library/socket.po -trans.pt_BR = library/socket.po -source_file = ../../pot/library/socket.pot +[o:python-doc:p:python-313:r:library--sndhdr] +file_filter = library/sndhdr.po +type = PO +minimum_perc = 0 +resource_name = library--sndhdr +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:library--socket] +file_filter = library/socket.po type = PO minimum_perc = 0 resource_name = library--socket replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--socketserver] -file_filter = .//LC_MESSAGES/library/socketserver.po -trans.pt_BR = library/socketserver.po -source_file = ../../pot/library/socketserver.pot +[o:python-doc:p:python-313:r:library--socketserver] +file_filter = library/socketserver.po type = PO minimum_perc = 0 resource_name = library--socketserver replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--sqlite3] -file_filter = .//LC_MESSAGES/library/sqlite3.po -trans.pt_BR = library/sqlite3.po -source_file = ../../pot/library/sqlite3.pot +[o:python-doc:p:python-313:r:library--spwd] +file_filter = library/spwd.po type = PO minimum_perc = 0 -resource_name = library--sqlite3 +resource_name = library--spwd replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--ssl] -file_filter = .//LC_MESSAGES/library/ssl.po -trans.pt_BR = library/ssl.po -source_file = ../../pot/library/ssl.pot +[o:python-doc:p:python-313:r:library--sqlite3] +file_filter = library/sqlite3.po type = PO minimum_perc = 0 -resource_name = library--ssl +resource_name = library--sqlite3 replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--stat] -file_filter = .//LC_MESSAGES/library/stat.po -trans.pt_BR = library/stat.po -source_file = ../../pot/library/stat.pot +[o:python-doc:p:python-313:r:library--ssl] +file_filter = library/ssl.po type = PO minimum_perc = 0 -resource_name = library--stat +resource_name = library--ssl replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--statistics] -file_filter = .//LC_MESSAGES/library/statistics.po -trans.pt_BR = library/statistics.po -source_file = ../../pot/library/statistics.pot +[o:python-doc:p:python-313:r:library--stat] +file_filter = library/stat.po type = PO minimum_perc = 0 -resource_name = library--statistics +resource_name = library--stat replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--stdtypes] -file_filter = .//LC_MESSAGES/library/stdtypes.po -trans.pt_BR = library/stdtypes.po -source_file = ../../pot/library/stdtypes.pot +[o:python-doc:p:python-313:r:library--statistics] +file_filter = library/statistics.po type = PO minimum_perc = 0 -resource_name = library--stdtypes +resource_name = library--statistics replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--string] -file_filter = .//LC_MESSAGES/library/string.po -trans.pt_BR = library/string.po -source_file = ../../pot/library/string.pot +[o:python-doc:p:python-313:r:library--string] +file_filter = library/string.po type = PO minimum_perc = 0 resource_name = library--string replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--stringprep] -file_filter = .//LC_MESSAGES/library/stringprep.po -trans.pt_BR = library/stringprep.po -source_file = ../../pot/library/stringprep.pot +[o:python-doc:p:python-313:r:library--stringprep] +file_filter = library/stringprep.po type = PO minimum_perc = 0 resource_name = library--stringprep replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--struct] -file_filter = .//LC_MESSAGES/library/struct.po -trans.pt_BR = library/struct.po -source_file = ../../pot/library/struct.pot +[o:python-doc:p:python-313:r:library--struct] +file_filter = library/struct.po type = PO minimum_perc = 0 resource_name = library--struct replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--subprocess] -file_filter = .//LC_MESSAGES/library/subprocess.po -trans.pt_BR = library/subprocess.po -source_file = ../../pot/library/subprocess.pot +[o:python-doc:p:python-313:r:library--subprocess] +file_filter = library/subprocess.po type = PO minimum_perc = 0 resource_name = library--subprocess replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--superseded] -file_filter = .//LC_MESSAGES/library/superseded.po -trans.pt_BR = library/superseded.po -source_file = ../../pot/library/superseded.pot +[o:python-doc:p:python-313:r:library--sunau] +file_filter = library/sunau.po +type = PO +minimum_perc = 0 +resource_name = library--sunau +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:library--superseded] +file_filter = library/superseded.po type = PO minimum_perc = 0 resource_name = library--superseded replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--symtable] -file_filter = .//LC_MESSAGES/library/symtable.po -trans.pt_BR = library/symtable.po -source_file = ../../pot/library/symtable.pot +[o:python-doc:p:python-313:r:library--symtable] +file_filter = library/symtable.po type = PO minimum_perc = 0 resource_name = library--symtable replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--sys] -file_filter = .//LC_MESSAGES/library/sys.po -trans.pt_BR = library/sys.po -source_file = ../../pot/library/sys.pot +[o:python-doc:p:python-313:r:library--sys] +file_filter = library/sys.po type = PO minimum_perc = 0 resource_name = library--sys 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 -trans.pt_BR = library/sys.monitoring.po -source_file = ../../pot/library/sys.monitoring.pot +[o:python-doc:p:python-313:r:library--sysconfig] +file_filter = library/sysconfig.po type = PO minimum_perc = 0 -resource_name = library--sys_monitoring +resource_name = library--sysconfig 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 -trans.pt_BR = library/sys_path_init.po -source_file = ../../pot/library/sys_path_init.pot +[o:python-doc:p:python-313:r:library--syslog] +file_filter = library/syslog.po type = PO minimum_perc = 0 -resource_name = library--sys_path_init +resource_name = library--syslog replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--sysconfig] -file_filter = .//LC_MESSAGES/library/sysconfig.po -trans.pt_BR = library/sysconfig.po -source_file = ../../pot/library/sysconfig.pot +[o:python-doc:p:python-313:r:library--sys_monitoring] +file_filter = library/sys.monitoring.po type = PO minimum_perc = 0 -resource_name = library--sysconfig +resource_name = library--sys_monitoring replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--syslog] -file_filter = .//LC_MESSAGES/library/syslog.po -trans.pt_BR = library/syslog.po -source_file = ../../pot/library/syslog.pot +[o:python-doc:p:python-313:r:library--sys_path_init] +file_filter = library/sys_path_init.po type = PO minimum_perc = 0 -resource_name = library--syslog +resource_name = library--sys_path_init replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--tabnanny] -file_filter = .//LC_MESSAGES/library/tabnanny.po -trans.pt_BR = library/tabnanny.po -source_file = ../../pot/library/tabnanny.pot +[o:python-doc:p:python-313:r:library--tabnanny] +file_filter = library/tabnanny.po type = PO minimum_perc = 0 resource_name = library--tabnanny replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--tarfile] -file_filter = .//LC_MESSAGES/library/tarfile.po -trans.pt_BR = library/tarfile.po -source_file = ../../pot/library/tarfile.pot +[o:python-doc:p:python-313:r:library--tarfile] +file_filter = library/tarfile.po type = PO minimum_perc = 0 resource_name = library--tarfile replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--tempfile] -file_filter = .//LC_MESSAGES/library/tempfile.po -trans.pt_BR = library/tempfile.po -source_file = ../../pot/library/tempfile.pot +[o:python-doc:p:python-313:r:library--telnetlib] +file_filter = library/telnetlib.po +type = PO +minimum_perc = 0 +resource_name = library--telnetlib +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:library--tempfile] +file_filter = library/tempfile.po type = PO minimum_perc = 0 resource_name = library--tempfile replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--termios] -file_filter = .//LC_MESSAGES/library/termios.po -trans.pt_BR = library/termios.po -source_file = ../../pot/library/termios.pot +[o:python-doc:p:python-313:r:library--termios] +file_filter = library/termios.po type = PO minimum_perc = 0 resource_name = library--termios replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--test] -file_filter = .//LC_MESSAGES/library/test.po -trans.pt_BR = library/test.po -source_file = ../../pot/library/test.pot +[o:python-doc:p:python-313:r:library--test] +file_filter = library/test.po type = PO minimum_perc = 0 resource_name = library--test replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--text] -file_filter = .//LC_MESSAGES/library/text.po -trans.pt_BR = library/text.po -source_file = ../../pot/library/text.pot +[o:python-doc:p:python-313:r:library--text] +file_filter = library/text.po type = PO minimum_perc = 0 resource_name = library--text replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--textwrap] -file_filter = .//LC_MESSAGES/library/textwrap.po -trans.pt_BR = library/textwrap.po -source_file = ../../pot/library/textwrap.pot +[o:python-doc:p:python-313:r:library--textwrap] +file_filter = library/textwrap.po type = PO minimum_perc = 0 resource_name = library--textwrap replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--threading] -file_filter = .//LC_MESSAGES/library/threading.po -trans.pt_BR = library/threading.po -source_file = ../../pot/library/threading.pot +[o:python-doc:p:python-313:r:library--_thread] +file_filter = library/_thread.po +type = PO +minimum_perc = 0 +resource_name = library--_thread +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:library--threading] +file_filter = library/threading.po type = PO minimum_perc = 0 resource_name = library--threading replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--time] -file_filter = .//LC_MESSAGES/library/time.po -trans.pt_BR = library/time.po -source_file = ../../pot/library/time.pot +[o:python-doc:p:python-313:r:library--time] +file_filter = library/time.po type = PO minimum_perc = 0 resource_name = library--time replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--timeit] -file_filter = .//LC_MESSAGES/library/timeit.po -trans.pt_BR = library/timeit.po -source_file = ../../pot/library/timeit.pot +[o:python-doc:p:python-313:r:library--timeit] +file_filter = library/timeit.po type = PO minimum_perc = 0 resource_name = library--timeit replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--tk] -file_filter = .//LC_MESSAGES/library/tk.po -trans.pt_BR = library/tk.po -source_file = ../../pot/library/tk.pot +[o:python-doc:p:python-313:r:library--tk] +file_filter = library/tk.po type = PO minimum_perc = 0 resource_name = library--tk replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--tkinter] -file_filter = .//LC_MESSAGES/library/tkinter.po -trans.pt_BR = library/tkinter.po -source_file = ../../pot/library/tkinter.pot +[o:python-doc:p:python-313:r:library--tkinter] +file_filter = library/tkinter.po type = PO minimum_perc = 0 resource_name = library--tkinter 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 -trans.pt_BR = library/tkinter.colorchooser.po -source_file = ../../pot/library/tkinter.colorchooser.pot +[o:python-doc:p:python-313:r:library--tkinter_colorchooser] +file_filter = library/tkinter.colorchooser.po type = PO minimum_perc = 0 resource_name = library--tkinter_colorchooser 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 -trans.pt_BR = library/tkinter.dnd.po -source_file = ../../pot/library/tkinter.dnd.pot +[o:python-doc:p:python-313:r:library--tkinter_dnd] +file_filter = library/tkinter.dnd.po type = PO minimum_perc = 0 resource_name = library--tkinter_dnd 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 -trans.pt_BR = library/tkinter.font.po -source_file = ../../pot/library/tkinter.font.pot +[o:python-doc:p:python-313:r:library--tkinter_font] +file_filter = library/tkinter.font.po type = PO minimum_perc = 0 resource_name = library--tkinter_font 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 -trans.pt_BR = library/tkinter.messagebox.po -source_file = ../../pot/library/tkinter.messagebox.pot +[o:python-doc:p:python-313:r:library--tkinter_messagebox] +file_filter = library/tkinter.messagebox.po type = PO minimum_perc = 0 resource_name = library--tkinter_messagebox 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 -trans.pt_BR = library/tkinter.scrolledtext.po -source_file = ../../pot/library/tkinter.scrolledtext.pot +[o:python-doc:p:python-313:r:library--tkinter_scrolledtext] +file_filter = library/tkinter.scrolledtext.po type = PO minimum_perc = 0 resource_name = library--tkinter_scrolledtext 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 -trans.pt_BR = library/tkinter.ttk.po -source_file = ../../pot/library/tkinter.ttk.pot +[o:python-doc:p:python-313:r:library--tkinter_ttk] +file_filter = library/tkinter.ttk.po type = PO minimum_perc = 0 resource_name = library--tkinter_ttk replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--token] -file_filter = .//LC_MESSAGES/library/token.po -trans.pt_BR = library/token.po -source_file = ../../pot/library/token.pot +[o:python-doc:p:python-313:r:library--token] +file_filter = library/token.po type = PO minimum_perc = 0 resource_name = library--token replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--tokenize] -file_filter = .//LC_MESSAGES/library/tokenize.po -trans.pt_BR = library/tokenize.po -source_file = ../../pot/library/tokenize.pot +[o:python-doc:p:python-313:r:library--tokenize] +file_filter = library/tokenize.po type = PO minimum_perc = 0 resource_name = library--tokenize replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--tomllib] -file_filter = .//LC_MESSAGES/library/tomllib.po -trans.pt_BR = library/tomllib.po -source_file = ../../pot/library/tomllib.pot +[o:python-doc:p:python-313:r:library--tomllib] +file_filter = library/tomllib.po type = PO minimum_perc = 0 resource_name = library--tomllib replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--trace] -file_filter = .//LC_MESSAGES/library/trace.po -trans.pt_BR = library/trace.po -source_file = ../../pot/library/trace.pot +[o:python-doc:p:python-313:r:library--trace] +file_filter = library/trace.po type = PO minimum_perc = 0 resource_name = library--trace replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--traceback] -file_filter = .//LC_MESSAGES/library/traceback.po -trans.pt_BR = library/traceback.po -source_file = ../../pot/library/traceback.pot +[o:python-doc:p:python-313:r:library--traceback] +file_filter = library/traceback.po type = PO minimum_perc = 0 resource_name = library--traceback replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--tracemalloc] -file_filter = .//LC_MESSAGES/library/tracemalloc.po -trans.pt_BR = library/tracemalloc.po -source_file = ../../pot/library/tracemalloc.pot +[o:python-doc:p:python-313:r:library--tracemalloc] +file_filter = library/tracemalloc.po type = PO minimum_perc = 0 resource_name = library--tracemalloc replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--tty] -file_filter = .//LC_MESSAGES/library/tty.po -trans.pt_BR = library/tty.po -source_file = ../../pot/library/tty.pot +[o:python-doc:p:python-313:r:library--tty] +file_filter = library/tty.po type = PO minimum_perc = 0 resource_name = library--tty replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--turtle] -file_filter = .//LC_MESSAGES/library/turtle.po -trans.pt_BR = library/turtle.po -source_file = ../../pot/library/turtle.pot +[o:python-doc:p:python-313:r:library--turtle] +file_filter = library/turtle.po type = PO minimum_perc = 0 resource_name = library--turtle replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--types] -file_filter = .//LC_MESSAGES/library/types.po -trans.pt_BR = library/types.po -source_file = ../../pot/library/types.pot +[o:python-doc:p:python-313:r:library--types] +file_filter = library/types.po type = PO minimum_perc = 0 resource_name = library--types replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--typing] -file_filter = .//LC_MESSAGES/library/typing.po -trans.pt_BR = library/typing.po -source_file = ../../pot/library/typing.pot +[o:python-doc:p:python-313:r:library--typing] +file_filter = library/typing.po type = PO minimum_perc = 0 resource_name = library--typing replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--unicodedata] -file_filter = .//LC_MESSAGES/library/unicodedata.po -trans.pt_BR = library/unicodedata.po -source_file = ../../pot/library/unicodedata.pot +[o:python-doc:p:python-313:r:library--unicodedata] +file_filter = library/unicodedata.po type = PO minimum_perc = 0 resource_name = library--unicodedata replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--unittest] -file_filter = .//LC_MESSAGES/library/unittest.po -trans.pt_BR = library/unittest.po -source_file = ../../pot/library/unittest.pot +[o:python-doc:p:python-313:r:library--unittest] +file_filter = library/unittest.po type = PO minimum_perc = 0 resource_name = library--unittest 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 -trans.pt_BR = library/unittest.mock.po -source_file = ../../pot/library/unittest.mock.pot +[o:python-doc:p:python-313:r:library--unittest_mock] +file_filter = library/unittest.mock.po type = PO minimum_perc = 0 resource_name = library--unittest_mock 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 -trans.pt_BR = library/unittest.mock-examples.po -source_file = ../../pot/library/unittest.mock-examples.pot +[o:python-doc:p:python-313:r:library--unittest_mock-examples] +file_filter = library/unittest.mock-examples.po type = PO minimum_perc = 0 resource_name = library--unittest_mock-examples replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--unix] -file_filter = .//LC_MESSAGES/library/unix.po -trans.pt_BR = library/unix.po -source_file = ../../pot/library/unix.pot +[o:python-doc:p:python-313:r:library--unix] +file_filter = library/unix.po type = PO minimum_perc = 0 resource_name = library--unix replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--urllib] -file_filter = .//LC_MESSAGES/library/urllib.po -trans.pt_BR = library/urllib.po -source_file = ../../pot/library/urllib.pot +[o:python-doc:p:python-313:r:library--urllib] +file_filter = library/urllib.po type = PO minimum_perc = 0 resource_name = library--urllib 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 -trans.pt_BR = library/urllib.error.po -source_file = ../../pot/library/urllib.error.pot +[o:python-doc:p:python-313:r:library--urllib_error] +file_filter = library/urllib.error.po type = PO minimum_perc = 0 resource_name = library--urllib_error 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 -trans.pt_BR = library/urllib.parse.po -source_file = ../../pot/library/urllib.parse.pot +[o:python-doc:p:python-313:r:library--urllib_parse] +file_filter = library/urllib.parse.po type = PO minimum_perc = 0 resource_name = library--urllib_parse 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 -trans.pt_BR = library/urllib.request.po -source_file = ../../pot/library/urllib.request.pot +[o:python-doc:p:python-313:r:library--urllib_request] +file_filter = library/urllib.request.po type = PO minimum_perc = 0 resource_name = library--urllib_request 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 -trans.pt_BR = library/urllib.robotparser.po -source_file = ../../pot/library/urllib.robotparser.pot +[o:python-doc:p:python-313:r:library--urllib_robotparser] +file_filter = library/urllib.robotparser.po type = PO minimum_perc = 0 resource_name = library--urllib_robotparser replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--uuid] -file_filter = .//LC_MESSAGES/library/uuid.po -trans.pt_BR = library/uuid.po -source_file = ../../pot/library/uuid.pot +[o:python-doc:p:python-313:r:library--uu] +file_filter = library/uu.po +type = PO +minimum_perc = 0 +resource_name = library--uu +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:library--uuid] +file_filter = library/uuid.po type = PO minimum_perc = 0 resource_name = library--uuid replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--venv] -file_filter = .//LC_MESSAGES/library/venv.po -trans.pt_BR = library/venv.po -source_file = ../../pot/library/venv.pot +[o:python-doc:p:python-313:r:library--venv] +file_filter = library/venv.po type = PO minimum_perc = 0 resource_name = library--venv replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--warnings] -file_filter = .//LC_MESSAGES/library/warnings.po -trans.pt_BR = library/warnings.po -source_file = ../../pot/library/warnings.pot +[o:python-doc:p:python-313:r:library--warnings] +file_filter = library/warnings.po type = PO minimum_perc = 0 resource_name = library--warnings replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--wave] -file_filter = .//LC_MESSAGES/library/wave.po -trans.pt_BR = library/wave.po -source_file = ../../pot/library/wave.pot +[o:python-doc:p:python-313:r:library--wave] +file_filter = library/wave.po type = PO minimum_perc = 0 resource_name = library--wave replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--weakref] -file_filter = .//LC_MESSAGES/library/weakref.po -trans.pt_BR = library/weakref.po -source_file = ../../pot/library/weakref.pot +[o:python-doc:p:python-313:r:library--weakref] +file_filter = library/weakref.po type = PO minimum_perc = 0 resource_name = library--weakref replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--webbrowser] -file_filter = .//LC_MESSAGES/library/webbrowser.po -trans.pt_BR = library/webbrowser.po -source_file = ../../pot/library/webbrowser.pot +[o:python-doc:p:python-313:r:library--webbrowser] +file_filter = library/webbrowser.po type = PO minimum_perc = 0 resource_name = library--webbrowser replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--windows] -file_filter = .//LC_MESSAGES/library/windows.po -trans.pt_BR = library/windows.po -source_file = ../../pot/library/windows.pot +[o:python-doc:p:python-313:r:library--windows] +file_filter = library/windows.po type = PO minimum_perc = 0 resource_name = library--windows replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--winreg] -file_filter = .//LC_MESSAGES/library/winreg.po -trans.pt_BR = library/winreg.po -source_file = ../../pot/library/winreg.pot +[o:python-doc:p:python-313:r:library--winreg] +file_filter = library/winreg.po type = PO minimum_perc = 0 resource_name = library--winreg replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--winsound] -file_filter = .//LC_MESSAGES/library/winsound.po -trans.pt_BR = library/winsound.po -source_file = ../../pot/library/winsound.pot +[o:python-doc:p:python-313:r:library--winsound] +file_filter = library/winsound.po type = PO minimum_perc = 0 resource_name = library--winsound replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--wsgiref] -file_filter = .//LC_MESSAGES/library/wsgiref.po -trans.pt_BR = library/wsgiref.po -source_file = ../../pot/library/wsgiref.pot +[o:python-doc:p:python-313:r:library--wsgiref] +file_filter = library/wsgiref.po type = PO minimum_perc = 0 resource_name = library--wsgiref replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--xml] -file_filter = .//LC_MESSAGES/library/xml.po -trans.pt_BR = library/xml.po -source_file = ../../pot/library/xml.pot +[o:python-doc:p:python-313:r:library--xdrlib] +file_filter = library/xdrlib.po +type = PO +minimum_perc = 0 +resource_name = library--xdrlib +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:library--xml] +file_filter = library/xml.po type = PO minimum_perc = 0 resource_name = library--xml 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 -trans.pt_BR = library/xml.dom.po -source_file = ../../pot/library/xml.dom.pot +[o:python-doc:p:python-313:r:library--xml_dom] +file_filter = library/xml.dom.po type = PO minimum_perc = 0 resource_name = library--xml_dom 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 -trans.pt_BR = library/xml.dom.minidom.po -source_file = ../../pot/library/xml.dom.minidom.pot +[o:python-doc:p:python-313:r:library--xml_dom_minidom] +file_filter = library/xml.dom.minidom.po type = PO minimum_perc = 0 resource_name = library--xml_dom_minidom 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 -trans.pt_BR = library/xml.dom.pulldom.po -source_file = ../../pot/library/xml.dom.pulldom.pot +[o:python-doc:p:python-313:r:library--xml_dom_pulldom] +file_filter = library/xml.dom.pulldom.po type = PO minimum_perc = 0 resource_name = library--xml_dom_pulldom 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 -trans.pt_BR = library/xml.etree.elementtree.po -source_file = ../../pot/library/xml.etree.elementtree.pot +[o:python-doc:p:python-313:r:library--xml_etree_elementtree] +file_filter = library/xml.etree.elementtree.po type = PO minimum_perc = 0 resource_name = library--xml_etree_elementtree 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 -trans.pt_BR = library/xml.sax.po -source_file = ../../pot/library/xml.sax.pot +[o:python-doc:p:python-313:r:library--xmlrpc] +file_filter = library/xmlrpc.po type = PO minimum_perc = 0 -resource_name = library--xml_sax +resource_name = library--xmlrpc 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 -trans.pt_BR = library/xml.sax.handler.po -source_file = ../../pot/library/xml.sax.handler.pot +[o:python-doc:p:python-313:r:library--xmlrpc_client] +file_filter = library/xmlrpc.client.po type = PO minimum_perc = 0 -resource_name = library--xml_sax_handler +resource_name = library--xmlrpc_client 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 -trans.pt_BR = library/xml.sax.reader.po -source_file = ../../pot/library/xml.sax.reader.pot +[o:python-doc:p:python-313:r:library--xmlrpc_server] +file_filter = library/xmlrpc.server.po type = PO minimum_perc = 0 -resource_name = library--xml_sax_reader +resource_name = library--xmlrpc_server 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 -trans.pt_BR = library/xml.sax.utils.po -source_file = ../../pot/library/xml.sax.utils.pot +[o:python-doc:p:python-313:r:library--xml_sax] +file_filter = library/xml.sax.po type = PO minimum_perc = 0 -resource_name = library--xml_sax_utils +resource_name = library--xml_sax replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--xmlrpc] -file_filter = .//LC_MESSAGES/library/xmlrpc.po -trans.pt_BR = library/xmlrpc.po -source_file = ../../pot/library/xmlrpc.pot +[o:python-doc:p:python-313:r:library--xml_sax_handler] +file_filter = library/xml.sax.handler.po type = PO minimum_perc = 0 -resource_name = library--xmlrpc +resource_name = library--xml_sax_handler 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 -trans.pt_BR = library/xmlrpc.client.po -source_file = ../../pot/library/xmlrpc.client.pot +[o:python-doc:p:python-313:r:library--xml_sax_reader] +file_filter = library/xml.sax.reader.po type = PO minimum_perc = 0 -resource_name = library--xmlrpc_client +resource_name = library--xml_sax_reader 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 -trans.pt_BR = library/xmlrpc.server.po -source_file = ../../pot/library/xmlrpc.server.pot +[o:python-doc:p:python-313:r:library--xml_sax_utils] +file_filter = library/xml.sax.utils.po type = PO minimum_perc = 0 -resource_name = library--xmlrpc_server +resource_name = library--xml_sax_utils replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--zipapp] -file_filter = .//LC_MESSAGES/library/zipapp.po -trans.pt_BR = library/zipapp.po -source_file = ../../pot/library/zipapp.pot +[o:python-doc:p:python-313:r:library--zipapp] +file_filter = library/zipapp.po type = PO minimum_perc = 0 resource_name = library--zipapp replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--zipfile] -file_filter = .//LC_MESSAGES/library/zipfile.po -trans.pt_BR = library/zipfile.po -source_file = ../../pot/library/zipfile.pot +[o:python-doc:p:python-313:r:library--zipfile] +file_filter = library/zipfile.po type = PO minimum_perc = 0 resource_name = library--zipfile replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--zipimport] -file_filter = .//LC_MESSAGES/library/zipimport.po -trans.pt_BR = library/zipimport.po -source_file = ../../pot/library/zipimport.pot +[o:python-doc:p:python-313:r:library--zipimport] +file_filter = library/zipimport.po type = PO minimum_perc = 0 resource_name = library--zipimport replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--zlib] -file_filter = .//LC_MESSAGES/library/zlib.po -trans.pt_BR = library/zlib.po -source_file = ../../pot/library/zlib.pot +[o:python-doc:p:python-313:r:library--zlib] +file_filter = library/zlib.po type = PO minimum_perc = 0 resource_name = library--zlib replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:library--zoneinfo] -file_filter = .//LC_MESSAGES/library/zoneinfo.po -trans.pt_BR = library/zoneinfo.po -source_file = ../../pot/library/zoneinfo.pot +[o:python-doc:p:python-313:r:library--zoneinfo] +file_filter = library/zoneinfo.po type = PO minimum_perc = 0 resource_name = library--zoneinfo replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:license] -file_filter = .//LC_MESSAGES/license.po -trans.pt_BR = license.po -source_file = ../../pot/license.pot +[o:python-doc:p:python-313:r:license] +file_filter = license.po type = PO minimum_perc = 0 resource_name = license 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 -trans.pt_BR = reference/compound_stmts.po -source_file = ../../pot/reference/compound_stmts.pot +[o:python-doc:p:python-313:r:reference--compound_stmts] +file_filter = reference/compound_stmts.po type = PO minimum_perc = 0 resource_name = reference--compound_stmts replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:reference--datamodel] -file_filter = .//LC_MESSAGES/reference/datamodel.po -trans.pt_BR = reference/datamodel.po -source_file = ../../pot/reference/datamodel.pot +[o:python-doc:p:python-313:r:reference--datamodel] +file_filter = reference/datamodel.po type = PO minimum_perc = 0 resource_name = reference--datamodel replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:reference--executionmodel] -file_filter = .//LC_MESSAGES/reference/executionmodel.po -trans.pt_BR = reference/executionmodel.po -source_file = ../../pot/reference/executionmodel.pot +[o:python-doc:p:python-313:r:reference--executionmodel] +file_filter = reference/executionmodel.po type = PO minimum_perc = 0 resource_name = reference--executionmodel replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:reference--expressions] -file_filter = .//LC_MESSAGES/reference/expressions.po -trans.pt_BR = reference/expressions.po -source_file = ../../pot/reference/expressions.pot +[o:python-doc:p:python-313:r:reference--expressions] +file_filter = reference/expressions.po type = PO minimum_perc = 0 resource_name = reference--expressions replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:reference--grammar] -file_filter = .//LC_MESSAGES/reference/grammar.po -trans.pt_BR = reference/grammar.po -source_file = ../../pot/reference/grammar.pot +[o:python-doc:p:python-313:r:reference--grammar] +file_filter = reference/grammar.po type = PO minimum_perc = 0 resource_name = reference--grammar replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:reference--import] -file_filter = .//LC_MESSAGES/reference/import.po -trans.pt_BR = reference/import.po -source_file = ../../pot/reference/import.pot +[o:python-doc:p:python-313:r:reference--import] +file_filter = reference/import.po type = PO minimum_perc = 0 resource_name = reference--import replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:reference--index] -file_filter = .//LC_MESSAGES/reference/index.po -trans.pt_BR = reference/index.po -source_file = ../../pot/reference/index.pot +[o:python-doc:p:python-313:r:reference--index] +file_filter = reference/index.po type = PO minimum_perc = 0 resource_name = reference--index replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:reference--introduction] -file_filter = .//LC_MESSAGES/reference/introduction.po -trans.pt_BR = reference/introduction.po -source_file = ../../pot/reference/introduction.pot +[o:python-doc:p:python-313:r:reference--introduction] +file_filter = reference/introduction.po type = PO minimum_perc = 0 resource_name = reference--introduction 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 -trans.pt_BR = reference/lexical_analysis.po -source_file = ../../pot/reference/lexical_analysis.pot +[o:python-doc:p:python-313:r:reference--lexical_analysis] +file_filter = reference/lexical_analysis.po type = PO minimum_perc = 0 resource_name = reference--lexical_analysis 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 -trans.pt_BR = reference/simple_stmts.po -source_file = ../../pot/reference/simple_stmts.pot +[o:python-doc:p:python-313:r:reference--simple_stmts] +file_filter = reference/simple_stmts.po type = PO minimum_perc = 0 resource_name = reference--simple_stmts 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 -trans.pt_BR = reference/toplevel_components.po -source_file = ../../pot/reference/toplevel_components.pot +[o:python-doc:p:python-313:r:reference--toplevel_components] +file_filter = reference/toplevel_components.po type = PO minimum_perc = 0 resource_name = reference--toplevel_components replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:sphinx] -file_filter = .//LC_MESSAGES/sphinx.po -trans.pt_BR = sphinx.po -source_file = ../../pot/sphinx.pot +[o:python-doc:p:python-313:r:sphinx] +file_filter = sphinx.po type = PO minimum_perc = 0 resource_name = sphinx replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:tutorial--appendix] -file_filter = .//LC_MESSAGES/tutorial/appendix.po -trans.pt_BR = tutorial/appendix.po -source_file = ../../pot/tutorial/appendix.pot +[o:python-doc:p:python-313:r:tutorial--appendix] +file_filter = tutorial/appendix.po type = PO minimum_perc = 0 resource_name = tutorial--appendix replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:tutorial--appetite] -file_filter = .//LC_MESSAGES/tutorial/appetite.po -trans.pt_BR = tutorial/appetite.po -source_file = ../../pot/tutorial/appetite.pot +[o:python-doc:p:python-313:r:tutorial--appetite] +file_filter = tutorial/appetite.po type = PO minimum_perc = 0 resource_name = tutorial--appetite replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:tutorial--classes] -file_filter = .//LC_MESSAGES/tutorial/classes.po -trans.pt_BR = tutorial/classes.po -source_file = ../../pot/tutorial/classes.pot +[o:python-doc:p:python-313:r:tutorial--classes] +file_filter = tutorial/classes.po type = PO minimum_perc = 0 resource_name = tutorial--classes replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:tutorial--controlflow] -file_filter = .//LC_MESSAGES/tutorial/controlflow.po -trans.pt_BR = tutorial/controlflow.po -source_file = ../../pot/tutorial/controlflow.pot +[o:python-doc:p:python-313:r:tutorial--controlflow] +file_filter = tutorial/controlflow.po type = PO minimum_perc = 0 resource_name = tutorial--controlflow replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:tutorial--datastructures] -file_filter = .//LC_MESSAGES/tutorial/datastructures.po -trans.pt_BR = tutorial/datastructures.po -source_file = ../../pot/tutorial/datastructures.pot +[o:python-doc:p:python-313:r:tutorial--datastructures] +file_filter = tutorial/datastructures.po type = PO minimum_perc = 0 resource_name = tutorial--datastructures replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:tutorial--errors] -file_filter = .//LC_MESSAGES/tutorial/errors.po -trans.pt_BR = tutorial/errors.po -source_file = ../../pot/tutorial/errors.pot +[o:python-doc:p:python-313:r:tutorial--errors] +file_filter = tutorial/errors.po type = PO minimum_perc = 0 resource_name = tutorial--errors replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:tutorial--floatingpoint] -file_filter = .//LC_MESSAGES/tutorial/floatingpoint.po -trans.pt_BR = tutorial/floatingpoint.po -source_file = ../../pot/tutorial/floatingpoint.pot +[o:python-doc:p:python-313:r:tutorial--floatingpoint] +file_filter = tutorial/floatingpoint.po type = PO minimum_perc = 0 resource_name = tutorial--floatingpoint replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:tutorial--index] -file_filter = .//LC_MESSAGES/tutorial/index.po -trans.pt_BR = tutorial/index.po -source_file = ../../pot/tutorial/index.pot +[o:python-doc:p:python-313:r:tutorial--index] +file_filter = tutorial/index.po type = PO minimum_perc = 0 resource_name = tutorial--index replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:tutorial--inputoutput] -file_filter = .//LC_MESSAGES/tutorial/inputoutput.po -trans.pt_BR = tutorial/inputoutput.po -source_file = ../../pot/tutorial/inputoutput.pot +[o:python-doc:p:python-313:r:tutorial--inputoutput] +file_filter = tutorial/inputoutput.po type = PO minimum_perc = 0 resource_name = tutorial--inputoutput replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:tutorial--interactive] -file_filter = .//LC_MESSAGES/tutorial/interactive.po -trans.pt_BR = tutorial/interactive.po -source_file = ../../pot/tutorial/interactive.pot +[o:python-doc:p:python-313:r:tutorial--interactive] +file_filter = tutorial/interactive.po type = PO minimum_perc = 0 resource_name = tutorial--interactive replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:tutorial--interpreter] -file_filter = .//LC_MESSAGES/tutorial/interpreter.po -trans.pt_BR = tutorial/interpreter.po -source_file = ../../pot/tutorial/interpreter.pot +[o:python-doc:p:python-313:r:tutorial--interpreter] +file_filter = tutorial/interpreter.po type = PO minimum_perc = 0 resource_name = tutorial--interpreter replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:tutorial--introduction] -file_filter = .//LC_MESSAGES/tutorial/introduction.po -trans.pt_BR = tutorial/introduction.po -source_file = ../../pot/tutorial/introduction.pot +[o:python-doc:p:python-313:r:tutorial--introduction] +file_filter = tutorial/introduction.po type = PO minimum_perc = 0 resource_name = tutorial--introduction replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:tutorial--modules] -file_filter = .//LC_MESSAGES/tutorial/modules.po -trans.pt_BR = tutorial/modules.po -source_file = ../../pot/tutorial/modules.pot +[o:python-doc:p:python-313:r:tutorial--modules] +file_filter = tutorial/modules.po type = PO minimum_perc = 0 resource_name = tutorial--modules replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:tutorial--stdlib] -file_filter = .//LC_MESSAGES/tutorial/stdlib.po -trans.pt_BR = tutorial/stdlib.po -source_file = ../../pot/tutorial/stdlib.pot +[o:python-doc:p:python-313:r:tutorial--stdlib] +file_filter = tutorial/stdlib.po type = PO minimum_perc = 0 resource_name = tutorial--stdlib replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:tutorial--stdlib2] -file_filter = .//LC_MESSAGES/tutorial/stdlib2.po -trans.pt_BR = tutorial/stdlib2.po -source_file = ../../pot/tutorial/stdlib2.pot +[o:python-doc:p:python-313:r:tutorial--stdlib2] +file_filter = tutorial/stdlib2.po type = PO minimum_perc = 0 resource_name = tutorial--stdlib2 replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:tutorial--venv] -file_filter = .//LC_MESSAGES/tutorial/venv.po -trans.pt_BR = tutorial/venv.po -source_file = ../../pot/tutorial/venv.pot +[o:python-doc:p:python-313:r:tutorial--venv] +file_filter = tutorial/venv.po type = PO minimum_perc = 0 resource_name = tutorial--venv replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:tutorial--whatnow] -file_filter = .//LC_MESSAGES/tutorial/whatnow.po -trans.pt_BR = tutorial/whatnow.po -source_file = ../../pot/tutorial/whatnow.pot +[o:python-doc:p:python-313:r:tutorial--whatnow] +file_filter = tutorial/whatnow.po type = PO minimum_perc = 0 resource_name = tutorial--whatnow replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:using--cmdline] -file_filter = .//LC_MESSAGES/using/cmdline.po -trans.pt_BR = using/cmdline.po -source_file = ../../pot/using/cmdline.pot +[o:python-doc:p:python-313:r:using--android] +file_filter = using/android.po +type = PO +minimum_perc = 0 +resource_name = using--android +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-313:r:using--cmdline] +file_filter = using/cmdline.po type = PO minimum_perc = 0 resource_name = using--cmdline replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:using--configure] -file_filter = .//LC_MESSAGES/using/configure.po -trans.pt_BR = using/configure.po -source_file = ../../pot/using/configure.pot +[o:python-doc:p:python-313:r:using--configure] +file_filter = using/configure.po type = PO minimum_perc = 0 resource_name = using--configure replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:using--editors] -file_filter = .//LC_MESSAGES/using/editors.po -trans.pt_BR = using/editors.po -source_file = ../../pot/using/editors.pot +[o:python-doc:p:python-313:r:using--editors] +file_filter = using/editors.po type = PO minimum_perc = 0 resource_name = using--editors replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:using--index] -file_filter = .//LC_MESSAGES/using/index.po -trans.pt_BR = using/index.po -source_file = ../../pot/using/index.pot +[o:python-doc:p:python-313:r:using--index] +file_filter = using/index.po type = PO minimum_perc = 0 resource_name = using--index replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:using--ios] -file_filter = .//LC_MESSAGES/using/ios.po -trans.pt_BR = using/ios.po -source_file = ../../pot/using/ios.pot +[o:python-doc:p:python-313:r:using--ios] +file_filter = using/ios.po type = PO minimum_perc = 0 resource_name = using--ios replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:using--mac] -file_filter = .//LC_MESSAGES/using/mac.po -trans.pt_BR = using/mac.po -source_file = ../../pot/using/mac.pot +[o:python-doc:p:python-313:r:using--mac] +file_filter = using/mac.po type = PO minimum_perc = 0 resource_name = using--mac replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:using--unix] -file_filter = .//LC_MESSAGES/using/unix.po -trans.pt_BR = using/unix.po -source_file = ../../pot/using/unix.pot +[o:python-doc:p:python-313:r:using--unix] +file_filter = using/unix.po type = PO minimum_perc = 0 resource_name = using--unix replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:using--windows] -file_filter = .//LC_MESSAGES/using/windows.po -trans.pt_BR = using/windows.po -source_file = ../../pot/using/windows.pot +[o:python-doc:p:python-313:r:using--windows] +file_filter = using/windows.po type = PO minimum_perc = 0 resource_name = using--windows 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 -trans.pt_BR = whatsnew/2.0.po -source_file = ../../pot/whatsnew/2.0.pot +[o:python-doc:p:python-313:r:whatsnew--2_0] +file_filter = whatsnew/2.0.po type = PO minimum_perc = 0 resource_name = whatsnew--2_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 -trans.pt_BR = whatsnew/2.1.po -source_file = ../../pot/whatsnew/2.1.pot +[o:python-doc:p:python-313:r:whatsnew--2_1] +file_filter = whatsnew/2.1.po type = PO minimum_perc = 0 resource_name = whatsnew--2_1 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 -trans.pt_BR = whatsnew/2.2.po -source_file = ../../pot/whatsnew/2.2.pot +[o:python-doc:p:python-313:r:whatsnew--2_2] +file_filter = whatsnew/2.2.po type = PO minimum_perc = 0 resource_name = whatsnew--2_2 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 -trans.pt_BR = whatsnew/2.3.po -source_file = ../../pot/whatsnew/2.3.pot +[o:python-doc:p:python-313:r:whatsnew--2_3] +file_filter = whatsnew/2.3.po type = PO minimum_perc = 0 resource_name = whatsnew--2_3 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 -trans.pt_BR = whatsnew/2.4.po -source_file = ../../pot/whatsnew/2.4.pot +[o:python-doc:p:python-313:r:whatsnew--2_4] +file_filter = whatsnew/2.4.po type = PO minimum_perc = 0 resource_name = whatsnew--2_4 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 -trans.pt_BR = whatsnew/2.5.po -source_file = ../../pot/whatsnew/2.5.pot +[o:python-doc:p:python-313:r:whatsnew--2_5] +file_filter = whatsnew/2.5.po type = PO minimum_perc = 0 resource_name = whatsnew--2_5 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 -trans.pt_BR = whatsnew/2.6.po -source_file = ../../pot/whatsnew/2.6.pot +[o:python-doc:p:python-313:r:whatsnew--2_6] +file_filter = whatsnew/2.6.po type = PO minimum_perc = 0 resource_name = whatsnew--2_6 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 -trans.pt_BR = whatsnew/2.7.po -source_file = ../../pot/whatsnew/2.7.pot +[o:python-doc:p:python-313:r:whatsnew--2_7] +file_filter = whatsnew/2.7.po type = PO minimum_perc = 0 resource_name = whatsnew--2_7 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 -trans.pt_BR = whatsnew/3.0.po -source_file = ../../pot/whatsnew/3.0.pot +[o:python-doc:p:python-313:r:whatsnew--3_0] +file_filter = whatsnew/3.0.po type = PO minimum_perc = 0 resource_name = whatsnew--3_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 -trans.pt_BR = whatsnew/3.1.po -source_file = ../../pot/whatsnew/3.1.pot +[o:python-doc:p:python-313:r:whatsnew--3_1] +file_filter = whatsnew/3.1.po type = PO minimum_perc = 0 resource_name = whatsnew--3_1 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 -trans.pt_BR = whatsnew/3.10.po -source_file = ../../pot/whatsnew/3.10.pot +[o:python-doc:p:python-313:r:whatsnew--3_10] +file_filter = whatsnew/3.10.po type = PO minimum_perc = 0 resource_name = whatsnew--3_10 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 -trans.pt_BR = whatsnew/3.11.po -source_file = ../../pot/whatsnew/3.11.pot +[o:python-doc:p:python-313:r:whatsnew--3_11] +file_filter = whatsnew/3.11.po type = PO minimum_perc = 0 resource_name = whatsnew--3_11 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 -trans.pt_BR = whatsnew/3.12.po -source_file = ../../pot/whatsnew/3.12.pot +[o:python-doc:p:python-313:r:whatsnew--3_12] +file_filter = whatsnew/3.12.po type = PO minimum_perc = 0 resource_name = whatsnew--3_12 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 -trans.pt_BR = whatsnew/3.13.po -source_file = ../../pot/whatsnew/3.13.pot +[o:python-doc:p:python-313:r:whatsnew--3_13] +file_filter = whatsnew/3.13.po type = PO minimum_perc = 0 resource_name = whatsnew--3_13 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 -trans.pt_BR = whatsnew/3.2.po -source_file = ../../pot/whatsnew/3.2.pot +[o:python-doc:p:python-313:r:whatsnew--3_2] +file_filter = whatsnew/3.2.po type = PO minimum_perc = 0 resource_name = whatsnew--3_2 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 -trans.pt_BR = whatsnew/3.3.po -source_file = ../../pot/whatsnew/3.3.pot +[o:python-doc:p:python-313:r:whatsnew--3_3] +file_filter = whatsnew/3.3.po type = PO minimum_perc = 0 resource_name = whatsnew--3_3 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 -trans.pt_BR = whatsnew/3.4.po -source_file = ../../pot/whatsnew/3.4.pot +[o:python-doc:p:python-313:r:whatsnew--3_4] +file_filter = whatsnew/3.4.po type = PO minimum_perc = 0 resource_name = whatsnew--3_4 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 -trans.pt_BR = whatsnew/3.5.po -source_file = ../../pot/whatsnew/3.5.pot +[o:python-doc:p:python-313:r:whatsnew--3_5] +file_filter = whatsnew/3.5.po type = PO minimum_perc = 0 resource_name = whatsnew--3_5 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 -trans.pt_BR = whatsnew/3.6.po -source_file = ../../pot/whatsnew/3.6.pot +[o:python-doc:p:python-313:r:whatsnew--3_6] +file_filter = whatsnew/3.6.po type = PO minimum_perc = 0 resource_name = whatsnew--3_6 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 -trans.pt_BR = whatsnew/3.7.po -source_file = ../../pot/whatsnew/3.7.pot +[o:python-doc:p:python-313:r:whatsnew--3_7] +file_filter = whatsnew/3.7.po type = PO minimum_perc = 0 resource_name = whatsnew--3_7 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 -trans.pt_BR = whatsnew/3.8.po -source_file = ../../pot/whatsnew/3.8.pot +[o:python-doc:p:python-313:r:whatsnew--3_8] +file_filter = whatsnew/3.8.po type = PO minimum_perc = 0 resource_name = whatsnew--3_8 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 -trans.pt_BR = whatsnew/3.9.po -source_file = ../../pot/whatsnew/3.9.pot +[o:python-doc:p:python-313:r:whatsnew--3_9] +file_filter = whatsnew/3.9.po type = PO minimum_perc = 0 resource_name = whatsnew--3_9 replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:whatsnew--changelog] -file_filter = .//LC_MESSAGES/whatsnew/changelog.po -trans.pt_BR = whatsnew/changelog.po -source_file = ../../pot/whatsnew/changelog.pot +[o:python-doc:p:python-313:r:whatsnew--changelog] +file_filter = whatsnew/changelog.po type = PO minimum_perc = 0 resource_name = whatsnew--changelog replace_edited_strings = false keep_translations = false -[o:python-doc:p:python-newest:r:whatsnew--index] -file_filter = .//LC_MESSAGES/whatsnew/index.po -trans.pt_BR = whatsnew/index.po -source_file = ../../pot/whatsnew/index.pot +[o:python-doc:p:python-313:r:whatsnew--index] +file_filter = whatsnew/index.po type = PO minimum_perc = 0 resource_name = whatsnew--index diff --git a/Makefile b/Makefile deleted file mode 100644 index c38ca5b79..000000000 --- a/Makefile +++ /dev/null @@ -1,260 +0,0 @@ -# -# Makefile for Brazilian Portuguese Python Documentation -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# based on: https://github.com/python/python-docs-fr/blob/3.8/Makefile -# - -################# -# Configuration - -# Read environment variables from file to keep this clean move version -# changes elsewhere -include .env - -# Force the use of Bash -SHELL=/bin/bash - -# Time of starting this run -NOW := $(shell date +'%Y%m%-d-%H%M%Z') - -# Force realpath, not relative one -override CPYTHON_DIR := $(shell realpath $(CPYTHON_DIR)) - -override LOGS_DIR := $(shell realpath $(LOGS_DIR)) - -override VENV_DIR := $(shell realpath $(VENV_DIR)) -# -################# - -.PHONY: build clean help htmlview lint merge pot pull push setup spell tx-config tx-install venv - -help: - @echo "Please use 'make ' where is one of:" - @echo " build Build an local version in html; deps: 'setup'" - @echo " push Commit and push translations; no deps" - @echo " pull Download translations from Transifex; deps: 'tx-config'" - @echo " tx-config Regenerate Transifex config; deps: 'pot' and 'tx-install'" - @echo " tx-install Install Transifex CLI client; deps: no deps" - @echo " pot Regenerate POT files from sources; deps: 'setup'" - @echo " htmlview View docs in a web browser; deps: build" - @echo " spell Check spelling, storing output in $(POSPELL_TMP_DIR)" - @echo " lint Do some linting in PO file's Sphinx syntax. deps: 'venv'" - @echo " merge Merge $(BRANCH) branch's .po files into older branches" - @echo " Defaults overwrite in: $(BUGFIXBRANCH)" - @echo " and NOT overwrite in: $(OLDERBRANCHES)" - @echo " clean Do some house cleaning" - @echo "" - - -# build: build the documentation using the translation files currently available -# at the moment. For most up-to-date docs, run "tx-config" and "pull" -# before this. If passing SPHINXERRORHANDLING='', warnings will not be -# treated as errors, which is good to skip simple Sphinx syntax mistakes. -build: setup - @mkdir -p "$(CPYTHON_DIR)/$(LOCALE_DIR)/$(LANGUAGE)/LC_MESSAGES/" - @cp --parents *.po **/*.po "$(CPYTHON_DIR)/$(LOCALE_DIR)/$(LANGUAGE)/LC_MESSAGES/" - @echo "Building Python $(BRANCH) Documentation in $(LANGUAGE) ..." - @mkdir -p "$(LOGS_DIR)/build" - @$(MAKE) -C $(CPYTHON_DIR)/Doc/ \ - PYTHON=$(PYTHON) \ - SPHINXERRORHANDLING=$(SPHINXERRORHANDLING) \ - SPHINXOPTS="--keep-going \ - -D gettext_compact=0 \ - -D language=$(LANGUAGE) \ - -D latex_engine=xelatex \ - -D latex_elements.inputenc= \ - -D latex_elements.fontenc=" \ - html \ - 2> >(tee -a $(LOGS_DIR)/build/err-$(NOW).txt >&2) - - -# push: Commit and push translation files and Transifex config file to repo. -# First it git-adds tracked file that doesn't exclusively match changes -# in POT-Creation-Date header field. Then it git-adds untracked PO files -# that might have been created in the update process, and the Transifex -# configuration. Finally, only commit and push only if any file was -# git-added (staged); otherwise, it does nothing. -# The MSG variable has a default commit message, but one can override it -# e.g. make push MSG='my message' -push: - @git diff -I'^"POT-Creation-Date: ' --numstat *.po **/*.po | cut -f3 | xargs -r git add - @git add $(shell git ls-files -o *.po **/*.po) .tx/config - @git diff-index --cached --quiet HEAD || \ - { git commit -m "Update translations from Transifex" && git push; } - - -# pull: Download translations files from Transifex, and apply line wrapping. -# For downloading new translation files, first run "tx-config" target -# to update the translation file mapping. -pull: tx-config - @"$(TX_CLI_DIR)/tx" pull -l $(LANGUAGE) -t -f --use-git-timestamps - @"$(VENV_DIR)/bin/powrap" --quiet *.po **/*.po - - -# tx-config: Generate a new Transifex configuration file by reading -# the pot files generated by 'pot' target. The file is -# created in $(LOCALE_DIR)/.tx/config, and then is tweaked -# to fit the language's needs and then placed in .tx/config -# at the project's root directory. -tx-config: TRANSIFEX_PROJECT := python-newest -tx-config: pot tx-install - @cd $(CPYTHON_DIR)/$(LOCALE_DIR); \ - rm -rf .tx; \ - "$(VENV_DIR)/bin/sphinx-intl" create-txconfig; \ - "$(VENV_DIR)/bin/sphinx-intl" update-txconfig-resources \ - --transifex-organization-name python-doc \ - --transifex-project-name=$(TRANSIFEX_PROJECT) \ - --locale-dir . \ - --pot-dir pot - @mkdir -p .tx - @sed $(CPYTHON_DIR)/$(LOCALE_DIR)/.tx/config \ - -e "s|^file_filter *= .*|&\nx&|;" \ - -e "s|= pot/|= ../../pot/|" \ - > .tx/config - @sed -i .tx/config \ - -e "s|^xfile_filter *= .//LC_MESSAGES/|trans.$(LANGUAGE) = |;" - - -# tx-install: Install Transifex CLI client if not installed yet. Installs -# the TX_CLI_VERSION version into TX_CLI_DIR directory. If -# TX_CLI_VERSION not provided, uses the latest one. -tx-install: URL := https://raw.githubusercontent.com/transifex/cli/master/install.sh -tx-install: - @if [ ! -x "$(TX_CLI_DIR)/tx" ]; then \ - echo "Transifex TX Client not found, installing ..."; \ - cd "$(TX_CLI_DIR)"; \ - if [ -n "v$(TX_CLI_VERSION)" ]; then \ - curl -s -o- $(URL) | bash -s -- v$(TX_CLI_VERSION); \ - else \ - curl -s -o- $(URL) | bash; \ - fi; \ - fi - - -# pot: After running "setup" target, run sphinx-build's gettext target -# to generate .pot files under $(CPYTHON_DIR)/Doc/locales/pot. -pot: setup - @$(MAKE) -C $(CPYTHON_DIR)/Doc/ \ - VENVDIR=./venv \ - PYTHON=$(PYTHON) \ - ALLSPHINXOPTS='-E \ - -b gettext \ - -D gettext_compact=0 \ - -d build/.doctrees \ - . $(CPYTHON_DIR)/$(LOCALE_DIR)/pot' \ - build - - -# setup: After running "venv" target, prepare that virtual environment with -# a local clone of cpython repository and the translation files. -# If the directories exists, only update the cpython repository and -# the translation files copy which could have new/updated files. -setup: CPYTHON_URL := https://github.com/python/cpython -setup: venv - @if [ -z "$(BRANCH)" ]; then \ - echo "BRANCH is empty, should have git-branch. Unable to continue."; \ - exit 1; \ - fi - - @if ! [ -d "$(CPYTHON_DIR)" ]; then \ - echo "CPython repo not found; cloning ..."; \ - git clone --depth 1 --no-single-branch $(CPYTHON_URL) $(CPYTHON_DIR); \ - git -C "$(CPYTHON_DIR)" checkout $(BRANCH); \ - else \ - echo "CPython repo found; updating ..."; \ - git -C "$(CPYTHON_DIR)" checkout $(BRANCH); \ - git -C "$(CPYTHON_DIR)" pull --rebase; \ - fi - - @echo "Creating CPython's documentation virtual environment ..." - @if [ ! -d "$(CPYTHON_DIR)/Doc/venv" ]; then \ - $(MAKE) -C "$(CPYTHON_DIR)/Doc" PYTHON=$(PYTHON) venv; \ - fi - - -# venv: create a virtual environment which will be used by almost every -# other target of this script. CPython specific packages are installed -# in there specific venv (see 'setup' target). -venv: - @if [ ! -d "$(VENV_DIR)" ]; then \ - echo "Setting up language team's virtual environment ..."; \ - "$(PYTHON)" -m venv "$(VENV_DIR)"; \ - "$(VENV_DIR)/bin/python" -m pip install --upgrade pip; \ - mkdir -p "$(LOGS_DIR)"; \ - "$(VENV_DIR)/bin/pip" install --requirement requirements.txt \ - --log "$(LOGS_DIR)/venv-$(NOW).txt"; \ - fi - - -# htmlview: View the documentation locally, using Makefile's "htmlview" target. -# Run "build" before using this target. -htmlview: build - @INDEX="$(CPYTHON_DIR)/Doc/build/html/index.html"; \ - "$(PYTHON)" -c "import os, webbrowser; \ - webbrowser.open('file://' + os.path.realpath('$$INDEX'))" - - -# spell: run spell checking tool in all po files listed in SRCS variable, -# storing the output in text files DESTS for proofreading. The -# DESTS target run the spellchecking, while the typos.txt target -# gather all reported issues in one file, sorted without redundancy. -SRCS := $(wildcard *.po **/*.po) -DESTS := $(addprefix $(LOGS_DIR)/pospell-$(NOW)/out/,$(patsubst %.po,%.txt,$(SRCS))) -spell: venv $(DESTS) $(LOGS_DIR)/pospell-$(NOW)/all.txt - -$(LOGS_DIR)/pospell-$(NOW)/out/%.txt: %.po dict - @echo "Checking $< ..." - @mkdir -p $(@D) - @$(VENV_DIR)/bin/pospell -l "$(LANGUAGE)" -p dict $< > $@ || true - -$(LOGS_DIR)/pospell-$(NOW)/all.txt: - @echo "Gathering all typos in $(LOGS_DIR)/pospell-$(NOW)/all.txt ..." - @cut -d: -f3- $(DESTS) | sort -u > $@ - - -# merge: Merge translations from BRANCH (Python version currently aim of -# translation) into each branch listed by BUGFIXBRANCH and -# OLDERBRANCHES (branches of older Python versions) so that older -# versions of the Python Docs try make at least some use of the latest -# translations. OLDERBRANCHES has '--no-overwrite' flag so it does not -# overwrite translated strings, preserving history. -# After merging, only commit and push only if any file was git-added -# (staged) to the target branch; otherwise, it does nothing. -merge: venv $(BUGFIXBRANCH) $(OLDERBRANCHES) - -$(OLDERBRANCHES): OVERWRITEFLAG = --no-overwrite -$(BUGFIXBRANCH) $(OLDERBRANCHES): - @if [[ $@ == $(BRANCH) ]]; then \ - echo "Ignoring attempt to pomerge '$(BRANCH)' into itself."; \ - else \ - echo "Merging translations from $(BRANCH) branch into $@ ..."; \ - $(VENV_DIR)/bin/pomerge --from-files *.po **/*.po; \ - git checkout $@; \ - $(VENV_DIR)/bin/pomerge $(OVERWRITEFLAG) --to-files *.po **/*.po; \ - $(VENV_DIR)/bin/powrap --modified *.po **/*.po; \ - git add -u; \ - if [ -n "$(git diff --name-only --cached)" ]; then \ - git commit -m $(MSG); \ - git push; \ - else \ - echo 'Nothing to commit'; \ - fi; \ - git checkout $(BRANCH); \ - fi - - -# lint: Report reStructuredText syntax errors in the translation files -lint: venv - @mkdir -p "$(LOGS_DIR)" - @$(VENV_DIR)/bin/sphinx-lint *.po **/*.po |& \ - tee -a $(LOGS_DIR)/lint-$(NOW).txt || true - @echo "Lint output stored in $(LOGS_DIR)/lint-$(NOW).txt" - - -# clean: remove all .mo files and the venv directory that may exist and could -# have been created by the actions in other targets of this script. -clean: - rm -rf "$(VENV_DIR)" - rm -rf "$(CPYTHON_DIR)/$(LOCALE_DIR)" - [ -d "$(CPYTHON_DIR)" ] && $(MAKE) -C "$(CPYTHON_DIR)/Doc" clean-venv diff --git a/README.md b/README.md index 42d958ca3..ac3654ceb 100644 --- a/README.md +++ b/README.md @@ -1,68 +1,19 @@ # Brazilian Portuguese Translation of the Python Documentation -[![Update](https://github.com/python/python-docs-pt-br/actions/workflows/update.yml/badge.svg)](https://github.com/python/python-docs-pt-br/actions/workflows/update.yml) -[![Check](https://github.com/python/python-docs-pt-br/actions/workflows/check.yml/badge.svg)](https://github.com/python/python-docs-pt-br/actions/workflows/check.yml) +[![Workflow status badge][workflow_badge]][workflow_url] +[![Translation statistics badge][stats_badge]][transifex_url] -Check our [wiki](https://github.com/python/python-docs-pt-br/wiki) for more guidance on translating +Translation files for [Python 3.13 docs][docs_url]. -## Translation priorities +See list of incomplete translations in the [potodo.md][potodo] file. -The following modules we consider as priority targets, hence should -receive more attention than other modules/pages (0 has higher priority -than 2). Please helps assure they are a 100% translated. +See [main][main] branch for scripts, docs, license and more info. -### Priority 0 (probably they are completed) - - bugs - - glossary - - library/functions - - library/index - - library/intro - - library/constants - - library/stdtypes - - library/exceptions - - sphinx - - tutorial/ (all!) +[main]: https://github.com/python/python-docs-pt-br/tree/main +[potodo]: potodo.md?plain=1 +[docs_url]: https://docs.python.org/pt-br/3.13/ +[workflow_badge]: https://github.com/python/python-docs-pt-br/workflows/python-313/badge.svg +[workflow_url]: https://github.com/python/python-docs-pt-br/actions?workflow=python-313 +[stats_badge]: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.13%2Fstats.json&query=completion&label=pt_BR +[transifex_url]: https://app.transifex.com/python-doc/python-newest/ -### Priority 1 - - reference/ (all) - - faq/ (all) - -### Priority 2 - - library/turtle - - library/sys - - library/argparse - - library/random - - library/statistics - - library/urllib.request - - library/smtplib - - library/datetime - - library/zlib - - library/gzip - - library/lzma - - library/tarfile - - library/timeit - - library/profile - - library/doctest - - library/unittest - - library/ (except the ones mentioned above) - -## Documentation Contribution Agreement - -NOTE REGARDING THE LICENSE FOR TRANSLATIONS: Python's documentation is -maintained using a global network of volunteers. By posting this -project on Transifex, GitHub, and other public places, and inviting -you to participate, we are proposing an agreement that you will -provide your improvements to Python's documentation or the translation -of Python's documentation for the PSF's use under the CC0 license -(available at -https://creativecommons.org/publicdomain/zero/1.0/legalcode). In -return, you may publicly claim credit for the portion of the -translation you contributed and if your translation is accepted by the -PSF, you may (but are not required to) submit a patch including an -appropriate annotation in the Misc/ACKS or TRANSLATORS file. Although -nothing in this Documentation Contribution Agreement obligates the PSF -to incorporate your textual contribution, your participation in the -Python community is welcomed and appreciated. - -You signify acceptance of this agreement by submitting your work to -the PSF for inclusion in the documentation. diff --git a/about.po b/about.po index a32aefd89..4cf66d10c 100644 --- a/about.po +++ b/about.po @@ -1,46 +1,43 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# André Girol , 2021 -# Amanda Savluchinske , 2021 -# Adorilson Bezerra , 2021 -# Clara Matos, 2022 -# Rafael Fontenelle , 2022 +# python-doc bot, 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-11 18:37+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Rafael Fontenelle , 2022\n" +"POT-Creation-Date: 2026-04-25 15:22+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: python-doc bot, 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../about.rst:3 -msgid "About these documents" -msgstr "Sobre esses documentos" +msgid "About this documentation" +msgstr "Sobre esta documentação" #: ../../about.rst:6 msgid "" -"These documents are generated from `reStructuredText`_ sources by `Sphinx`_, " -"a document processor specifically written for the Python documentation." +"Python's documentation is generated from `reStructuredText`_ sources using " +"`Sphinx`_, a documentation generator originally created for Python and now " +"maintained as an independent project." msgstr "" -"Esses documentos são gerados a partir de `reStructuredText`_ pelo `Sphinx`_, " -"um processador de documentos especificamente escrito para documentação " -"Python." +"A documentação do Python é gerada a partir de fontes `reStructuredText`_ " +"usando `Sphinx`_, um gerador de documentação criado originalmente para " +"Python e agora mantido como um projeto independente." -#: ../../about.rst:15 +#: ../../about.rst:16 msgid "" "Development of the documentation and its toolchain is an entirely volunteer " "effort, just like Python itself. If you want to contribute, please take a " @@ -52,19 +49,19 @@ msgstr "" "dê uma olhada na página :ref:`reporting-bugs` para informações sobre como " "fazer. Novos voluntários são sempre bem-vindos!" -#: ../../about.rst:20 +#: ../../about.rst:21 msgid "Many thanks go to:" msgstr "Agradecimentos especiais para:" -#: ../../about.rst:22 +#: ../../about.rst:23 msgid "" "Fred L. Drake, Jr., the creator of the original Python documentation toolset " -"and writer of much of the content;" +"and author of much of the content;" msgstr "" "Fred L. Drake, Jr., o criador do primeiro conjunto de ferramentas para " -"documentar Python e escritor de boa parte do conteúdo;" +"documentar Python e autor de boa parte do conteúdo;" -#: ../../about.rst:24 +#: ../../about.rst:25 msgid "" "the `Docutils `_ project for creating " "reStructuredText and the Docutils suite;" @@ -72,7 +69,7 @@ msgstr "" "O projeto `Docutils `_ por criar " "reStructuredText e o pacote Docutils;" -#: ../../about.rst:26 +#: ../../about.rst:27 msgid "" "Fredrik Lundh for his Alternative Python Reference project from which Sphinx " "got many good ideas." @@ -80,21 +77,21 @@ msgstr "" "Fredrik Lundh, pelo seu projeto de referência alternativa em Python, do qual " "Sphinx pegou muitas boas ideias." -#: ../../about.rst:31 -msgid "Contributors to the Python Documentation" -msgstr "Contribuidores da Documentação Python" +#: ../../about.rst:32 +msgid "Contributors to the Python documentation" +msgstr "Contribuidores da documentação do Python" -#: ../../about.rst:33 +#: ../../about.rst:34 msgid "" "Many people have contributed to the Python language, the Python standard " "library, and the Python documentation. See :source:`Misc/ACKS` in the " "Python source distribution for a partial list of contributors." msgstr "" -"Muitas pessoas tem contribuído para a linguagem Python, sua biblioteca " +"Muitas pessoas têm contribuído para a linguagem Python, sua biblioteca " "padrão e sua documentação. Veja :source:`Misc/ACKS` na distribuição do " "código do Python para ver uma lista parcial de contribuidores." -#: ../../about.rst:37 +#: ../../about.rst:38 msgid "" "It is only with the input and contributions of the Python community that " "Python has such wonderful documentation -- Thank You!" diff --git a/bugs.po b/bugs.po index 9b9080f13..bdb43d295 100644 --- a/bugs.po +++ b/bugs.po @@ -1,28 +1,28 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Felipefpl, 2021 -# Ana Carolina Gomes, 2023 -# Vitor Buxbaum Orlandi, 2023 -# Rafael Fontenelle , 2024 +# Rafael Fontenelle , 2025 +# python-doc bot, 2025 +# Adorilson Bezerra , 2025 +# Angelo Siqueira, 2026 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-17 14:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-05-09 16:22+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Angelo Siqueira, 2026\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -38,17 +38,17 @@ msgid "" msgstr "" "O Python é uma linguagem de programação madura que estabeleceu uma reputação " "pela estabilidade. A fim de manter esta reputação os desenvolvedores " -"gostariam de saber de quaisquer deficiências que você encontrar no Python." +"gostariam de saber de quaisquer deficiências que você encontre no 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 fewer people. Learn how " +"to :ref:`contribute `." msgstr "" -"Às vezes, pode ser mais rápido consertar os bugs você mesmo e contribuir " -"com patches para o Python uma vez que isso agiliza o processo e envolve " -"menos pessoas. Veja aqui como :ref:`contribuir `." +"Por vezes, pode ser mais rápido corrigir os bugs pessoalmente e contribuir " +"com correções (patches) para o Python, uma vez que simplifica o processo e " +"envolve menos pessoas. Saiba como :ref:`contribuir `." #: ../../bugs.rst:16 msgid "Documentation bugs" @@ -57,14 +57,26 @@ msgstr "Bugs na documentação" #: ../../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:`tracker `. If you have a suggestion on how to fix it, include that as well." +"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." msgstr "" "Se você achar um bug nesta documentação ou gostaria de propor uma melhoria, " -"por favor submeta um relatório no :ref:`rastreador `. Se " -"você tem uma sugestão sobre como consertá-lo inclua isso também." +"por favor submeta um relatório no :ref:`rastreador de problemas `. Se você tiver uma sugestão sobre como consertá-lo inclua isso " +"também." + +#: ../../bugs.rst:24 +msgid "" +"If the bug or suggested improvement concerns the translation of this " +"documentation, submit the report to the `translation’s repository " +"`_ instead." +msgstr "" +"Se o bug ou a melhoria sugerida estiver relacionado à tradução desta " +"documentação, envie o relatório para o `repositório de tradução " +"`_." -#: ../../bugs.rst:22 +#: ../../bugs.rst:28 msgid "" "You can also open a discussion item on our `Documentation Discourse forum " "`_." @@ -72,34 +84,21 @@ msgstr "" "Você também pode abrir um item de discussão em nosso `fórum Discourse de " "documentação `_." -#: ../../bugs.rst:25 +#: ../../bugs.rst:31 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 bug " +"documentation, please submit a bug report on the `python-doc-theme issue " "tracker `_." msgstr "" "Se você encontrar um bug no tema (HTML/CSS/JavaScript) da documentação, " -"envie um relatório de bug no `rastreador de bugs do python-doc-theme " +"envie um relatório de bug no `rastreador de problemas do python-doc-theme " "`_." -#: ../../bugs.rst:29 -msgid "" -"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 "" -"Se você está com pouco tempo, pode também enviar os relatórios de erros de " -"documentação para o e-mail docs@python.org (erros de funcionalidades podem " -"ser enviados para python-list@python.org). 'docs@' é uma lista de discussão " -"mantida por voluntários; seu pedido será recebido, embora possa levar um " -"tempo para ser processado." - -#: ../../bugs.rst:36 +#: ../../bugs.rst:37 msgid "`Documentation bugs`_" msgstr "`Bugs na documentação`_" -#: ../../bugs.rst:37 +#: ../../bugs.rst:38 msgid "" "A list of documentation bugs that have been submitted to the Python issue " "tracker." @@ -107,25 +106,25 @@ msgstr "" "Uma lista de bugs na documentação que foram submetidos no rastreador de " "problemas do Python." -#: ../../bugs.rst:39 +#: ../../bugs.rst:40 msgid "`Issue Tracking `_" msgstr "`Rastreando problemas `_" -#: ../../bugs.rst:40 +#: ../../bugs.rst:41 msgid "" "Overview of the process involved in reporting an improvement on the tracker." msgstr "" "Visão geral do processo envolvido em reportar uma melhoria no rastreador." -#: ../../bugs.rst:42 +#: ../../bugs.rst:43 msgid "" "`Helping with Documentation `_" msgstr "" -"`Ajudando com a Documentação `_" -#: ../../bugs.rst:43 +#: ../../bugs.rst:44 msgid "" "Comprehensive guide for individuals that are interested in contributing to " "Python documentation." @@ -133,15 +132,15 @@ msgstr "" "Guia compreensivo para os indivíduos que estão interessados em contribuir " "com a documentação do Python." -#: ../../bugs.rst:45 +#: ../../bugs.rst:46 msgid "" "`Documentation Translations `_" msgstr "" -"`Traduções da Documentação `_" -#: ../../bugs.rst:46 +#: ../../bugs.rst:47 msgid "" "A list of GitHub pages for documentation translation and their primary " "contacts." @@ -149,11 +148,11 @@ msgstr "" "Uma lista de páginas no GitHub relacionadas à tradução da documentação e " "respectivos contatos iniciais." -#: ../../bugs.rst:52 +#: ../../bugs.rst:53 msgid "Using the Python issue tracker" msgstr "Usando o rastreador de problemas do Python" -#: ../../bugs.rst:54 +#: ../../bugs.rst:55 msgid "" "Issue reports for Python itself should be submitted via the GitHub issues " "tracker (https://github.com/python/cpython/issues). The GitHub issues " @@ -165,7 +164,7 @@ msgstr "" "rastreador de problemas do GitHub oferece um formulário web que permite " "informações pertinentes serem enviadas para os desenvolvedores." -#: ../../bugs.rst:59 +#: ../../bugs.rst:60 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 " @@ -183,7 +182,7 @@ msgstr "" "fornecê-la se você puder!). Para fazer isso, procure no rastreador usando a " "caixa de busca no topo da página." -#: ../../bugs.rst:66 +#: ../../bugs.rst:67 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 " @@ -195,7 +194,7 @@ msgstr "" "usando o link \"Sign Up\". Não é possível enviar um relatório de bug " "anonimamente." -#: ../../bugs.rst:71 +#: ../../bugs.rst:72 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." @@ -204,11 +203,11 @@ msgstr "" "Clique no botão \"New issue\" na barra superior para relatar um novo " "problema." -#: ../../bugs.rst:74 +#: ../../bugs.rst:75 msgid "The submission form has two fields, \"Title\" and \"Comment\"." msgstr "O formulário de submissão tem dois campos, \"Title\" e \"Comment\"." -#: ../../bugs.rst:76 +#: ../../bugs.rst:77 msgid "" "For the \"Title\" field, enter a *very* short description of the problem; " "fewer than ten words is good." @@ -216,7 +215,7 @@ msgstr "" "Para o campo \"Title\", insira uma descrição *muito* curta do problema; " "menos de dez palavras é bom." -#: ../../bugs.rst:79 +#: ../../bugs.rst:80 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 " @@ -229,7 +228,7 @@ msgstr "" "plataforma de software você está usando (incluindo informações sobre a " "versão quando apropriado)." -#: ../../bugs.rst:84 +#: ../../bugs.rst:85 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 " @@ -239,15 +238,15 @@ msgstr "" "determinar o que é necessário para solucionar o problema. Você receberá " "atualizações para cada ação tomada para o problema." -#: ../../bugs.rst:91 +#: ../../bugs.rst:92 msgid "" "`How to Report Bugs Effectively `_" msgstr "" -"`Como Reportar Bugs Eficientemente `_" -#: ../../bugs.rst:92 +#: ../../bugs.rst:93 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." @@ -255,7 +254,7 @@ msgstr "" "Artigo que entra em algum detalhe sobre como criar um relatório de bug útil. " "Isto descreve qual tipo de informação é útil e por quê é útil." -#: ../../bugs.rst:95 +#: ../../bugs.rst:96 msgid "" "`Bug Writing Guidelines `_" @@ -263,7 +262,7 @@ msgstr "" "`Diretrizes para relatar bugs `_" -#: ../../bugs.rst:96 +#: ../../bugs.rst:97 msgid "" "Information about writing a good bug report. Some of this is specific to " "the Mozilla project, but describes general good practices." @@ -271,11 +270,11 @@ msgstr "" "Informação sobre como escrever um bom relatório de bug. Um pouco disto é " "específico do Projeto Mozilla, mas descreve boas práticas em geral." -#: ../../bugs.rst:102 +#: ../../bugs.rst:103 msgid "Getting started contributing to Python yourself" msgstr "Começando a contribuir com o Python por conta própria" -#: ../../bugs.rst:104 +#: ../../bugs.rst:105 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 " diff --git a/library/constants.po b/builtins/constants.po similarity index 55% rename from library/constants.po rename to builtins/constants.po index 53a92f892..49efe1dbf 100644 --- a/library/constants.po +++ b/builtins/constants.po @@ -1,41 +1,41 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Sheila Gomes , 2021 -# Gabriel Crispino , 2021 -# Rafael Fontenelle , 2024 +# python-doc bot, 2026 +# zanarelli, 2026 +# Rafael Fontenelle , 2026 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-31 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:57+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2026-09-13 19:06+0000\n" +"Last-Translator: Rafael Fontenelle , 2026\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" -#: ../../library/constants.rst:4 +#: ../../builtins/constants.rst:4 msgid "Built-in Constants" msgstr "Constantes embutidas" -#: ../../library/constants.rst:6 +#: ../../builtins/constants.rst:6 msgid "A small number of constants live in the built-in namespace. They are:" msgstr "" "Um pequeno número de constantes são definidas no espaço de nomes embutido da " "linguagem. São elas:" -#: ../../library/constants.rst:10 +#: ../../builtins/constants.rst:10 msgid "" "The false value of the :class:`bool` type. Assignments to ``False`` are " "illegal and raise a :exc:`SyntaxError`." @@ -43,7 +43,7 @@ msgstr "" "O valor falso do tipo :class:`bool`. As atribuições a ``False`` são ilegais " "e levantam :exc:`SyntaxError`." -#: ../../library/constants.rst:16 +#: ../../builtins/constants.rst:16 msgid "" "The true value of the :class:`bool` type. Assignments to ``True`` are " "illegal and raise a :exc:`SyntaxError`." @@ -51,39 +51,40 @@ msgstr "" "O valor verdadeiro do tipo :class:`bool`. As atribuições a ``True`` são " "ilegais e levantam :exc:`SyntaxError`." -#: ../../library/constants.rst:22 +#: ../../builtins/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 :class:`~types.NoneType` type." msgstr "" "Um objeto frequentemente usado para representar a ausência de um valor, como " -"quando os argumentos padrão não são passados para uma função. As atribuições " -"a ``None`` são ilegais e levantam :exc:`SyntaxError`. ``None`` é a única " -"instância do tipo :data:`~types.NoneType`." - -#: ../../library/constants.rst:30 -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 "" -"Um valor especial que deve ser retornado pelos métodos binários especiais " -"(por exemplo: :meth:`~object.__eq__`, :meth:`~object.__lt__`, :meth:`~object." -"__add__`, :meth:`~object.__rsub__`, etc.) não é implementado em relação ao " -"outro tipo; pode ser retornado pelos métodos especiais binários no local " -"(por exemplo: :meth:`~object.__imul__`, :meth:`~object.__iand__`, etc.) para " -"o mesmo propósito. Ele não deve ser avaliado em um contexto booleano. :data:" -"`!NotImplemented` é a única instância do tipo :data:`types." -"NotImplementedType`." - -#: ../../library/constants.rst:40 +"quando argumentos padrão não são passados para uma função. Atribuições a " +"``None`` são ilegais e levantam um :exc:`SyntaxError`. ``None`` é a única " +"instância do tipo :class:`~types.NoneType`." + +#: ../../builtins/constants.rst:30 +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 :class:`types.NotImplementedType` type." +msgstr "" +"Um valor especial que deve ser retornado pelos métodos especiais binários " +"(por " +"exemplo, :meth:`~object.__eq__`, :meth:`~object.__lt__`, :meth:`~object.__add__`, :meth:`~object.__rsub__`, " +"etc.) para indicar que a operação não foi implementada em relação ao outro " +"tipo; pode ser retornado pelos métodos especiais binários in-place (por " +"exemplo, :meth:`~object.__imul__`, :meth:`~object.__iand__`, etc.) para o " +"mesmo propósito. Ele não deve ser avaliado em um contexto booleano. :data:`!" +"NotImplemented` é a única instância do " +"tipo :class:`types.NotImplementedType`." + +#: ../../builtins/constants.rst:40 msgid "" "When a binary (or in-place) method returns :data:`!NotImplemented` the " "interpreter will try the reflected operation on the other type (or some " @@ -101,22 +102,23 @@ msgstr "" "enganosa ou no valor :data:`!NotImplemented` sendo retornado ao código " "Python." -#: ../../library/constants.rst:47 +#: ../../builtins/constants.rst:47 msgid "See :ref:`implementing-the-arithmetic-operations` for examples." msgstr "" "Consulte :ref:`implementing-the-arithmetic-operations` para ver exemplos." -#: ../../library/constants.rst:51 +#: ../../builtins/constants.rst:51 msgid "" -"``NotImplementedError`` and :data:`!NotImplemented` are not interchangeable, " -"even though they have similar names and purposes. See :exc:" -"`NotImplementedError` for details on when to use it." +":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 "" -"``NotImplementedError`` e :data:`!NotImplemented` não são intercambiáveis, " -"mesmo que tenham nomes e propósitos similares. Veja :exc:" -"`NotImplementedError` para detalhes e casos de uso." +":data:`!NotImplemented` e :exc:`!NotImplementedError` não são " +"intercambiáveis. Esta constante deve ser usada somente conforme descrito " +"acima; veja :exc:`NotImplementedError` para detalhes sobre o uso correto da " +"exceção." -#: ../../library/constants.rst:55 +#: ../../builtins/constants.rst:56 msgid "" "Evaluating :data:`!NotImplemented` in a boolean context is deprecated. While " "it currently evaluates as true, it will emit a :exc:`DeprecationWarning`. It " @@ -127,42 +129,42 @@ msgstr "" "um :exc:`DeprecationWarning`. Ele levantará uma :exc:`TypeError` em uma " "versão futura do Python." -#: ../../library/constants.rst:64 +#: ../../builtins/constants.rst:65 msgid "" -"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." +"The same as the ellipsis literal \"``...``\", an object frequently used to " +"indicate that something is omitted. Assignment to ``Ellipsis`` is possible, " +"but assignment to ``...`` raises a :exc:`SyntaxError`. ``Ellipsis`` is the " +"sole instance of the :class:`types.EllipsisType` type." msgstr "" -"O mesmo que as reticências literais \"``...``\". Valor especial usado " -"principalmente em conjunto com a sintaxe de divisão estendida para tipos de " -"dados de contêiner definidos pelo usuário. ``Ellipsis`` é a única instância " -"do tipo :data:`types.EllipsisType`." +"O mesmo que o literal de elipse \"``...``\", um objeto frequentemente usado " +"para indicar que algo foi omitido. A atribuição a ``Ellipsis`` é possível, " +"mas a atribuição a ``...`` levanta um :exc:`SyntaxError`. ``Ellipsis`` é a " +"única instância do tipo :class:`types.EllipsisType`." -#: ../../library/constants.rst:71 +#: ../../builtins/constants.rst:73 msgid "" "This constant is true if Python was not started with an :option:`-O` option. " "See also the :keyword:`assert` statement." msgstr "" -"Esta constante é verdadeira se o Python não foi iniciado com uma opção :" -"option:`-O`. Veja também a instrução :keyword:`assert`." +"Esta constante é verdadeira se o Python não foi iniciado com uma " +"opção :option:`-O`. Veja também a instrução :keyword:`assert`." -#: ../../library/constants.rst:77 +#: ../../builtins/constants.rst:79 msgid "" "The names :data:`None`, :data:`False`, :data:`True` and :data:`__debug__` " -"cannot be reassigned (assignments to them, even as an attribute name, raise :" -"exc:`SyntaxError`), so they can be considered \"true\" constants." +"cannot be reassigned (assignments to them, even as an attribute name, " +"raise :exc:`SyntaxError`), so they can be considered \"true\" constants." msgstr "" "Os nomes :data:`None`, :data:`False`, :data:`True` e :data:`__debug__` não " "podem ser reatribuídos (atribuições a eles, mesmo como um nome de atributo, " "levantam :exc:`SyntaxError` ), para que possam ser consideradas " "\"verdadeiras\" constantes." -#: ../../library/constants.rst:83 +#: ../../builtins/constants.rst:87 msgid "Constants added by the :mod:`site` module" msgstr "Constantes adicionadas pelo módulo :mod:`site`" -#: ../../library/constants.rst:85 +#: ../../builtins/constants.rst:89 msgid "" "The :mod:`site` module (which is imported automatically during startup, " "except if the :option:`-S` command-line option is given) adds several " @@ -175,17 +177,30 @@ msgstr "" "úteis para o console do interpretador interativo e não devem ser usados em " "programas." -#: ../../library/constants.rst:93 +#: ../../builtins/constants.rst:97 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 " -"exit code." +"EOF) to exit\", and when accessed directly in the interactive interpreter or " +"called as functions, raise :exc:`SystemExit` with the specified exit code." +msgstr "" +"Objetos que, quando exibidos, exibem uma mensagem como \"Use quit() or Ctrl-" +"D (i.e. EOF) to exit\" e, quando acessados diretamente no interpretador " +"interativo ou chamados como funções, levantam :exc:`SystemExit` com o código " +"de saída especificado." + +#: ../../builtins/constants.rst:105 +msgid "" +"Object that when printed, prints the message \"Type help() for interactive " +"help, or help(object) for help about object.\", and when accessed directly " +"in the interactive interpreter, invokes the built-in help system " +"(see :func:`help`)." msgstr "" -"Objetos que, quando impressos, imprimem uma mensagem como \"Use quit() or " -"Ctrl-D (i.e. EOF) to exit\" e, quando chamados, levantam :exc:`SystemExit` " -"com o código de saída especificado." +"Objeto que, quando exibido, exibe a mensagem \"Type help() for interactive " +"help, or help(object) for help about object.\" e, quando acessado " +"diretamente no interpretador interativo, invoca o sistema de ajuda embutido " +"(veja :func:`help`)." -#: ../../library/constants.rst:100 +#: ../../builtins/constants.rst:113 msgid "" "Objects that when printed or called, print the text of copyright or credits, " "respectively." @@ -193,7 +208,7 @@ msgstr "" "Objetos que ao serem impressos ou chamados, imprimem o texto dos direitos " "autorais ou créditos, respectivamente." -#: ../../library/constants.rst:105 +#: ../../builtins/constants.rst:118 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 " @@ -203,10 +218,10 @@ msgstr "" "full license text\" e, quando chamado, exibe o texto completo da licença de " "maneira semelhante a um paginador (uma tela por vez)." -#: ../../library/constants.rst:61 +#: ../../builtins/constants.rst:62 msgid "..." msgstr "..." -#: ../../library/constants.rst:61 +#: ../../builtins/constants.rst:62 msgid "ellipsis literal" -msgstr "reticências literais" +msgstr "literal de reticências" diff --git a/library/exceptions.po b/builtins/exceptions.po similarity index 56% rename from library/exceptions.po rename to builtins/exceptions.po index 84132061c..6a615d5e5 100644 --- a/library/exceptions.po +++ b/builtins/exceptions.po @@ -1,57 +1,52 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Hildeberto Abreu Magalhães , 2021 -# guilhermegouw , 2021 -# Vinicius Gubiani Ferreira , 2023 -# Marco Rougeth , 2023 -# Patricia Mortada, 2023 -# Leandro Cavalcante Damascena , 2024 -# Rafael Fontenelle , 2024 -# Adorilson Bezerra , 2024 +# zanarelli, 2026 +# Rafael Fontenelle , 2026 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-20 00:52+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: Adorilson Bezerra , 2024\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2026-09-13 19:06+0000\n" +"Last-Translator: Rafael Fontenelle , 2026\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" -#: ../../library/exceptions.rst:4 +#: ../../builtins/exceptions.rst:4 msgid "Built-in Exceptions" msgstr "Exceções embutidas" -#: ../../library/exceptions.rst:10 +#: ../../builtins/exceptions.rst:10 msgid "" -"In Python, all exceptions must be instances of a class that derives from :" -"class:`BaseException`. In a :keyword:`try` statement with an :keyword:" -"`except` clause that mentions a particular class, that clause also handles " -"any exception classes derived from that class (but not exception classes " -"from which *it* is derived). Two exception classes that are not related via " -"subclassing are never equivalent, even if they have the same name." +"In Python, all exceptions must be instances of a class that derives " +"from :class:`BaseException`. In a :keyword:`try` statement with " +"an :keyword:`except` clause that mentions a particular class, that clause " +"also handles any exception classes derived from that class (but not " +"exception classes from which *it* is derived). Two exception classes that " +"are not related via subclassing are never equivalent, even if they have the " +"same name." msgstr "" -"No Python, todas as exceções devem ser instâncias de uma classe derivada de :" -"class:`BaseException`. Em uma instrução :keyword:`try` com uma cláusula :" -"keyword:`except` que menciona uma classe específica, essa cláusula também " -"lida com qualquer classe de exceção derivada dessa classe (mas não com as " -"classes de exceção a partir das quais *ela* é derivada). Duas classes de " -"exceção que não são relacionadas por subclasse nunca são equivalentes, mesmo " -"que tenham o mesmo nome." +"No Python, todas as exceções devem ser instâncias de uma classe derivada " +"de :class:`BaseException`. Em uma instrução :keyword:`try` com uma " +"cláusula :keyword:`except` que menciona uma classe específica, essa cláusula " +"também lida com qualquer classe de exceção derivada dessa classe (mas não " +"com as classes de exceção a partir das quais *ela* é derivada). Duas classes " +"de exceção que não são relacionadas por subclasse nunca são equivalentes, " +"mesmo que tenham o mesmo nome." -#: ../../library/exceptions.rst:19 +#: ../../builtins/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 " @@ -67,7 +62,7 @@ msgstr "" "erro e uma string que explica o código). O valor associado geralmente é " "passado como argumentos para o construtor da classe de exceção." -#: ../../library/exceptions.rst:26 +#: ../../builtins/exceptions.rst:26 msgid "" "User code can raise built-in exceptions. This can be used to test an " "exception handler or to report an error condition \"just like\" the " @@ -81,25 +76,25 @@ msgstr "" "mas lembre-se de que nada impede o código do usuário de gerar um erro " "inadequado." -#: ../../library/exceptions.rst:31 +#: ../../builtins/exceptions.rst:31 msgid "" "The built-in exception classes can be subclassed to define new exceptions; " -"programmers are encouraged to derive new exceptions from the :exc:" -"`Exception` class or one of its subclasses, and not from :exc:" -"`BaseException`. More information on defining exceptions is available in " -"the Python Tutorial under :ref:`tut-userexceptions`." +"programmers are encouraged to derive new exceptions from " +"the :exc:`Exception` class or one of its subclasses, and not " +"from :exc:`BaseException`. More information on defining exceptions is " +"available in the Python Tutorial under :ref:`tut-userexceptions`." msgstr "" "As classes de exceções embutidas podem ser usadas como subclasses para " "definir novas exceções; Os programadores são incentivados a derivar novas " -"exceções da classe :exc:`Exception` ou de uma de suas subclasses, e não de :" -"exc:`BaseException`. Mais informações sobre a definição de exceções estão " -"disponíveis no Tutorial do Python em :ref:`tut-userexceptions`." +"exceções da classe :exc:`Exception` ou de uma de suas subclasses, e não " +"de :exc:`BaseException`. Mais informações sobre a definição de exceções " +"estão disponíveis no Tutorial do Python em :ref:`tut-userexceptions`." -#: ../../library/exceptions.rst:39 +#: ../../builtins/exceptions.rst:39 msgid "Exception context" msgstr "Contexto da exceção" -#: ../../library/exceptions.rst:46 +#: ../../builtins/exceptions.rst:46 msgid "" "Three attributes on exception objects provide information about the context " "in which the exception was raised:" @@ -107,21 +102,21 @@ msgstr "" "Três atributos em objetos exceções fornecem informações sobre o contexto em " "que a exceção foi levantada." -#: ../../library/exceptions.rst:53 +#: ../../builtins/exceptions.rst:53 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." +"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." msgstr "" "Ao levantar uma nova exceção enquanto outra exceção já está sendo tratada, o " "atributo :attr:`!__context__` da nova exceção é automaticamente definido " -"para a exceção tratada. Uma exceção pode ser tratada quando uma cláusula :" -"keyword:`except` ou :keyword:`finally`, ou uma instrução :keyword:`with`, é " -"usada." +"para a exceção tratada. Uma exceção pode ser tratada quando uma " +"cláusula :keyword:`except` ou :keyword:`finally`, ou uma " +"instrução :keyword:`with`, é usada." -#: ../../library/exceptions.rst:59 +#: ../../builtins/exceptions.rst:59 msgid "" "This implicit exception context can be supplemented with an explicit cause " "by using :keyword:`!from` with :keyword:`raise`::" @@ -129,7 +124,11 @@ msgstr "" "Esse contexto implícito da exceção pode ser complementado com uma causa " "explícita usando :keyword:`!from` com :keyword:`raise`::" -#: ../../library/exceptions.rst:65 +#: ../../builtins/exceptions.rst:63 +msgid "raise new_exc from original_exc" +msgstr "raise new_exc from original_exc" + +#: ../../builtins/exceptions.rst:65 msgid "" "The expression following :keyword:`from` must be an exception or " "``None``. It will be set as :attr:`!__cause__` on the raised exception. " @@ -142,14 +141,14 @@ msgid "" msgstr "" "A expressão a seguir :keyword:`from` deve ser uma exceção ou " "``None``. Ela será definida como :attr:`!__cause__` na exceção levantada. A " -"definição de :attr:`!__cause__` também define implicitamente o atributo :" -"attr:`!__suppress_context__` como ``True``, de modo que o uso de ``raise " -"new_exc from None`` substitui efetivamente a exceção antiga pela nova para " -"fins de exibição (por exemplo, convertendo :exc:`KeyError` para :exc:" -"`AttributeError`), deixando a exceção antiga disponível em :attr:`!" +"definição de :attr:`!__cause__` também define implicitamente o " +"atributo :attr:`!__suppress_context__` como ``True``, de modo que o uso de " +"``raise new_exc from None`` substitui efetivamente a exceção antiga pela " +"nova para fins de exibição (por exemplo, convertendo :exc:`KeyError` " +"para :exc:`AttributeError`), deixando a exceção antiga disponível em :attr:`!" "__context__` para introspecção durante a depuração." -#: ../../library/exceptions.rst:74 +#: ../../builtins/exceptions.rst:74 msgid "" "The default traceback display code shows these chained exceptions in " "addition to the traceback for the exception itself. An explicitly chained " @@ -160,10 +159,11 @@ msgstr "" "O código de exibição padrão do traceback mostra essas exceções encadeadas, " "além do traceback da própria exceção. Uma exceção explicitamente encadeada " "em :attr:`!__cause__` sempre é mostrada quando presente. Uma exceção " -"implicitamente encadeada em :attr:`!__context__` é mostrada apenas se :attr:" -"`!__cause__` for :const:`None` e :attr:`!__suppress_context__` for falso." +"implicitamente encadeada em :attr:`!__context__` é mostrada apenas " +"se :attr:`!__cause__` for :const:`None` e :attr:`!__suppress_context__` for " +"falso." -#: ../../library/exceptions.rst:80 +#: ../../builtins/exceptions.rst:80 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 " @@ -173,11 +173,11 @@ msgstr "" "exceções encadeadas, de modo que a linha final do traceback sempre mostre a " "última exceção que foi levantada." -#: ../../library/exceptions.rst:86 +#: ../../builtins/exceptions.rst:86 msgid "Inheriting from built-in exceptions" msgstr "Herdando de exceções embutidas" -#: ../../library/exceptions.rst:88 +#: ../../builtins/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 " @@ -189,14 +189,15 @@ msgstr "" "evitar possíveis conflitos entre como as bases tratam o atributo ``args``, " "bem como devido a possíveis incompatibilidades de layout de memória." -#: ../../library/exceptions.rst:95 +#: ../../builtins/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." +"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 "" "A maioria das exceções embutidas são implementadas em C para eficiência, " "veja: :source:`Objects/exceptions.c`. Algumas têm layouts de memória " @@ -206,11 +207,11 @@ msgstr "" "conflitos no futuro. Portanto, é recomendável evitar criar subclasses de " "vários tipos de exceção." -#: ../../library/exceptions.rst:105 +#: ../../builtins/exceptions.rst:105 msgid "Base classes" msgstr "Classes base" -#: ../../library/exceptions.rst:107 +#: ../../builtins/exceptions.rst:107 msgid "" "The following exceptions are used mostly as base classes for other " "exceptions." @@ -218,21 +219,21 @@ msgstr "" "As seguintes exceções são usadas principalmente como classes base para " "outras exceções." -#: ../../library/exceptions.rst:111 +#: ../../builtins/exceptions.rst:111 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 :" -"func:`str` is called on an instance of this class, the representation of the " -"argument(s) to the instance are returned, or the empty string when there " +"inherited by user-defined classes (for that, use :exc:`Exception`). " +"If :func:`str` is called on an instance of this class, the representation of " +"the argument(s) to the instance are returned, or the empty string when there " "were no arguments." msgstr "" "A classe base para todas as exceções embutidas. Não é para ser herdada " -"diretamente por classes definidas pelo usuário (para isso, use :exc:" -"`Exception`). Se :func:`str` for chamado em uma instância desta classe, a " -"representação do(s) argumento(s) para a instância será retornada ou a string " -"vazia quando não houver argumentos." +"diretamente por classes definidas pelo usuário (para isso, " +"use :exc:`Exception`). Se :func:`str` for chamado em uma instância desta " +"classe, a representação do(s) argumento(s) para a instância será retornada " +"ou a string vazia quando não houver argumentos." -#: ../../library/exceptions.rst:119 +#: ../../builtins/exceptions.rst:119 msgid "" "The tuple of arguments given to the exception constructor. Some built-in " "exceptions (like :exc:`OSError`) expect a certain number of arguments and " @@ -245,7 +246,7 @@ msgstr "" "são normalmente chamadas apenas com uma única string que fornece uma " "mensagem de erro." -#: ../../library/exceptions.rst:126 +#: ../../builtins/exceptions.rst:126 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 " @@ -266,7 +267,21 @@ msgstr "" "traceback de ``SomeException`` original se tivéssemos permitido que ele se " "propagasse para o chamador. ::" -#: ../../library/exceptions.rst:143 +#: ../../builtins/exceptions.rst:135 +msgid "" +"try:\n" +" ...\n" +"except SomeException:\n" +" tb = sys.exception().__traceback__\n" +" raise OtherException(...).with_traceback(tb)" +msgstr "" +"try:\n" +" ...\n" +"except SomeException:\n" +" tb = sys.exception().__traceback__\n" +" raise OtherException(...).with_traceback(tb)" + +#: ../../builtins/exceptions.rst:143 msgid "" "A writable field that holds the :ref:`traceback object ` " "associated with this exception. See also: :ref:`raise`." @@ -274,7 +289,7 @@ msgstr "" "Um campo gravável que contém o :ref:`objeto traceback ` " "associado a esta exceção. Veja também: :ref:`raise`." -#: ../../library/exceptions.rst:149 +#: ../../builtins/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 " @@ -284,15 +299,17 @@ msgstr "" "padrão após a string de exceção. Uma exceção :exc:`TypeError` é levantada se " "``note`` não for uma string." -#: ../../library/exceptions.rst:157 +#: ../../builtins/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." +"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 "" -"Uma lista das notas desta exceção, que foram adicionadas com :meth:" -"`add_note`. Este atributo é criado quando :meth:`add_note` é chamado." +"Uma lista das notas desta exceção, que foram adicionadas " +"com :meth:`add_note`. Este atributo é criado quando :meth:`add_note` é " +"chamado." -#: ../../library/exceptions.rst:165 +#: ../../builtins/exceptions.rst:165 msgid "" "All built-in, non-system-exiting exceptions are derived from this class. " "All user-defined exceptions should also be derived from this class." @@ -301,17 +318,16 @@ msgstr "" "classe. Todas as exceções definidas pelo usuário também devem ser derivadas " "dessa classe." -#: ../../library/exceptions.rst:171 +#: ../../builtins/exceptions.rst:171 msgid "" "The base class for those built-in exceptions that are raised for various " -"arithmetic errors: :exc:`OverflowError`, :exc:`ZeroDivisionError`, :exc:" -"`FloatingPointError`." +"arithmetic " +"errors: :exc:`OverflowError`, :exc:`ZeroDivisionError`, :exc:`FloatingPointError`." msgstr "" "A classe base para as exceções embutidas levantadas para vários erros " -"aritméticos: :exc:`OverflowError`, :exc:`ZeroDivisionError`, :exc:" -"`FloatingPointError`." +"aritméticos: :exc:`OverflowError`, :exc:`ZeroDivisionError`, :exc:`FloatingPointError`." -#: ../../library/exceptions.rst:178 +#: ../../builtins/exceptions.rst:178 msgid "" "Raised when a :ref:`buffer ` related operation cannot be " "performed." @@ -319,29 +335,30 @@ msgstr "" "Levantado quando uma operação relacionada a :ref:`buffer ` " "não puder ser realizada." -#: ../../library/exceptions.rst:184 +#: ../../builtins/exceptions.rst:184 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`. " "This can be raised directly by :func:`codecs.lookup`." msgstr "" "A classe base para as exceções levantadas quando uma chave ou índice usado " -"em um mapeamento ou sequência é inválido: :exc:`IndexError`, :exc:" -"`KeyError`. Isso pode ser levantado diretamente por :func:`codecs.lookup`." +"em um mapeamento ou sequência é " +"inválido: :exc:`IndexError`, :exc:`KeyError`. Isso pode ser levantado " +"diretamente por :func:`codecs.lookup`." -#: ../../library/exceptions.rst:190 +#: ../../builtins/exceptions.rst:190 msgid "Concrete exceptions" msgstr "Exceções concretas" -#: ../../library/exceptions.rst:192 +#: ../../builtins/exceptions.rst:192 msgid "The following exceptions are the exceptions that are usually raised." -msgstr "As seguintes exceções são as que geralmente são levantados." +msgstr "As seguintes exceções são as que geralmente são levantadas." -#: ../../library/exceptions.rst:198 +#: ../../builtins/exceptions.rst:198 msgid "Raised when an :keyword:`assert` statement fails." msgstr "Levantado quando uma instrução :keyword:`assert` falha." -#: ../../library/exceptions.rst:203 +#: ../../builtins/exceptions.rst:203 msgid "" "Raised when an attribute reference (see :ref:`attribute-references`) or " "assignment fails. (When an object does not support attribute references or " @@ -351,50 +368,55 @@ msgstr "" "references`) ou atribuição falha. (Quando um objeto não oferece suporte a " "referências ou atribuições de atributos, :exc:`TypeError` é levantado.)" -#: ../../library/exceptions.rst:207 +#: ../../builtins/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." +"The optional *name* and *obj* keyword-only arguments set the corresponding " +"attributes:" msgstr "" -"Os atributos :attr:`name` e :attr:`obj` podem ser configurados usando " -"argumentos somente-nomeados para o construtor. Quando configurados, eles " -"representam o nome do atributo que se tentou acessar e do objeto que foi " -"acessado por esse atributo, respectivamente." +"Os argumentos somente-nomeados opcionais *name* e o *obj* definem os " +"atributos correspondente:" -#: ../../library/exceptions.rst:212 +#: ../../builtins/exceptions.rst:212 +msgid "The name of the attribute that was attempted to be accessed." +msgstr "O nome do atributo a que se tentou obter acesso." + +#: ../../builtins/exceptions.rst:216 +msgid "The object that was accessed for the named attribute." +msgstr "O objeto acessado pelo atributo nomeado." + +#: ../../builtins/exceptions.rst:218 msgid "Added the :attr:`name` and :attr:`obj` attributes." msgstr "Adicionado os atributos :attr:`name` e :attr:`obj`." -#: ../../library/exceptions.rst:217 +#: ../../builtins/exceptions.rst:223 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." -"IOBase.readline` methods return an empty string when they hit EOF.)" -msgstr "" -"Levantado quando a função :func:`input` atinge uma condição de fim de " -"arquivo (EOF) sem ler nenhum dado. (Note: os métodos :meth:`io.IOBase.read` " -"e :meth:`io.IOBase.readline` retornam uma string vazia quando pressionam o " +"without reading any data. (Note: the :meth:`io.TextIOBase.read` " +"and :meth:`io.IOBase.readline` methods return an empty string when they hit " "EOF.)" +msgstr "" +"Levantada quando a função :func:`input` atinge uma condição de fim de " +"arquivo (EOF) sem ler nenhum dado. (Note: os " +"métodos :meth:`io.TextIOBase.read` e :meth:`io.IOBase.readline` retornam uma " +"string vazia quando o EOF é atingido.)" -#: ../../library/exceptions.rst:224 +#: ../../builtins/exceptions.rst:230 msgid "Not currently used." msgstr "Não usado atualmente." -#: ../../library/exceptions.rst:229 +#: ../../builtins/exceptions.rst:235 msgid "" -"Raised when a :term:`generator` or :term:`coroutine` is closed; see :meth:" -"`generator.close` and :meth:`coroutine.close`. It directly inherits from :" -"exc:`BaseException` instead of :exc:`Exception` since it is technically not " -"an error." +"Raised when a :term:`generator` or :term:`coroutine` is closed; " +"see :meth:`generator.close` and :meth:`coroutine.close`. It directly " +"inherits from :exc:`BaseException` instead of :exc:`Exception` since it is " +"technically not an error." msgstr "" "Levantado quando um :term:`gerador` ou uma :term:`corrotina` está " "fechado(a); veja :meth:`generator.close` e :meth:`coroutine.close`. Herda " "diretamente de :exc:`BaseException` em vez de :exc:`Exception`, já que " "tecnicamente não é um erro." -#: ../../library/exceptions.rst:237 +#: ../../builtins/exceptions.rst:243 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 " @@ -404,7 +426,7 @@ msgstr "" "carregar um módulo. Também é gerado quando o \"from list\" em ``from ... " "import`` tem um nome que não pode ser encontrado." -#: ../../library/exceptions.rst:241 +#: ../../builtins/exceptions.rst:247 msgid "" "The optional *name* and *path* keyword-only arguments set the corresponding " "attributes:" @@ -412,29 +434,29 @@ msgstr "" "O argumentos somente-nomeados opcionais *name* e o *path* definem o " "atributos correspondente:" -#: ../../library/exceptions.rst:246 +#: ../../builtins/exceptions.rst:252 msgid "The name of the module that was attempted to be imported." msgstr "O nome do módulo que tentou-se fazer a importação." -#: ../../library/exceptions.rst:250 +#: ../../builtins/exceptions.rst:256 msgid "The path to any file which triggered the exception." msgstr "O caminho para qualquer arquivo que acionou a exceção." -#: ../../library/exceptions.rst:252 +#: ../../builtins/exceptions.rst:258 msgid "Added the :attr:`name` and :attr:`path` attributes." msgstr "Adicionados os atributos :attr:`name` e :attr:`path`." -#: ../../library/exceptions.rst:257 +#: ../../builtins/exceptions.rst:263 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 :" -"data:`sys.modules`." +"module could not be located. It is also raised when ``None`` is found " +"in :data:`sys.modules`." msgstr "" "Uma subclasse de :exc:`ImportError` que é levantada por :keyword:`import` " "quando um módulo não pôde ser localizado. Também é levantada quando ``None`` " "é encontrado em :data:`sys.modules`." -#: ../../library/exceptions.rst:266 +#: ../../builtins/exceptions.rst:272 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 " @@ -444,7 +466,7 @@ msgstr "" "(Índices de fatia são truncados silenciosamente para cair num intervalo " "permitido; se um índice não for um inteiro, :exc:`TypeError` é levantada.)" -#: ../../library/exceptions.rst:275 +#: ../../builtins/exceptions.rst:281 msgid "" "Raised when a mapping (dictionary) key is not found in the set of existing " "keys." @@ -452,21 +474,21 @@ msgstr "" "Levantada quando uma chave de mapeamento (dicionário) não é encontrada no " "conjunto de chaves existentes." -#: ../../library/exceptions.rst:282 +#: ../../builtins/exceptions.rst:288 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. " -"The exception inherits from :exc:`BaseException` so as to not be " +"Raised when the user hits the interrupt key (normally :kbd:`Control-C` " +"or :kbd:`Delete`). During execution, a check for interrupts is made " +"regularly. The exception inherits from :exc:`BaseException` so as to not be " "accidentally caught by code that catches :exc:`Exception` and thus prevent " "the interpreter from exiting." msgstr "" -"Levantada quando um usuário aperta a tecla de interrupção (normalmente :kbd:" -"`Control-C` ou :kbd:`Delete`). Durante a execução, uma checagem de " -"interrupção é feita regularmente. A exceção herda de :exc:`BaseException` " -"para que não seja capturada acidentalmente por códigos que tratam :exc:" -"`Exception` e assim evita que o interpretador saia." +"Levantada quando um usuário aperta a tecla de interrupção " +"(normalmente :kbd:`Control-C` ou :kbd:`Delete`). Durante a execução, uma " +"checagem de interrupção é feita regularmente. A exceção herda " +"de :exc:`BaseException` para que não seja capturada acidentalmente por " +"códigos que tratam :exc:`Exception` e assim evita que o interpretador saia." -#: ../../library/exceptions.rst:290 +#: ../../builtins/exceptions.rst:296 msgid "" "Catching a :exc:`KeyboardInterrupt` requires special consideration. Because " "it can be raised at unpredictable points, it may, in some circumstances, " @@ -481,25 +503,27 @@ msgstr "" "rápido possível ou evitar levantá-la de todo. (Veja :ref:`handlers-and-" "exceptions`.)" -#: ../../library/exceptions.rst:300 +#: ../../builtins/exceptions.rst:306 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 " "indicating what kind of (internal) operation ran out of memory. Note that " -"because of the underlying memory management architecture (C's :c:func:" -"`malloc` function), the interpreter may not always be able to completely " -"recover from this situation; it nevertheless raises an exception so that a " -"stack traceback can be printed, in case a run-away program was the cause." +"because of the underlying memory management architecture " +"(C's :c:func:`malloc` function), the interpreter may not always be able to " +"completely recover from this situation; it nevertheless raises an exception " +"so that a stack traceback can be printed, in case a run-away program was the " +"cause." msgstr "" "Levantada quando uma operação fica sem memória mas a situação ainda pode ser " "recuperada (excluindo alguns objetos). O valor associado é uma string que " "indica o tipo de operação (interna) que ficou sem memória. Observe que, por " -"causa da arquitetura de gerenciamento de memória subjacente (função :c:func:" -"`malloc` do C), o interpretador pode não ser capaz de se recuperar " -"completamente da situação; no entanto, levanta uma exceção para que um " -"traceback possa ser impresso, no caso de um outro programa ser a causa." +"causa da arquitetura de gerenciamento de memória subjacente " +"(função :c:func:`malloc` do C), o interpretador pode não ser capaz de se " +"recuperar completamente da situação; no entanto, levanta uma exceção para " +"que um traceback possa ser impresso, no caso de um outro programa ser a " +"causa." -#: ../../library/exceptions.rst:311 +#: ../../builtins/exceptions.rst:317 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 " @@ -509,21 +533,19 @@ msgstr "" "apenas a nomes não qualificados. O valor associado é uma mensagem de erro " "que inclui o nome que não pode ser encontrado." -#: ../../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 "" -"O atributo :attr:`name` pode ser definido usando um argumento somente-" -"nomeado para o construtor. Quando definido, representa o nome da variável " -"que foi tentada ser acessada." +#: ../../builtins/exceptions.rst:321 +msgid "The optional *name* keyword-only argument sets the attribute:" +msgstr "O argumento somente-nomeado opcional *name* define o atributo:" + +#: ../../builtins/exceptions.rst:325 +msgid "The name of the variable that was attempted to be accessed." +msgstr "O nome do variável que tentou-se fazer o acesso." -#: ../../library/exceptions.rst:319 +#: ../../builtins/exceptions.rst:327 msgid "Added the :attr:`name` attribute." msgstr "Adicionado o atributo :attr:`name`." -#: ../../library/exceptions.rst:325 +#: ../../builtins/exceptions.rst:333 msgid "" "This exception is derived from :exc:`RuntimeError`. In user defined base " "classes, abstract methods should raise this exception when they require " @@ -536,7 +558,7 @@ msgstr "" "desenvolvida, para indicar que a implementação real ainda precisa ser " "adicionada." -#: ../../library/exceptions.rst:332 +#: ../../builtins/exceptions.rst:340 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 " @@ -546,34 +568,36 @@ msgstr "" "suportado -- nesse caso deixe o operador / método indefinido ou, se é uma " "subclasse, defina-o como :data:`None`." -#: ../../library/exceptions.rst:338 +#: ../../builtins/exceptions.rst:346 msgid "" -"``NotImplementedError`` and :data:`NotImplemented` are not interchangeable, " -"even though they have similar names and purposes. See :data:`!" -"NotImplemented` for details on when to use it." +":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." msgstr "" -"``NotImplementedError`` e :data:`NotImplemented` não são intercambiáveis, " -"mesmo que tenham nomes e propósitos similares. Veja :data:`!NotImplemented` " -"para detalhes e casos de uso." +":exc:`!NotImplementedError` e :data:`!NotImplemented` não são " +"intercambiáveis. Esta exceção deve ser usada somente conforme descrito " +"acima; veja :data:`NotImplemented` para detalhes sobre o uso correto da " +"constante embutida." -#: ../../library/exceptions.rst:347 +#: ../../builtins/exceptions.rst:357 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 " -"full\" (not for illegal argument types or other incidental errors)." +"error, including I/O failures such as \"file not found\" or \"disk full\" " +"(not for illegal argument types or other incidental errors)." msgstr "" "Esta exceção é levantada quando uma função do sistema retorna um erro " "relacionado ao sistema, incluindo falhas do tipo E/S como \"file not found\" " "ou \"disk full\" (não para tipos de argumentos não permitidos ou outro erro " "acessório)." -#: ../../library/exceptions.rst:351 +#: ../../builtins/exceptions.rst:361 msgid "" "The second form of the constructor sets the corresponding attributes, " "described below. The attributes default to :const:`None` if not specified. " -"For backwards compatibility, if three arguments are passed, the :attr:" -"`~BaseException.args` attribute contains only a 2-tuple of the first two " -"constructor arguments." +"For backwards compatibility, if three arguments are passed, " +"the :attr:`~BaseException.args` attribute contains only a 2-tuple of the " +"first two constructor arguments." msgstr "" "A segunda forma do construtor definir os atributos correspondentes, " "descritos abaixo. Os atributos usarão o valor padrão :const:`None` se não " @@ -581,13 +605,13 @@ msgstr "" "argumentos são passados, o atributo :attr:`~BaseException.args` contêm " "somente uma tupla de 2 elementos, os dois primeiros argumentos do construtor." -#: ../../library/exceptions.rst:357 +#: ../../builtins/exceptions.rst:367 msgid "" "The constructor often actually returns a subclass of :exc:`OSError`, as " "described in `OS exceptions`_ below. The particular subclass depends on the " -"final :attr:`.errno` value. This behaviour only occurs when constructing :" -"exc:`OSError` directly or via an alias, and is not inherited when " -"subclassing." +"final :attr:`.errno` value. This behaviour only occurs when " +"constructing :exc:`OSError` directly or via an alias, and is not inherited " +"when subclassing." msgstr "" "O construtor geralmente retorna uma subclasse de :exc:`OSError`, como " "descrito abaixo em `OS exceptions`_ . A subclasse particular depende do " @@ -595,96 +619,96 @@ msgstr "" "construção direta ou por meio de um apelido de :exc:`OSError`, e não é " "herdado na criação de subclasses." -#: ../../library/exceptions.rst:365 +#: ../../builtins/exceptions.rst:375 msgid "A numeric error code from the C variable :c:data:`errno`." msgstr "Um código de erro numérico da variável C :c:data:`errno`." -#: ../../library/exceptions.rst:369 +#: ../../builtins/exceptions.rst:379 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 " -"native error code." +"Under Windows, this gives you the native Windows error code. " +"The :attr:`.errno` attribute is then an approximate translation, in POSIX " +"terms, of that native error code." msgstr "" -"No Windows, isso fornece o código de erro nativo do Windows. O atributo :" -"attr:`.errno` é então uma tradução aproximada, em termos POSIX, desse código " -"de erro nativo." +"No Windows, isso fornece o código de erro nativo do Windows. O " +"atributo :attr:`.errno` é então uma tradução aproximada, em termos POSIX, " +"desse código de erro nativo." -#: ../../library/exceptions.rst:373 +#: ../../builtins/exceptions.rst:383 msgid "" -"Under Windows, if the *winerror* constructor argument is an integer, the :" -"attr:`.errno` attribute is determined from the Windows error code, and the " -"*errno* argument is ignored. On other platforms, the *winerror* argument is " -"ignored, and the :attr:`winerror` attribute does not exist." +"Under Windows, if the *winerror* constructor argument is an integer, " +"the :attr:`.errno` attribute is determined from the Windows error code, and " +"the *errno* argument is ignored. On other platforms, the *winerror* " +"argument is ignored, and the :attr:`winerror` attribute does not exist." msgstr "" "No Windows, se o argumento de construtor *winerror* for um inteiro, o " "atributo :attr:`.errno` é determinado a partir do código de erro do Windows " "e o argumento *errno* é ignorado. Em outras plataformas, o argumento " "*winerror* é ignorado e o atributo :attr:`winerror` não existe." -#: ../../library/exceptions.rst:381 +#: ../../builtins/exceptions.rst:391 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:" -"`FormatMessage` under Windows." +"formatted by the C functions :c:func:`!perror` under POSIX, and :c:func:`!" +"FormatMessage` under Windows." msgstr "" "A mensagem de erro correspondente, conforme fornecida pelo sistema " -"operacional. É formatada pelas funções C :c:func:`perror` no POSIX e :c:func:" -"`FormatMessage` no Windows." +"operacional. É formatada pelas funções C :c:func:`!perror` no POSIX " +"e :c:func:`!FormatMessage` no Windows." -#: ../../library/exceptions.rst:389 +#: ../../builtins/exceptions.rst:399 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. " -"For functions that involve two file system paths (such as :func:`os." -"rename`), :attr:`filename2` corresponds to the second file name passed to " -"the function." +"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. For functions that involve two file system paths (such " +"as :func:`os.rename`), :attr:`filename2` corresponds to the second file name " +"passed to the function." msgstr "" -"Para exceções que envolvem um caminho do sistema de arquivos (como :func:" -"`open` ou :func:`os.unlink`), :attr:`filename` é o nome do arquivo passado " -"para a função. Para funções que envolvem dois caminhos de sistema de " -"arquivos (como :func:`os.rename`), :attr:`filename2` corresponde ao segundo " -"nome de arquivo passado para a função." +"Para exceções que envolvem um caminho do sistema de arquivos " +"(como :func:`open` ou :func:`os.unlink`), :attr:`filename` é o nome do " +"arquivo passado para a função. Para funções que envolvem dois caminhos de " +"sistema de arquivos (como :func:`os.rename`), :attr:`filename2` corresponde " +"ao segundo nome de arquivo passado para a função." -#: ../../library/exceptions.rst:396 +#: ../../builtins/exceptions.rst:406 msgid "" -":exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`, :exc:`socket." -"error`, :exc:`select.error` and :exc:`mmap.error` have been merged into :exc:" -"`OSError`, and the constructor may return a subclass." +":exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`, :exc:`socket.error`, :exc:`select.error` " +"and :exc:`!mmap.error` have been merged into :exc:`OSError`, and the " +"constructor may return a subclass." msgstr "" -":exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`, :exc:`socket." -"error`, :exc:`select.error` e :exc:`mmap.error` foram fundidos em :exc:" -"`OSError`, e o construtor pode retornar uma subclasse." +":exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`, :exc:`socket.error`, :exc:`select.error` " +"e :exc:`!mmap.error` foram fundidos em :exc:`OSError`, e o construtor pode " +"retornar uma subclasse." -#: ../../library/exceptions.rst:402 +#: ../../builtins/exceptions.rst:412 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 :term:`filesystem encoding and error handler`. Also, the *filename2* " +"constructor argument and attribute was added." msgstr "" "O atributo :attr:`filename` agora é o nome do arquivo original passado para " "a função, ao invés do nome codificado ou decodificado da :term:`tratador de " "erros e codificação do sistema de arquivos`. Além disso, o argumento e o " "atributo de construtor *filename2* foi adicionado." -#: ../../library/exceptions.rst:411 +#: ../../builtins/exceptions.rst:421 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." +"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." msgstr "" "Levantada quando o resultado de uma operação aritmética é muito grande para " -"ser representada. Isso não pode ocorrer para inteiros (que prefere levantar :" -"exc:`MemoryError` a desistir). No entanto, por motivos históricos, " +"ser representada. Isso não pode ocorrer para inteiros (que prefere " +"levantar :exc:`MemoryError` a desistir). No entanto, por motivos históricos, " "OverflowError às vezes é levantada para inteiros que estão fora de um " "intervalo obrigatório. Devido à falta de padronização do tratamento de " "exceção de ponto flutuante em C, a maioria das operações de ponto flutuante " "não são verificadas." -#: ../../library/exceptions.rst:421 +#: ../../builtins/exceptions.rst:431 msgid "" "This exception is derived from :exc:`RuntimeError`. It is raised when an " "operation is blocked during interpreter shutdown also known as :term:`Python " @@ -694,45 +718,45 @@ msgstr "" "operação é bloqueada durante o encerramento do interpretador e também " "conhecido como :term:`finalização do Python `." -#: ../../library/exceptions.rst:425 +#: ../../builtins/exceptions.rst:435 msgid "" -"Examples of operations which can be blocked with a :exc:" -"`PythonFinalizationError` during the Python finalization:" +"Examples of operations which can be blocked with " +"a :exc:`PythonFinalizationError` during the Python finalization:" msgstr "" -"Exemplos de operações que podem ser bloqueadas com um :exc:" -"`PythonFinalizationError` durante a finalização do Python:" +"Exemplos de operações que podem ser bloqueadas com " +"um :exc:`PythonFinalizationError` durante a finalização do Python:" -#: ../../library/exceptions.rst:428 +#: ../../builtins/exceptions.rst:438 msgid "Creating a new Python thread." msgstr "Criação de uma nova thread no Python." -#: ../../library/exceptions.rst:429 +#: ../../builtins/exceptions.rst:439 msgid ":func:`os.fork`." msgstr ":func:`os.fork`." -#: ../../library/exceptions.rst:431 +#: ../../builtins/exceptions.rst:441 msgid "See also the :func:`sys.is_finalizing` function." msgstr "Veja também a função :func:`sys.is_finalizing`." -#: ../../library/exceptions.rst:433 ../../library/exceptions.rst:443 +#: ../../builtins/exceptions.rst:443 ../../builtins/exceptions.rst:453 msgid "Previously, a plain :exc:`RuntimeError` was raised." msgstr "Anteriormente, uma :exc:`RuntimeError` simples era levantada." -#: ../../library/exceptions.rst:439 +#: ../../builtins/exceptions.rst:449 msgid "" "This exception is derived from :exc:`RuntimeError`. It is raised when the " -"interpreter detects that the maximum recursion depth (see :func:`sys." -"getrecursionlimit`) is exceeded." +"interpreter detects that the maximum recursion depth " +"(see :func:`sys.getrecursionlimit`) is exceeded." msgstr "" "Esta exceção é derivada de :exc:`RuntimeError`. É levantada quando o " -"interpretador detecta que a profundidade máxima de recursão (veja :func:`sys." -"getrecursionlimit`) foi excedida." +"interpretador detecta que a profundidade máxima de recursão " +"(veja :func:`sys.getrecursionlimit`) foi excedida." -#: ../../library/exceptions.rst:449 +#: ../../builtins/exceptions.rst:459 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 " -"after it has been garbage collected. For more information on weak " +"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 after it has been garbage collected. For more information on weak " "references, see the :mod:`weakref` module." msgstr "" "Esta exceção é levantada quando um intermediário de referência fraca, criado " @@ -740,7 +764,7 @@ msgstr "" "referente após ter sido coletado como lixo. Para mais informações sobre " "referências fracas, veja o módulo :mod:`weakref`." -#: ../../library/exceptions.rst:457 +#: ../../builtins/exceptions.rst:467 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 " @@ -750,37 +774,38 @@ msgstr "" "categorias. O valor associado é uma string indicando o que precisamente deu " "errado." -#: ../../library/exceptions.rst:464 +#: ../../builtins/exceptions.rst:474 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 " -"produced by the iterator." +"Raised by built-in function :func:`next` and " +"an :term:`iterator`\\'s :meth:`~iterator.__next__` method to signal that " +"there are no further items produced by the iterator." msgstr "" -"Levantada pela função embutida :func:`next` e o método :meth:`~iterator." -"__next__` de um :term:`iterador` para sinalizar que não há mais itens " -"produzidos pelo iterador." +"Levantada pela função embutida :func:`next` e o " +"método :meth:`~iterator.__next__` de um :term:`iterador` para sinalizar que " +"não há mais itens produzidos pelo iterador." -#: ../../library/exceptions.rst:470 +#: ../../builtins/exceptions.rst:480 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`." +"as an argument when constructing the exception, and defaults " +"to :const:`None`." msgstr "" "O objeto exceção tem um único atributo :attr:`!value`, que é fornecido como " "um argumento ao construir a exceção, e o padrão é :const:`None`." -#: ../../library/exceptions.rst:474 +#: ../../builtins/exceptions.rst:484 msgid "" -"When a :term:`generator` or :term:`coroutine` function returns, a new :exc:" -"`StopIteration` instance is raised, and the value returned by the function " -"is used as the :attr:`value` parameter to the constructor of the exception." +"When a :term:`generator` or :term:`coroutine` function returns, a " +"new :exc:`StopIteration` instance is raised, and the value returned by the " +"function is used as the :attr:`value` parameter to the constructor of the " +"exception." msgstr "" "Quando uma função :term:`geradora ` ou :term:`corrotina` retorna, " "uma nova instância :exc:`StopIteration` é levantada, e o valor retornado " "pela função é usado como o parâmetro :attr:`value` para o construtor da " "exceção." -#: ../../library/exceptions.rst:479 +#: ../../builtins/exceptions.rst:489 msgid "" "If a generator code directly or indirectly raises :exc:`StopIteration`, it " "is converted into a :exc:`RuntimeError` (retaining the :exc:`StopIteration` " @@ -790,7 +815,7 @@ msgstr "" "ele é convertido em uma :exc:`RuntimeError` (mantendo o :exc:`StopIteration` " "como a nova causa da exceção)." -#: ../../library/exceptions.rst:483 +#: ../../builtins/exceptions.rst:493 msgid "" "Added ``value`` attribute and the ability for generator functions to use it " "to return a value." @@ -798,7 +823,7 @@ msgstr "" "Adicionado o atributo ``value`` e a capacidade das funções geradoras de usá-" "lo para retornar um valor." -#: ../../library/exceptions.rst:487 +#: ../../builtins/exceptions.rst:497 msgid "" "Introduced the RuntimeError transformation via ``from __future__ import " "generator_stop``, see :pep:`479`." @@ -806,36 +831,36 @@ msgstr "" "Introduzida a transformação RuntimeError via ``from __future__ import " "generator_stop``, consulte :pep:`479`." -#: ../../library/exceptions.rst:491 +#: ../../builtins/exceptions.rst:501 msgid "" "Enable :pep:`479` for all code by default: a :exc:`StopIteration` error " "raised in a generator is transformed into a :exc:`RuntimeError`." msgstr "" -"Habilita :pep:`479` para todo o código por padrão: um erro :exc:" -"`StopIteration` levantado em um gerador é transformado em uma :exc:" -"`RuntimeError`." +"Habilita :pep:`479` para todo o código por padrão: um " +"erro :exc:`StopIteration` levantado em um gerador é transformado em " +"uma :exc:`RuntimeError`." -#: ../../library/exceptions.rst:497 +#: ../../builtins/exceptions.rst:507 msgid "" "Must be raised by :meth:`~object.__anext__` method of an :term:`asynchronous " "iterator` object to stop the iteration." msgstr "" -"Deve ser levantada pelo método :meth:`~object.__anext__` de um objeto :term:" -"`iterador assíncrono` para parar a iteração." +"Deve ser levantada pelo método :meth:`~object.__anext__` de um " +"objeto :term:`iterador assíncrono` para parar a iteração." -#: ../../library/exceptions.rst:504 +#: ../../builtins/exceptions.rst:514 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:" -"`compile`, :func:`exec`, or :func:`eval`, or when reading the initial script " -"or standard input (also interactively)." +"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:`compile`, :func:`exec`, or :func:`eval`, or when reading " +"the initial script or standard input (also interactively)." msgstr "" "Levantada quando o analisador encontra um erro de sintaxe. Isso pode ocorrer " -"em uma instrução :keyword:`import`, em uma chamada às funções embutidas :" -"func:`compile`, :func:`exec` ou :func:`eval`, ou ao ler o script inicial ou " -"entrada padrão (também interativamente)." +"em uma instrução :keyword:`import`, em uma chamada às funções " +"embutidas :func:`compile`, :func:`exec` ou :func:`eval`, ou ao ler o script " +"inicial ou entrada padrão (também interativamente)." -#: ../../library/exceptions.rst:510 +#: ../../builtins/exceptions.rst:520 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." @@ -844,11 +869,11 @@ msgstr "" "erro. Detalhes é uma tupla cujos membros também estão disponíveis como " "atributos separados." -#: ../../library/exceptions.rst:515 +#: ../../builtins/exceptions.rst:525 msgid "The name of the file the syntax error occurred in." msgstr "O nome do arquivo em que ocorreu o erro de sintaxe." -#: ../../library/exceptions.rst:519 +#: ../../builtins/exceptions.rst:529 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." @@ -856,7 +881,7 @@ msgstr "" "Em qual número de linha no arquivo o erro ocorreu. Este é indexado em 1: a " "primeira linha no arquivo tem um ``lineno`` de 1." -#: ../../library/exceptions.rst:524 +#: ../../builtins/exceptions.rst:534 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." @@ -864,11 +889,11 @@ msgstr "" "A coluna da linha em que ocorreu o erro. Este é indexado em 1: o primeiro " "caractere na linha tem um ``offset`` de 1." -#: ../../library/exceptions.rst:529 +#: ../../builtins/exceptions.rst:539 msgid "The source code text involved in the error." msgstr "O texto do código-fonte envolvido no erro." -#: ../../library/exceptions.rst:533 +#: ../../builtins/exceptions.rst:543 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." @@ -876,15 +901,15 @@ msgstr "" "Em qual número de linha no arquivo o erro ocorrido termina. Este é indexado " "em 1: a primeira linha no arquivo tem um ``lineno`` de 1." -#: ../../library/exceptions.rst:538 +#: ../../builtins/exceptions.rst:548 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 "" -"A coluna da linha final em que erro ocorrido finaliza Este é indexado em 1: " +"A coluna da linha final em que o erro ocorreu termina. Este é indexado em 1: " "o primeiro caractere na linha tem um ``offset`` de 1." -#: ../../library/exceptions.rst:541 +#: ../../builtins/exceptions.rst:551 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 " @@ -894,14 +919,14 @@ msgstr "" "Para erros em campos de f-string, a mensagem é prefixada por \"f-string: \" " "e os \"offsets\" são deslocamentos em um texto construído a partir da " "expressão de substituição. Por exemplo, compilar o campo f'Bad {a b}' " -"resulta neste atributo de argumentos: ('f-string: ...', ('', 1, 2, '(a " -"b)\\n', 1, 5))." +"resulta neste atributo de argumentos: ('f-string: ...', ('', 1, 2, '(a b)" +"\\n', 1, 5))." -#: ../../library/exceptions.rst:546 +#: ../../builtins/exceptions.rst:556 msgid "Added the :attr:`end_lineno` and :attr:`end_offset` attributes." -msgstr "Adicionado os atributos :attr:`end_lineno` e :attr:`end_offset`." +msgstr "Adicionados os atributos :attr:`end_lineno` e :attr:`end_offset`." -#: ../../library/exceptions.rst:551 +#: ../../builtins/exceptions.rst:561 msgid "" "Base class for syntax errors related to incorrect indentation. This is a " "subclass of :exc:`SyntaxError`." @@ -909,7 +934,7 @@ msgstr "" "Classe base para erros de sintaxe relacionados a indentação incorreta. Esta " "é uma subclasse de :exc:`SyntaxError`." -#: ../../library/exceptions.rst:557 +#: ../../builtins/exceptions.rst:567 msgid "" "Raised when indentation contains an inconsistent use of tabs and spaces. " "This is a subclass of :exc:`IndentationError`." @@ -917,56 +942,63 @@ msgstr "" "Levantada quando o indentação contém um uso inconsistente de tabulações e " "espaços. Esta é uma subclasse de :exc:`IndentationError`." -#: ../../library/exceptions.rst:563 +#: ../../builtins/exceptions.rst:573 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)." +"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." msgstr "" "Levantada quando o interpretador encontra um erro interno, mas a situação " "não parece tão grave para fazer com que perca todas as esperanças. O valor " "associado é uma string que indica o que deu errado (em termos de baixo " -"nível)." +"nível). Em :term:`CPython`, isso pode ser causado pelo uso incorreto da API " +"C do Python, como retornar um valor ``NULL`` sem um conjunto de exceções." -#: ../../library/exceptions.rst:567 +#: ../../builtins/exceptions.rst:579 msgid "" -"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." +"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." msgstr "" -"Você deve relatar isso ao autor ou mantenedor do seu interpretador Python. " -"Certifique-se de relatar a versão do interpretador Python (``sys.version``; " -"também é impresso no início de uma sessão Python interativa), a mensagem de " -"erro exata (o valor associado da exceção) e se possível a fonte do programa " -"que acionou o erro." +"Se você tem certeza de que essa exceção não foi culpa sua ou de um pacote " +"que você está usando, você deve relatar isso ao autor ou mantenedor do seu " +"interpretador Python. Certifique-se de relatar a versão do interpretador " +"Python (``sys.version``; também é impresso no início de uma sessão Python " +"interativa), a mensagem de erro exata (o valor associado da exceção) e se " +"possível a fonte do programa que acionou o erro." -#: ../../library/exceptions.rst:576 +#: ../../builtins/exceptions.rst:590 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 " "accidentally caught by code that catches :exc:`Exception`. This allows the " "exception to properly propagate up and cause the interpreter to exit. When " "it is not handled, the Python interpreter exits; no stack traceback is " -"printed. The constructor accepts the same optional argument passed to :func:" -"`sys.exit`. If the value is an integer, it specifies the system exit status " -"(passed to C's :c:func:`exit` function); if it is ``None``, the exit status " -"is zero; if it has another type (such as a string), the object's value is " -"printed and the exit status is one." -msgstr "" -"Esta exceção é levantada pela função :func:`sys.exit`. Ele herda de :exc:" -"`BaseException` em vez de :exc:`Exception` para que não seja acidentalmente " -"capturado pelo código que captura :exc:`Exception`. Isso permite que a " -"exceção se propague corretamente e faça com que o interpretador saia. Quando " -"não é tratado, o interpretador Python sai; nenhum traceback (situação da " -"pilha de execução) é impresso. O construtor aceita o mesmo argumento " -"opcional passado para :func:`sys.exit`. Se o valor for um inteiro, ele " -"especifica o status de saída do sistema (passado para a função C :c:func:" -"`exit`); se for ``None``, o status de saída é zero; se tiver outro tipo " -"(como uma string), o valor do objeto é exibido e o status de saída é um." - -#: ../../library/exceptions.rst:587 +"printed. The constructor accepts the same optional argument passed " +"to :func:`sys.exit`. If the value is an integer, it specifies the system " +"exit status (passed to C's :c:func:`!exit` function); if it is ``None``, the " +"exit status is zero; if it has another type (such as a string), the object's " +"value is printed and the exit status is one." +msgstr "" +"Esta exceção é levantada pela função :func:`sys.exit`. Ele herda " +"de :exc:`BaseException` em vez de :exc:`Exception` para que não seja " +"acidentalmente capturado pelo código que captura :exc:`Exception`. Isso " +"permite que a exceção se propague corretamente e faça com que o " +"interpretador saia. Quando não é tratado, o interpretador Python sai; nenhum " +"traceback (situação da pilha de execução) é impresso. O construtor aceita o " +"mesmo argumento opcional passado para :func:`sys.exit`. Se o valor for um " +"inteiro, ele especifica o status de saída do sistema (passado para a função " +"C :c:func:`!exit`); se for ``None``, o status de saída é zero; se tiver " +"outro tipo (como uma string), o valor do objeto é exibido e o status de " +"saída é um." + +#: ../../builtins/exceptions.rst:601 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 " @@ -976,13 +1008,14 @@ msgid "" "child process after a call to :func:`os.fork`)." msgstr "" "Uma chamada para :func:`sys.exit` é traduzida em uma exceção para que os " -"tratadores de limpeza (cláusulas :keyword:`finally` das instruções :keyword:" -"`try`) possam ser executados, e para que um depurador possa executar um " -"script sem correr o risco de perder o controle. A função :func:`os._exit` " -"pode ser usada se for absolutamente necessário sair imediatamente (por " -"exemplo, no processo filho após uma chamada para :func:`os.fork`)." +"tratadores de limpeza (cláusulas :keyword:`finally` das " +"instruções :keyword:`try`) possam ser executados, e para que um depurador " +"possa executar um script sem correr o risco de perder o controle. A " +"função :func:`os._exit` pode ser usada se for absolutamente necessário sair " +"imediatamente (por exemplo, no processo filho após uma chamada " +"para :func:`os.fork`)." -#: ../../library/exceptions.rst:596 +#: ../../builtins/exceptions.rst:610 msgid "" "The exit status or error message that is passed to the constructor. " "(Defaults to ``None``.)" @@ -990,7 +1023,7 @@ msgstr "" "O status de saída ou mensagem de erro transmitida ao construtor. (O padrão é " "``None``.)" -#: ../../library/exceptions.rst:602 +#: ../../builtins/exceptions.rst:616 msgid "" "Raised when an operation or function is applied to an object of " "inappropriate type. The associated value is a string giving details about " @@ -1000,7 +1033,7 @@ msgstr "" "inadequado. O valor associado é uma string que fornece detalhes sobre a " "incompatibilidade de tipo." -#: ../../library/exceptions.rst:605 +#: ../../builtins/exceptions.rst:619 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 " @@ -1013,29 +1046,29 @@ msgstr "" "implementação, :exc:`NotImplementedError` é a exceção apropriada a ser " "levantada." -#: ../../library/exceptions.rst:610 +#: ../../builtins/exceptions.rst:624 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 " -"arguments with the wrong value (e.g. a number outside expected boundaries) " -"should result in a :exc:`ValueError`." +"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 arguments with the wrong value (e.g. a number outside expected " +"boundaries) should result in a :exc:`ValueError`." msgstr "" "Passar argumentos do tipo errado (por exemplo, passar uma :class:`list` " "quando um :class:`int` é esperado) deve resultar em uma :exc:`TypeError`, " -"mas passar argumentos com o valor errado (por exemplo, um número fora " +"mas passar argumentos com o valor errado (por exemplo, um número fora dos " "limites esperados) deve resultar em uma :exc:`ValueError`." -#: ../../library/exceptions.rst:617 +#: ../../builtins/exceptions.rst:631 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:" -"`NameError`." +"but no value has been bound to that variable. This is a subclass " +"of :exc:`NameError`." msgstr "" "Levantada quando uma referência é feita a uma variável local em uma função " "ou método, mas nenhum valor foi vinculado a essa variável. Esta é uma " "subclasse de :exc:`NameError`." -#: ../../library/exceptions.rst:624 +#: ../../builtins/exceptions.rst:638 msgid "" "Raised when a Unicode-related encoding or decoding error occurs. It is a " "subclass of :exc:`ValueError`." @@ -1043,7 +1076,7 @@ msgstr "" "Levantada quando ocorre um erro de codificação ou decodificação relacionado " "ao Unicode. É uma subclasse de :exc:`ValueError`." -#: ../../library/exceptions.rst:627 +#: ../../builtins/exceptions.rst:641 msgid "" ":exc:`UnicodeError` has attributes that describe the encoding or decoding " "error. For example, ``err.object[err.start:err.end]`` gives the particular " @@ -1053,27 +1086,27 @@ msgstr "" "decodificação. Por exemplo, ``err.object[err.start:err.end]`` fornece a " "entrada inválida específica na qual o codec falhou." -#: ../../library/exceptions.rst:633 +#: ../../builtins/exceptions.rst:647 msgid "The name of the encoding that raised the error." msgstr "O nome da codificação que levantou o erro." -#: ../../library/exceptions.rst:637 +#: ../../builtins/exceptions.rst:651 msgid "A string describing the specific codec error." msgstr "Uma string que descreve o erro de codec específico." -#: ../../library/exceptions.rst:641 +#: ../../builtins/exceptions.rst:655 msgid "The object the codec was attempting to encode or decode." msgstr "O objeto que o codec estava tentando codificar ou decodificar." -#: ../../library/exceptions.rst:645 +#: ../../builtins/exceptions.rst:659 msgid "The first index of invalid data in :attr:`object`." msgstr "O primeiro índice de dados inválidos em :attr:`object`." -#: ../../library/exceptions.rst:649 +#: ../../builtins/exceptions.rst:663 msgid "The index after the last invalid data in :attr:`object`." msgstr "O índice após os últimos dados inválidos em :attr:`object`." -#: ../../library/exceptions.rst:654 +#: ../../builtins/exceptions.rst:668 msgid "" "Raised when a Unicode-related error occurs during encoding. It is a " "subclass of :exc:`UnicodeError`." @@ -1081,7 +1114,7 @@ msgstr "" "Levantada quando ocorre um erro relacionado ao Unicode durante a " "codificação. É uma subclasse de :exc:`UnicodeError`." -#: ../../library/exceptions.rst:660 +#: ../../builtins/exceptions.rst:674 msgid "" "Raised when a Unicode-related error occurs during decoding. It is a " "subclass of :exc:`UnicodeError`." @@ -1089,7 +1122,7 @@ msgstr "" "Levantada quando ocorre um erro relacionado ao Unicode durante a " "decodificação. É uma subclasse de :exc:`UnicodeError`." -#: ../../library/exceptions.rst:666 +#: ../../builtins/exceptions.rst:680 msgid "" "Raised when a Unicode-related error occurs during translating. It is a " "subclass of :exc:`UnicodeError`." @@ -1097,7 +1130,7 @@ msgstr "" "Levantada quando ocorre um erro relacionado ao Unicode durante a tradução. É " "uma subclasse de :exc:`UnicodeError`." -#: ../../library/exceptions.rst:672 +#: ../../builtins/exceptions.rst:686 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 " @@ -1107,7 +1140,7 @@ msgstr "" "certo, mas um valor inadequado, e a situação não é descrita por uma exceção " "mais precisa, como :exc:`IndexError`." -#: ../../library/exceptions.rst:679 +#: ../../builtins/exceptions.rst:693 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 " @@ -1117,7 +1150,7 @@ msgstr "" "zero. O valor associado é uma string que indica o tipo dos operandos e a " "operação." -#: ../../library/exceptions.rst:684 +#: ../../builtins/exceptions.rst:698 msgid "" "The following exceptions are kept for compatibility with previous versions; " "starting from Python 3.3, they are aliases of :exc:`OSError`." @@ -1125,15 +1158,15 @@ msgstr "" "As seguintes exceções são mantidas para compatibilidade com versões " "anteriores; a partir do Python 3.3, eles são apelidos de :exc:`OSError`." -#: ../../library/exceptions.rst:693 +#: ../../builtins/exceptions.rst:707 msgid "Only available on Windows." msgstr "Disponível apenas no Windows." -#: ../../library/exceptions.rst:697 +#: ../../builtins/exceptions.rst:711 msgid "OS exceptions" msgstr "Exceções de sistema operacional" -#: ../../library/exceptions.rst:699 +#: ../../builtins/exceptions.rst:713 msgid "" "The following exceptions are subclasses of :exc:`OSError`, they get raised " "depending on the system error code." @@ -1141,19 +1174,19 @@ msgstr "" "As seguintes exceções são subclasses de :exc:`OSError`, elas são levantadas " "dependendo do código de erro do sistema." -#: ../../library/exceptions.rst:704 +#: ../../builtins/exceptions.rst:718 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` :py:const:`~errno.EAGAIN`, :py:const:`~errno.EALREADY`, :py:const:`~errno.EWOULDBLOCK` " +"and :py:const:`~errno.EINPROGRESS`." msgstr "" -"Levantada quando uma operação bloquearia em um objeto (por exemplo, soquete) " -"definido para operação sem bloqueio. Corresponde a :c:data:`errno` :py:const:" -"`~errno.EAGAIN`, :py:const:`~errno.EALREADY`, :py:const:`~errno.EWOULDBLOCK` " +"Levantada quando uma operação bloquearia em um objeto (por exemplo, um " +"soquete) definido para operação sem bloqueio. Corresponde " +"a :c:data:`errno` :py:const:`~errno.EAGAIN`, :py:const:`~errno.EALREADY`, :py:const:`~errno.EWOULDBLOCK` " "e :py:const:`~errno.EINPROGRESS`." -#: ../../library/exceptions.rst:709 +#: ../../builtins/exceptions.rst:723 msgid "" "In addition to those of :exc:`OSError`, :exc:`BlockingIOError` can have one " "more attribute:" @@ -1161,78 +1194,80 @@ msgstr "" "Além daquelas de :exc:`OSError`, :exc:`BlockingIOError` pode ter mais um " "atributo:" -#: ../../library/exceptions.rst:714 +#: ../../builtins/exceptions.rst:728 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 " +"An integer containing the number of **bytes** written to the stream before " +"it blocked. This attribute is available when using the buffered I/O classes " "from the :mod:`io` module." msgstr "" -"Um inteiro contendo o número de caracteres gravados no fluxo antes de ser " +"Um inteiro contendo o número de **bytes** gravados no fluxo antes de ser " "bloqueado. Este atributo está disponível ao usar as classes de E/S em buffer " "do módulo :mod:`io`." -#: ../../library/exceptions.rst:720 +#: ../../builtins/exceptions.rst:734 msgid "" -"Raised when an operation on a child process failed. Corresponds to :c:data:" -"`errno` :py:const:`~errno.ECHILD`." +"Raised when an operation on a child process failed. Corresponds " +"to :c:data:`errno` :py:const:`~errno.ECHILD`." msgstr "" -"Levantada quando uma operação em um processo filho falha. Corresponde a :c:" -"data:`errno` :py:const:`~errno.ECHILD`." +"Levantada quando uma operação em um processo filho falha. Corresponde " +"a :c:data:`errno` :py:const:`~errno.ECHILD`." -#: ../../library/exceptions.rst:725 +#: ../../builtins/exceptions.rst:739 msgid "A base class for connection-related issues." msgstr "Uma classe base para problemas relacionados à conexão." -#: ../../library/exceptions.rst:727 +#: ../../builtins/exceptions.rst:741 msgid "" -"Subclasses are :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`, :exc:" -"`ConnectionRefusedError` and :exc:`ConnectionResetError`." +"Subclasses " +"are :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`, :exc:`ConnectionRefusedError` " +"and :exc:`ConnectionResetError`." msgstr "" -"Suas subclasses são :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`, :" -"exc:`ConnectionRefusedError` e :exc:`ConnectionResetError`." +"Suas subclasses " +"são :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`, :exc:`ConnectionRefusedError` " +"e :exc:`ConnectionResetError`." -#: ../../library/exceptions.rst:732 +#: ../../builtins/exceptions.rst:746 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` :py:const:`~errno.EPIPE` and :py:const:`~errno.ESHUTDOWN`." msgstr "" "Uma subclasse de :exc:`ConnectionError`, levantada ao tentar escrever em um " "encadeamento, enquanto a outra extremidade foi fechada, ou ao tentar " -"escrever em um soquete que foi desligado para escrita. Corresponde a :c:" -"data:`errno` :py:const:`~errno.EPIPE` e :py:const:`~errno.ESHUTDOWN`." +"escrever em um soquete que foi desligado para escrita. Corresponde " +"a :c:data:`errno` :py:const:`~errno.EPIPE` e :py:const:`~errno.ESHUTDOWN`." -#: ../../library/exceptions.rst:739 +#: ../../builtins/exceptions.rst:753 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` :py:const:`~errno.ECONNABORTED`." msgstr "" "Uma subclasse de :exc:`ConnectionError`, levantada quando uma tentativa de " -"conexão é cancelada pelo par. Corresponde a :c:data:`errno` :py:const:" -"`~errno.ECONNABORTED`." +"conexão é cancelada pelo par. Corresponde " +"a :c:data:`errno` :py:const:`~errno.ECONNABORTED`." -#: ../../library/exceptions.rst:745 +#: ../../builtins/exceptions.rst:759 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` :py:const:`~errno.ECONNREFUSED`." msgstr "" "Uma subclasse de :exc:`ConnectionError`, levantada quando uma tentativa de " -"conexão é recusada pelo par. Corresponde a :c:data:`errno` :py:const:`~errno." -"ECONNREFUSED`." +"conexão é recusada pelo par. Corresponde " +"a :c:data:`errno` :py:const:`~errno.ECONNREFUSED`." -#: ../../library/exceptions.rst:751 +#: ../../builtins/exceptions.rst:765 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection is reset by " "the peer. Corresponds to :c:data:`errno` :py:const:`~errno.ECONNRESET`." msgstr "" "Uma subclasse de :exc:`ConnectionError`, levantada quando uma conexão é " -"redefinida pelo par. Corresponde a :c:data:`errno` :py:const:`~errno." -"ECONNRESET`." +"redefinida pelo par. Corresponde " +"a :c:data:`errno` :py:const:`~errno.ECONNRESET`." -#: ../../library/exceptions.rst:757 +#: ../../builtins/exceptions.rst:771 msgid "" "Raised when trying to create a file or directory which already exists. " "Corresponds to :c:data:`errno` :py:const:`~errno.EEXIST`." @@ -1240,7 +1275,7 @@ msgstr "" "Levantada ao tentar criar um arquivo ou diretório que já existe. Corresponde " "a :c:data:`errno` :py:const:`~errno.EEXIST`." -#: ../../library/exceptions.rst:762 +#: ../../builtins/exceptions.rst:776 msgid "" "Raised when a file or directory is requested but doesn't exist. Corresponds " "to :c:data:`errno` :py:const:`~errno.ENOENT`." @@ -1248,7 +1283,7 @@ msgstr "" "Levantada quando um arquivo ou diretório é solicitado, mas não existe. " "Corresponde a :c:data:`errno` :py:const:`~errno.ENOENT`." -#: ../../library/exceptions.rst:767 +#: ../../builtins/exceptions.rst:781 msgid "" "Raised when a system call is interrupted by an incoming signal. Corresponds " "to :c:data:`errno` :py:const:`~errno.EINTR`." @@ -1256,33 +1291,33 @@ msgstr "" "Levantada quando uma chamada do sistema é interrompida por um sinal de " "entrada. Corresponde a :c:data:`errno` :py:const:`~errno.EINTR`." -#: ../../library/exceptions.rst:770 +#: ../../builtins/exceptions.rst:784 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 " "rationale), instead of raising :exc:`InterruptedError`." msgstr "" -"Python agora tenta novamente chamadas de sistema quando uma *syscall* é " -"interrompida por um sinal, exceto se o tratador de sinal levanta uma exceção " -"(veja :pep:`475` para a justificativa), em vez de levantar :exc:" -"`InterruptedError`." +"Python agora tenta novamente as chamadas de sistema quando uma delas é " +"interrompida por um sinal, exceto se o tratador de sinal levantar uma " +"exceção (veja :pep:`475` para a justificativa), em vez de " +"levantar :exc:`InterruptedError`." -#: ../../library/exceptions.rst:777 +#: ../../builtins/exceptions.rst:791 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`." msgstr "" "Levantada quando uma operação de arquivo (como :func:`os.remove`) é " -"solicitada em um diretório. Corresponde a :c:data:`errno` :py:const:`~errno." -"EISDIR`." +"solicitada em um diretório. Corresponde " +"a :c:data:`errno` :py:const:`~errno.EISDIR`." -#: ../../library/exceptions.rst:783 +#: ../../builtins/exceptions.rst:797 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` :py:const:`~errno.ENOTDIR`." msgstr "" "Levantada quando uma operação de diretório (como :func:`os.listdir`) é " "solicitada em algo que não é um diretório. Na maioria das plataformas POSIX, " @@ -1290,168 +1325,176 @@ msgstr "" "arquivo não pertencente ao diretório como se fosse um diretório. Corresponde " "a :c:data:`errno` :py:const:`~errno.ENOTDIR`." -#: ../../library/exceptions.rst:791 +#: ../../builtins/exceptions.rst:805 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` :py:const:`~errno.EACCES`, :py:const:`~errno.EPERM`, " +"and :py:const:`~errno.ENOTCAPABLE`." msgstr "" "Levantada ao tentar executar uma operação sem os direitos de acesso " -"adequados - por exemplo, permissões do sistema de arquivos. Corresponde a :c:" -"data:`errno` :py:const:`~errno.EACCES`, :py:const:`~errno.EPERM`, e :py:" -"const:`~errno.ENOTCAPABLE`." +"adequados - por exemplo, permissões do sistema de arquivos. Corresponde " +"a :c:data:`errno` :py:const:`~errno.EACCES`, :py:const:`~errno.EPERM`, " +"e :py:const:`~errno.ENOTCAPABLE`." -#: ../../library/exceptions.rst:796 +#: ../../builtins/exceptions.rst:810 msgid "" -"WASI's :py:const:`~errno.ENOTCAPABLE` is now mapped to :exc:" -"`PermissionError`." +"WASI's :py:const:`~errno.ENOTCAPABLE` is now mapped " +"to :exc:`PermissionError`." msgstr "" -":py:const:`~errno.ENOTCAPABLE` do WASI agora é mapeado para :exc:" -"`PermissionError`." +":py:const:`~errno.ENOTCAPABLE` do WASI agora é mapeado " +"para :exc:`PermissionError`." -#: ../../library/exceptions.rst:802 +#: ../../builtins/exceptions.rst:816 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` :py:const:`~errno.ESRCH`." msgstr "" -"Levantada quando um determinado processo não existe. Corresponde a :c:data:" -"`errno` :py:const:`~errno.ESRCH`." +"Levantada quando um determinado processo não existe. Corresponde " +"a :c:data:`errno` :py:const:`~errno.ESRCH`." -#: ../../library/exceptions.rst:807 +#: ../../builtins/exceptions.rst:821 msgid "" -"Raised when a system function timed out at the system level. Corresponds to :" -"c:data:`errno` :py:const:`~errno.ETIMEDOUT`." +"Raised when a system function timed out at the system level. Corresponds " +"to :c:data:`errno` :py:const:`~errno.ETIMEDOUT`." msgstr "" "Levantada quando uma função do sistema expirou no nível do sistema. " "Corresponde a :c:data:`errno` :py:const:`~errno.ETIMEDOUT`." -#: ../../library/exceptions.rst:810 +#: ../../builtins/exceptions.rst:824 msgid "All the above :exc:`OSError` subclasses were added." msgstr "Todas as subclasses de :exc:`OSError` acima foram adicionadas." -#: ../../library/exceptions.rst:816 +#: ../../builtins/exceptions.rst:830 msgid ":pep:`3151` - Reworking the OS and IO exception hierarchy" -msgstr ":pep:`3151` - Reworking the OS and IO exception hierarchy" +msgstr ":pep:`3151` - Reorganiza a hierarquia de exceções de SO e E/S" -#: ../../library/exceptions.rst:822 +#: ../../builtins/exceptions.rst:836 msgid "Warnings" msgstr "Avisos" -#: ../../library/exceptions.rst:824 +#: ../../builtins/exceptions.rst:838 msgid "" -"The following exceptions are used as warning categories; see the :ref:" -"`warning-categories` documentation for more details." +"The following exceptions are used as warning categories; see " +"the :ref:`warning-categories` documentation for more details." msgstr "" "As seguintes exceções são usadas como categorias de aviso; veja a " "documentação de :ref:`warning-categories` para mais detalhes." -#: ../../library/exceptions.rst:829 +#: ../../builtins/exceptions.rst:843 msgid "Base class for warning categories." msgstr "Classe base para categorias de aviso." -#: ../../library/exceptions.rst:834 +#: ../../builtins/exceptions.rst:848 msgid "Base class for warnings generated by user code." msgstr "Classe base para avisos gerados pelo código do usuário." -#: ../../library/exceptions.rst:839 +#: ../../builtins/exceptions.rst:853 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for other Python developers." msgstr "" -"Classe base para avisos sobre recursos descontinuados quando esses avisos se " -"destinam a outros desenvolvedores Python." +"Classe base para avisos sobre recursos descontinuados destinados a outros " +"desenvolvedores Python." -#: ../../library/exceptions.rst:842 +#: ../../builtins/exceptions.rst:856 msgid "" -"Ignored by the default warning filters, except in the ``__main__`` module (:" -"pep:`565`). Enabling the :ref:`Python Development Mode ` shows this " -"warning." +"Ignored by the default warning filters, except in the ``__main__`` module " +"(:pep:`565`). Enabling the :ref:`Python Development Mode ` shows " +"this warning." msgstr "" -"Ignorado pelos filtros de aviso padrão, exceto no módulo ``__main__`` (:pep:" -"`565`). Habilitar o :ref:`Modo de Desenvolvimento do Python ` " -"mostra este aviso." +"Ignorado pelos filtros de aviso padrão, exceto no módulo ``__main__`` " +"(:pep:`565`). Habilitar o :ref:`Modo de Desenvolvimento do Python ` " +"exibe este aviso." -#: ../../library/exceptions.rst:846 ../../library/exceptions.rst:862 +#: ../../builtins/exceptions.rst:860 ../../builtins/exceptions.rst:876 msgid "The deprecation policy is described in :pep:`387`." msgstr "A política de descontinuação está descrita na :pep:`387`." -#: ../../library/exceptions.rst:851 +#: ../../builtins/exceptions.rst:865 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." msgstr "" -"Classe base para avisos sobre recursos que foram descontinuados e devem ser " -"descontinuados no futuro, mas não foram descontinuados ainda." +"Classe base para avisos sobre recursos obsoletos que devem ser " +"descontinuados no futuro, mas ainda não foram." -#: ../../library/exceptions.rst:855 +#: ../../builtins/exceptions.rst:869 msgid "" "This class is rarely used as emitting a warning about a possible upcoming " "deprecation is unusual, and :exc:`DeprecationWarning` is preferred for " "already active deprecations." msgstr "" -"Esta classe raramente é usada para emitir um aviso sobre uma possível " +"Esta classe raramente é usada para emitir um aviso de possível " "descontinuação futura, é incomum, e :exc:`DeprecationWarning` é preferível " "para descontinuações já ativas." -#: ../../library/exceptions.rst:859 ../../library/exceptions.rst:885 -#: ../../library/exceptions.rst:912 +#: ../../builtins/exceptions.rst:873 ../../builtins/exceptions.rst:902 +#: ../../builtins/exceptions.rst:929 msgid "" "Ignored by the default warning filters. Enabling the :ref:`Python " "Development Mode ` shows this warning." msgstr "" "Ignorado pelos filtros de aviso padrão. Habilitar o :ref:`Modo de " -"Desenvolvimento do Python ` mostra este aviso." +"Desenvolvimento do Python ` exibe este aviso." -#: ../../library/exceptions.rst:867 +#: ../../builtins/exceptions.rst:881 msgid "Base class for warnings about dubious syntax." msgstr "Classe base para avisos sobre sintaxe duvidosa." -#: ../../library/exceptions.rst:872 +#: ../../builtins/exceptions.rst:883 +msgid "" +"This warning is typically emitted when compiling Python source code, and " +"usually won't be reported when running already compiled code." +msgstr "" +"Este aviso é tipicamente emitido ao compilar código-fonte Python e, " +"normalmente, não será exibido ao executar código já compilado." + +#: ../../builtins/exceptions.rst:889 msgid "Base class for warnings about dubious runtime behavior." msgstr "" "Classe base para avisos sobre comportamento duvidoso de tempo de execução." -#: ../../library/exceptions.rst:877 +#: ../../builtins/exceptions.rst:894 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for end users of applications that are written in Python." msgstr "" -"Classe base para avisos sobre recursos descontinuados quando esses avisos se " -"destinam a usuários finais de aplicações escritas em Python." +"Classe base para avisos sobre recursos descontinuados destinados a usuários " +"finais de aplicações escritas em Python." -#: ../../library/exceptions.rst:883 +#: ../../builtins/exceptions.rst:900 msgid "Base class for warnings about probable mistakes in module imports." msgstr "" "Classe base para avisos sobre prováveis erros na importação de módulos." -#: ../../library/exceptions.rst:891 +#: ../../builtins/exceptions.rst:908 msgid "Base class for warnings related to Unicode." msgstr "Classe base para avisos relacionados a Unicode." -#: ../../library/exceptions.rst:896 +#: ../../builtins/exceptions.rst:913 msgid "Base class for warnings related to encodings." msgstr "Classe base para avisos relacionados a codificações." -#: ../../library/exceptions.rst:898 +#: ../../builtins/exceptions.rst:915 msgid "See :ref:`io-encoding-warning` for details." msgstr "Veja :ref:`io-encoding-warning` para detalhes." -#: ../../library/exceptions.rst:905 +#: ../../builtins/exceptions.rst:922 msgid "" "Base class for warnings related to :class:`bytes` and :class:`bytearray`." msgstr "" "Classe base para avisos relacionados a :class:`bytes` e :class:`bytearray`." -#: ../../library/exceptions.rst:910 +#: ../../builtins/exceptions.rst:927 msgid "Base class for warnings related to resource usage." -msgstr "Classe base para avisos relacionados a uso de recursos." +msgstr "Classe base para avisos relacionados ao uso de recursos." -#: ../../library/exceptions.rst:921 +#: ../../builtins/exceptions.rst:938 msgid "Exception groups" msgstr "Grupos de exceções" -#: ../../library/exceptions.rst:923 +#: ../../builtins/exceptions.rst:940 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 " @@ -1463,64 +1506,83 @@ msgstr "" "não relacionadas. Eles fazem parte da hierarquia de exceção, portanto, podem " "ser tratados com :keyword:`except` como todas as outras exceções. Além " "disso, eles são reconhecidos por :keyword:`except*`, que " -"corresponde a seus subgrupos com base nos tipos de exceções contidas." +"corresponde aos seus subgrupos com base nos tipos de exceções contidas." -#: ../../library/exceptions.rst:932 +#: ../../builtins/exceptions.rst:949 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`." +"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 "" "Ambos os tipos de exceção agrupam as exceções na sequência ``excs``. O " "parâmetro ``msg`` deve ser uma string. A diferença entre as duas classes é " "que :exc:`BaseExceptionGroup` estende :exc:`BaseException` e pode envolver " "qualquer exceção, enquanto :exc:`ExceptionGroup` estende :exc:`Exception` e " -"só pode agrupar subclasses de :exc:`Exception`. Este design é para que " -"``except Exception`` capture um :exc:`ExceptionGroup` mas não :exc:" -"`BaseExceptionGroup`." +"pode agrupar apenas subclasses de :exc:`Exception`. Este design é para que " +"``except Exception`` capture um :exc:`ExceptionGroup` mas " +"não :exc:`BaseExceptionGroup`." -#: ../../library/exceptions.rst:940 +#: ../../builtins/exceptions.rst:957 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." +"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 "" "O construtor de :exc:`BaseExceptionGroup` retorna uma :exc:`ExceptionGroup` " "ao invés de uma :exc:`BaseExceptionGroup` se todas as exceções contidas " -"forem instâncias :exc:`Exception`, então ela pode ser usada para tornar a " +"forem instâncias de :exc:`Exception`, então ela pode ser usada para tornar a " "seleção automática. O construtor de :exc:`ExceptionGroup`, por outro lado, " "levanta :exc:`TypeError` se qualquer exceção contida não for uma subclasse " "de :exc:`Exception`." -#: ../../library/exceptions.rst:949 +#: ../../builtins/exceptions.rst:964 +msgid "" +"Exception groups are :ref:`generic ` over the type of their " +"contained exceptions." +msgstr "" +"Grupos de exceções são :ref:`genéricos ` em relação ao tipo das " +"exceções que contêm." + +#: ../../builtins/exceptions.rst:969 +msgid "" +"The ``excs`` parameter may be any sequence, but lists and tuples are " +"specifically processed more efficiently here. For optimal performance, pass " +"a tuple as ``excs``." +msgstr "" +"O parâmetro ``excs`` pode ser qualquer sequência, mas as listas e as tuplas " +"são processadas aqui de forma mais eficiente. Para otimizar o desempenho, " +"passe uma tupla como ``excs``." + +#: ../../builtins/exceptions.rst:975 msgid "The ``msg`` argument to the constructor. This is a read-only attribute." msgstr "" "O argumento ``msg`` para o construtor. Este é um atributo somente leitura." -#: ../../library/exceptions.rst:953 +#: ../../builtins/exceptions.rst:979 msgid "" "A tuple of the exceptions in the ``excs`` sequence given to the constructor. " "This is a read-only attribute." msgstr "" -"Uma tupla de exceções na sequência ``excs`` dada ao construtor. Este é um " +"Uma tupla de exceções na sequência ``excs`` passada ao construtor. Este é um " "atributo somente leitura." -#: ../../library/exceptions.rst:958 +#: ../../builtins/exceptions.rst:984 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 "" "Retorna um grupo de exceções que contém apenas as exceções do grupo atual " -"que correspondem à condição *condition* ou ``None`` se o resultado estiver " +"que correspondam à condição *condition*, ou ``None`` se o resultado estiver " "vazio." -#: ../../library/exceptions.rst:961 +#: ../../builtins/exceptions.rst:987 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 " @@ -1528,28 +1590,27 @@ msgid "" "type object) that accepts an exception as its single argument and returns " "true for the exceptions that should be in the subgroup." msgstr "" -"A condição pode ser um tipo exceção ou tupla de tipos de exceção. Nesse " -"caso, cada exceção é verificada quanto a um match usando a mesma verificação " -"que é usada em uma cláusula de ``except``. A condição também pode ser um " -"chamável (diferente de um objeto de tipo) que aceita uma exceção como seu " -"único argumento e retorna verdadeiro para a exceção que deve estar no " -"subgrupo." +"A condição pode ser um tipo de exceção ou uma tupla de tipos de exceção. " +"Nesse caso, cada exceção é verificada pela mesma regra usada em uma cláusula " +"de ``except``. A condição também pode ser um chamável (diferente de um " +"objeto de tipo) que aceita uma exceção como único argumento e retorna " +"verdadeiro se a exceção estiver no subgrupo." -#: ../../library/exceptions.rst:967 +#: ../../builtins/exceptions.rst:993 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." +"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 "" "A estrutura de aninhamento da exceção atual é preservada no resultado, assim " -"como os valores de seus campos :attr:`message`, :attr:`~BaseException." -"__traceback__`, :attr:`~BaseException.__cause__`, :attr:`~BaseException." -"__context__` e :attr:`~BaseException.__notes__`. Grupos aninhados vazios são " -"omitidos do resultado." +"como os valores de seus " +"campos :attr:`message`, :attr:`~BaseException.__traceback__`, :attr:`~BaseException.__cause__`, :attr:`~BaseException.__context__` " +"e :attr:`~BaseException.__notes__`. Grupos aninhados vazios são omitidos do " +"resultado." -#: ../../library/exceptions.rst:974 +#: ../../builtins/exceptions.rst:1000 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 " @@ -1557,24 +1618,24 @@ msgid "" msgstr "" "A condição é verificada para todas as exceções no grupo de exceções " "aninhadas, incluindo o nível superior e quaisquer grupos de exceções " -"aninhadas. Se a condição for verdadeira para tal grupo de exceções, ela será " -"incluída no resultado por completo." +"aninhadas. Se a condição for verdadeira para esse grupo de exceções, ela " +"será incluída no resultado por completo." -#: ../../library/exceptions.rst:978 +#: ../../builtins/exceptions.rst:1004 msgid "``condition`` can be any callable which is not a type object." msgstr "" "``condition`` pode ser qualquer chamável que não seja um objeto de tipo." -#: ../../library/exceptions.rst:983 +#: ../../builtins/exceptions.rst:1009 msgid "" "Like :meth:`subgroup`, but returns the pair ``(match, rest)`` where " "``match`` is ``subgroup(condition)`` and ``rest`` is the remaining non-" "matching part." msgstr "" -"Como :meth:`subgroup`, mas retorna o par ``(match, rest)`` onde ``match`` é " -"``subgroup(condition)`` e ``rest`` é a parte restante não correspondente." +"Como :meth:`subgroup`, mas retorna o par ``(match, rest)`` em que ``match`` " +"é ``subgroup(condition)`` e ``rest`` é a parte restante não correspondente." -#: ../../library/exceptions.rst:989 +#: ../../builtins/exceptions.rst:1015 msgid "" "Returns an exception group with the same :attr:`message`, but which wraps " "the exceptions in ``excs``." @@ -1582,7 +1643,7 @@ msgstr "" "Retorna um grupo de exceções com o mesmo :attr:`message`, mas que agrupa as " "exceções em ``excs``." -#: ../../library/exceptions.rst:992 +#: ../../builtins/exceptions.rst:1018 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 " @@ -1591,100 +1652,314 @@ msgid "" msgstr "" "Este método é usado por :meth:`subgroup` e :meth:`split`, que são usados em " "vários contextos para dividir um grupo de exceções. Uma subclasse precisa " -"substituí-la para fazer com que :meth:`subgroup` e :meth:`split` retorne " +"substituí-la para fazer com que :meth:`subgroup` e :meth:`split` retornem " "instâncias da subclasse em vez de :exc:`ExceptionGroup`." -#: ../../library/exceptions.rst:998 -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` e :meth:`split` copiam os campos :attr:`~BaseException." -"__traceback__`, :attr:`~BaseException.__cause__`, :attr:`~BaseException." -"__context__` e :attr:`~BaseException.__notes__` do grupo de exceções " -"original para o retornado por :meth:`derive`, então esses campos não " -"precisam ser atualizados por :meth:`derive`. ::" - -#: ../../library/exceptions.rst:1031 +#: ../../builtins/exceptions.rst:1024 +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` e :meth:`split` copiam os " +"campos :attr:`~BaseException.__traceback__`, :attr:`~BaseException.__cause__`, :attr:`~BaseException.__context__` " +"e :attr:`~BaseException.__notes__` do grupo de exceções original para o " +"retornado por :meth:`derive`, então esses campos não precisam ser " +"atualizados por :meth:`derive`. ::" + +#: ../../builtins/exceptions.rst:1031 +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 "" +">>> 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" + +#: ../../builtins/exceptions.rst:1057 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 " +"exception group subclass which accepts an exit_code and constructs the " "group's message from it. ::" msgstr "" "Observe que :exc:`BaseExceptionGroup` define :meth:`~object.__new__`, então " "subclasses que precisam de uma assinatura de construtor diferente precisam " -"substituir isso ao invés de :meth:`~object.__init__`. Por exemplo, o " -"seguinte define uma subclasse de grupo de exceções que aceita um exit_code e " +"substituir isso em vez de :meth:`~object.__init__`. Por exemplo, a seguir " +"definimos uma subclasse de grupo de exceções que aceita um exit_code e " "constrói a mensagem do grupo a partir dele. ::" -#: ../../library/exceptions.rst:1046 +#: ../../builtins/exceptions.rst:1063 +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 "" +"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)" + +#: ../../builtins/exceptions.rst:1072 msgid "" "Like :exc:`ExceptionGroup`, any subclass of :exc:`BaseExceptionGroup` which " -"is also a subclass of :exc:`Exception` can only wrap instances of :exc:" -"`Exception`." +"is also a subclass of :exc:`Exception` can only wrap instances " +"of :exc:`Exception`." msgstr "" "Como :exc:`ExceptionGroup`, qualquer subclasse de :exc:`BaseExceptionGroup` " -"que também é uma subclasse de :exc:`Exception` só pode agrupar instâncias " +"que também seja uma subclasse de :exc:`Exception` só pode agrupar instâncias " "de :exc:`Exception`." -#: ../../library/exceptions.rst:1054 +#: ../../builtins/exceptions.rst:1080 msgid "Exception hierarchy" msgstr "Hierarquia das exceções" -#: ../../library/exceptions.rst:1056 +#: ../../builtins/exceptions.rst:1082 msgid "The class hierarchy for built-in exceptions is:" msgstr "A hierarquia de classes para exceções embutidas é:" -#: ../../library/exceptions.rst:6 ../../library/exceptions.rst:17 -#: ../../library/exceptions.rst:196 +#: ../../builtins/exceptions.rst:1084 +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 "" +"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" + +#: ../../builtins/exceptions.rst:6 ../../builtins/exceptions.rst:17 +#: ../../builtins/exceptions.rst:196 msgid "statement" msgstr "instrução" -#: ../../library/exceptions.rst:6 +#: ../../builtins/exceptions.rst:6 msgid "try" msgstr "try" -#: ../../library/exceptions.rst:6 +#: ../../builtins/exceptions.rst:6 msgid "except" msgstr "except" -#: ../../library/exceptions.rst:17 +#: ../../builtins/exceptions.rst:17 msgid "raise" msgstr "raise" -#: ../../library/exceptions.rst:41 +#: ../../builtins/exceptions.rst:41 msgid "exception" msgstr "exceção" -#: ../../library/exceptions.rst:41 +#: ../../builtins/exceptions.rst:41 msgid "chaining" msgstr "encadeamento" -#: ../../library/exceptions.rst:41 +#: ../../builtins/exceptions.rst:41 msgid "__cause__ (exception attribute)" msgstr "__cause__ (atributo de exceção)" -#: ../../library/exceptions.rst:41 +#: ../../builtins/exceptions.rst:41 msgid "__context__ (exception attribute)" msgstr "__context__ (atributo de exceção)" -#: ../../library/exceptions.rst:41 +#: ../../builtins/exceptions.rst:41 msgid "__suppress_context__ (exception attribute)" msgstr "__suppress_context__ (atributo de exceção)" -#: ../../library/exceptions.rst:196 +#: ../../builtins/exceptions.rst:196 msgid "assert" msgstr "assert" -#: ../../library/exceptions.rst:345 +#: ../../builtins/exceptions.rst:355 msgid "module" msgstr "módulo" -#: ../../library/exceptions.rst:345 +#: ../../builtins/exceptions.rst:355 msgid "errno" msgstr "errno" diff --git a/library/functions.po b/builtins/functions.po similarity index 65% rename from library/functions.po rename to builtins/functions.po index ebb71cdcb..5dca1c9a3 100644 --- a/library/functions.po +++ b/builtins/functions.po @@ -1,47 +1,36 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Misael borges , 2021 -# Welington Carlos , 2021 -# Italo Penaforte , 2021 -# VERUSKA RODRIGUES DA SILVA , 2021 -# felipe caridade fernandes , 2021 -# (Douglas da Silva) , 2021 -# Katyanna Moura , 2021 -# João Porfirio, 2021 -# Vinicius Gubiani Ferreira , 2023 -# i17obot , 2024 -# Marco Rougeth , 2024 -# Claudio Rogerio Carvalho Filho , 2024 -# Pedro Fonini, 2024 -# Adorilson Bezerra , 2024 -# Rafael Fontenelle , 2024 +# willian ohara, 2026 +# python-doc bot, 2026 +# Orlando Sabino , 2026 +# Rafael Fontenelle , 2026 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-08-09 16:36+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2026-09-13 19:06+0000\n" +"Last-Translator: Rafael Fontenelle , 2026\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" -#: ../../library/functions.rst:5 ../../library/functions.rst:11 +#: ../../builtins/functions.rst:5 ../../builtins/functions.rst:11 msgid "Built-in Functions" msgstr "Funções embutidas" -#: ../../library/functions.rst:7 +#: ../../builtins/functions.rst:7 msgid "" "The Python interpreter has a number of functions and types built into it " "that are always available. They are listed here in alphabetical order." @@ -49,396 +38,397 @@ msgstr "" "O interpretador do Python possui várias funções e tipos embutidos que sempre " "estão disponíveis. A seguir listamos todas as funções em ordem alfabética." -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "**A**" msgstr "**A**" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`abs`" msgstr ":func:`abs`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`aiter`" msgstr ":func:`aiter`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`all`" msgstr ":func:`all`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`anext`" msgstr ":func:`anext`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`any`" msgstr ":func:`any`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`ascii`" msgstr ":func:`ascii`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "**B**" msgstr "**B**" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`bin`" msgstr ":func:`bin`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`bool`" msgstr ":func:`bool`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`breakpoint`" msgstr ":func:`breakpoint`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "|func-bytearray|_" msgstr "|func-bytearray|_" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "|func-bytes|_" msgstr "|func-bytes|_" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "**C**" msgstr "**C**" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`callable`" msgstr ":func:`callable`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`chr`" msgstr ":func:`chr`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`classmethod`" msgstr ":func:`classmethod`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`compile`" msgstr ":func:`compile`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`complex`" msgstr ":func:`complex`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "**D**" msgstr "**D**" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`delattr`" msgstr ":func:`delattr`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "|func-dict|_" msgstr "|func-dict|_" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`dir`" msgstr ":func:`dir`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`divmod`" msgstr ":func:`divmod`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "**E**" msgstr "**E**" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`enumerate`" msgstr ":func:`enumerate`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`eval`" msgstr ":func:`eval`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`exec`" msgstr ":func:`exec`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "**F**" msgstr "**F**" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`filter`" msgstr ":func:`filter`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`float`" msgstr ":func:`float`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`format`" msgstr ":func:`format`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "|func-frozenset|_" msgstr "|func-frozenset|_" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "**G**" msgstr "**G**" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`getattr`" msgstr ":func:`getattr`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`globals`" msgstr ":func:`globals`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "**H**" msgstr "**H**" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`hasattr`" msgstr ":func:`hasattr`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`hash`" msgstr ":func:`hash`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`help`" msgstr ":func:`help`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`hex`" msgstr ":func:`hex`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "**I**" msgstr "**I**" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`id`" msgstr ":func:`id`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`input`" msgstr ":func:`input`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`int`" msgstr ":func:`int`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`isinstance`" msgstr ":func:`isinstance`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`issubclass`" msgstr ":func:`issubclass`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`iter`" msgstr ":func:`iter`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "**L**" msgstr "**L**" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`len`" msgstr ":func:`len`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "|func-list|_" msgstr "|func-list|_" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`locals`" msgstr ":func:`locals`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "**M**" msgstr "**M**" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`map`" msgstr ":func:`map`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`max`" msgstr ":func:`max`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "|func-memoryview|_" msgstr "|func-memoryview|_" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`min`" msgstr ":func:`min`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "**N**" msgstr "**N**" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`next`" msgstr ":func:`next`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "**O**" msgstr "**O**" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`object`" msgstr ":func:`object`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`oct`" msgstr ":func:`oct`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`open`" msgstr ":func:`open`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`ord`" msgstr ":func:`ord`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "**P**" msgstr "**P**" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`pow`" msgstr ":func:`pow`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`print`" msgstr ":func:`print`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`property`" msgstr ":func:`property`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "**R**" msgstr "**R**" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "|func-range|_" msgstr "|func-range|_" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`repr`" msgstr ":func:`repr`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`reversed`" msgstr ":func:`reversed`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`round`" msgstr ":func:`round`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "**S**" msgstr "**S**" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "|func-set|_" msgstr "|func-set|_" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`setattr`" msgstr ":func:`setattr`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`slice`" msgstr ":func:`slice`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`sorted`" msgstr ":func:`sorted`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`staticmethod`" msgstr ":func:`staticmethod`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "|func-str|_" msgstr "|func-str|_" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`sum`" msgstr ":func:`sum`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`super`" msgstr ":func:`super`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "**T**" msgstr "**T**" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "|func-tuple|_" msgstr "|func-tuple|_" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`type`" msgstr ":func:`type`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "**V**" msgstr "**V**" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`vars`" msgstr ":func:`vars`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "**Z**" msgstr "**Z**" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`zip`" msgstr ":func:`zip`" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "**_**" msgstr "**_**" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid ":func:`__import__`" msgstr ":func:`__import__`" -#: ../../library/functions.rst:59 +#: ../../builtins/functions.rst:59 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." msgstr "" "Retorna o valor absoluto de um número. O argumento pode ser um inteiro, um " -"número de ponto flutuante ou um objeto implementando :meth:`~object." -"__abs__`. Se o argumento é um número complexo, sua magnitude é retornada." +"número de ponto flutuante ou um objeto " +"implementando :meth:`~object.__abs__`. Se o argumento é um número complexo, " +"sua magnitude é retornada." -#: ../../library/functions.rst:67 +#: ../../builtins/functions.rst:67 msgid "" "Return an :term:`asynchronous iterator` for an :term:`asynchronous " "iterable`. Equivalent to calling ``x.__aiter__()``." msgstr "" -"Retorna um :term:`iterador assíncrono ` para um :term:" -"`iterável assíncrono `. Equivalente a chamar ``x." -"__aiter__()``." +"Retorna um :term:`iterador assíncrono ` para " +"um :term:`iterável assíncrono `. Equivalente a chamar " +"``x.__aiter__()``." -#: ../../library/functions.rst:70 +#: ../../builtins/functions.rst:70 msgid "Note: Unlike :func:`iter`, :func:`aiter` has no 2-argument variant." msgstr "" "Nota: Ao contrário de :func:`iter`, :func:`aiter` não tem uma variante de 2 " "argumentos." -#: ../../library/functions.rst:76 +#: ../../builtins/functions.rst:76 msgid "" "Return ``True`` if all elements of the *iterable* are true (or if the " "iterable is empty). Equivalent to::" @@ -446,7 +436,21 @@ msgstr "" "Retorna ``True`` se todos os elementos de *iterable* são verdadeiros (ou se " "*iterable* estiver vazio). Equivalente a::" -#: ../../library/functions.rst:89 +#: ../../builtins/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 elemento in iterable:\n" +" if not elemento:\n" +" return False\n" +" return True" + +#: ../../builtins/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." @@ -454,14 +458,14 @@ msgstr "" "Quando aguardado, retorna o próximo item do :term:`iterador assíncrono` " "fornecido, ou *default* se fornecido e o iterador for esgotado." -#: ../../library/functions.rst:92 +#: ../../builtins/functions.rst:92 msgid "" "This is the async variant of the :func:`next` builtin, and behaves similarly." msgstr "" "Esta é a variante assíncrona do :func:`next` embutido, e se comporta de " "forma semelhante." -#: ../../library/functions.rst:95 +#: ../../builtins/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 " @@ -474,7 +478,7 @@ msgstr "" "for esgotado, caso contrário, a exceção :exc:`StopAsyncIteration` será " "levantada." -#: ../../library/functions.rst:104 +#: ../../builtins/functions.rst:104 msgid "" "Return ``True`` if any element of the *iterable* is true. If the iterable " "is empty, return ``False``. Equivalent to::" @@ -482,31 +486,45 @@ msgstr "" "Retorna ``True`` se algum elemento de *iterable* for verdadeiro. Se " "*iterable* estiver vazio, retorna ``False``. Equivalente a::" -#: ../../library/functions.rst:116 +#: ../../builtins/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 elemento in iterable:\n" +" if elemento:\n" +" return True\n" +" return False" + +#: ../../builtins/functions.rst:116 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 " -"similar to that returned by :func:`repr` in Python 2." +"object, but escape the non-ASCII characters in the string returned " +"by :func:`repr` using ``\\x``, ``\\u``, or ``\\U`` escapes. This generates " +"a string similar to that returned by :func:`repr` in Python 2." msgstr "" "Como :func:`repr`, retorna uma string contendo uma representação imprimível " "de um objeto, mas faz escape de caracteres não-ASCII na string retornada " "por :func:`repr` usando sequências de escapes ``\\x``, ``\\u`` ou ``\\U``. " "Isto gera uma string similar ao que é retornado por :func:`repr` no Python 2." -#: ../../library/functions.rst:124 +#: ../../builtins/functions.rst:124 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 " -"integer. Some examples:" +"result is a valid Python expression. If *integer* is not a " +"Python :class:`int` object, it has to define an :meth:`~object.__index__` " +"method that returns an integer. Some examples:" msgstr "" "Converte um número inteiro para uma string de binários prefixada com \"0b\". " -"O resultado é uma expressão Python válida. Se *x* não é um objeto Python :" -"class:`int`, ele tem que definir um método :meth:`~object.__index__` que " -"devolve um inteiro. Alguns exemplos:" +"O resultado é uma expressão Python válida. Se *integer* não é um objeto " +"Python :class:`int`, ele tem que definir um método :meth:`~object.__index__` " +"que devolve um inteiro. Alguns exemplos:" -#: ../../library/functions.rst:134 +#: ../../builtins/functions.rst:134 msgid "" "If the prefix \"0b\" is desired or not, you can use either of the following " "ways." @@ -514,36 +532,44 @@ msgstr "" "Se o prefixo \"0b\" é desejado ou não, você pode usar uma das seguintes " "maneiras." -#: ../../library/functions.rst:141 ../../library/functions.rst:929 -#: ../../library/functions.rst:1308 +#: ../../builtins/functions.rst:141 +msgid "" +"See also :func:`enum.bin` to represent negative values as twos-complement." +msgstr "" +"Veja também :func:`enum.bin` para representar valores negativos como " +"complemento de dois." + +#: ../../builtins/functions.rst:143 ../../builtins/functions.rst:958 +#: ../../builtins/functions.rst:1339 msgid "See also :func:`format` for more information." msgstr "Veja também :func:`format` para mais informações." -#: ../../library/functions.rst:146 +#: ../../builtins/functions.rst:148 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`)." +"``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 "" "Retorna um valor Booleano, isto é, ``True`` ou ``False``. O argumento é " "convertido usando o :ref:`procedimento de teste de verdade ` padrão. " "Se o argumento for falso ou foi omitido, isso retorna ``False``; senão " -"``True``. A classe :class:`bool` é uma subclasse de :class:`int` (veja :ref:" -"`typesnumeric`). Ela não pode ser usada para criar outra subclasse. Suas " -"únicas instâncias são ``False`` e ``True`` (veja :ref:`typebool`)." +"``True``. A classe :class:`bool` é uma subclasse de :class:`int` " +"(veja :ref:`typesnumeric`). Ela não pode ser usada para criar outra " +"subclasse. Suas únicas instâncias são ``False`` e ``True`` " +"(veja :ref:`typebool`)." -#: ../../library/functions.rst:156 ../../library/functions.rst:794 +#: ../../builtins/functions.rst:158 ../../builtins/functions.rst:823 msgid "The parameter is now positional-only." msgstr "O parâmetro agora é somente-posicional" -#: ../../library/functions.rst:161 +#: ../../builtins/functions.rst:163 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 " @@ -553,26 +579,27 @@ msgid "" msgstr "" "Esta função coloca você no depurador no local da chamada. Especificamente, " "ela chama :func:`sys.breakpointhook`, passando ``args`` e ``kws`` " -"diretamente. Por padrão, ``sys.breakpointhook()`` chama :func:`pdb." -"set_trace()` não esperando nenhum argumento. Neste caso, isso é puramente " -"uma função de conveniência para você não precisar importar :mod:`pdb` " -"explicitamente ou digitar mais código para entrar no depurador. Contudo, :" -"func:`sys.breakpointhook` pode ser configurado para alguma outra função e :" -"func:`breakpoint` irá automaticamente chamá-la, permitindo você ir para o " -"depurador de sua escolha. Se :func:`sys.breakpointhook` não estiver " -"acessível, esta função vai levantar :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." +"diretamente. Por padrão, ``sys.breakpointhook()`` " +"chama :func:`pdb.set_trace` não esperando nenhum argumento. Neste caso, isso " +"é puramente uma função de conveniência para você não precisar " +"importar :mod:`pdb` explicitamente ou digitar mais código para entrar no " +"depurador. Contudo, :func:`sys.breakpointhook` pode ser configurado para " +"alguma outra função e :func:`breakpoint` irá automaticamente chamá-la, " +"permitindo você ir para o depurador de sua escolha. " +"Se :func:`sys.breakpointhook` não estiver acessível, esta função vai " +"levantar :exc:`RuntimeError`." + +#: ../../builtins/functions.rst:175 +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 "" "Por padrão, o comportamento de :func:`breakpoint` pode ser alterado com a " -"variável de ambiente :envvar:`PYTHONBREAKPOINT`. Veja :func:`sys." -"breakpointhook` para detalhes de uso." +"variável de ambiente :envvar:`PYTHONBREAKPOINT`. " +"Veja :func:`sys.breakpointhook` para detalhes de uso." -#: ../../library/functions.rst:177 +#: ../../builtins/functions.rst:179 msgid "" "Note that this is not guaranteed if :func:`sys.breakpointhook` has been " "replaced." @@ -580,7 +607,7 @@ msgstr "" "Observe que isso não é garantido se :func:`sys.breakpointhook` tiver sido " "substituído." -#: ../../library/functions.rst:180 +#: ../../builtins/functions.rst:182 msgid "" "Raises an :ref:`auditing event ` ``builtins.breakpoint`` with " "argument ``breakpointhook``." @@ -588,7 +615,7 @@ msgstr "" "Levanta um :ref:`evento de auditoria ` ``builtins.breakpoint`` com " "o argumento ``breakpointhook``." -#: ../../library/functions.rst:190 +#: ../../builtins/functions.rst:191 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 " @@ -601,7 +628,7 @@ msgstr "" "mutable`, assim como a maior parte dos métodos que o tipo :class:`bytes` " "tem, veja :ref:`bytes-methods`." -#: ../../library/functions.rst:195 +#: ../../builtins/functions.rst:196 msgid "" "The optional *source* parameter can be used to initialize the array in a few " "different ways:" @@ -609,7 +636,7 @@ msgstr "" "O parâmetro opcional *source* pode ser usado para inicializar o vetor de " "algumas maneiras diferentes:" -#: ../../library/functions.rst:198 +#: ../../builtins/functions.rst:199 msgid "" "If it is a *string*, you must also give the *encoding* (and optionally, " "*errors*) parameters; :func:`bytearray` then converts the string to bytes " @@ -619,7 +646,7 @@ msgstr "" "opcionalmente, *errors*); :func:`bytearray` então converte a string para " "bytes usando :meth:`str.encode`." -#: ../../library/functions.rst:202 +#: ../../builtins/functions.rst:203 msgid "" "If it is an *integer*, the array will have that size and will be initialized " "with null bytes." @@ -627,7 +654,7 @@ msgstr "" "Se é um *inteiro*, o vetor terá esse tamanho e será inicializado com bytes " "nulos." -#: ../../library/functions.rst:205 +#: ../../builtins/functions.rst:206 msgid "" "If it is an object conforming to the :ref:`buffer interface " "`, a read-only buffer of the object will be used to " @@ -637,7 +664,7 @@ msgstr "" "`, um buffer somente leitura do objeto será usado para " "inicializar o vetor de bytes." -#: ../../library/functions.rst:208 +#: ../../builtins/functions.rst:209 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." @@ -645,88 +672,89 @@ msgstr "" "Se é um *iterável*, deve ser um iterável de inteiros no intervalo ``0 <= x < " "256``, que serão usados como o conteúdo inicial do vetor." -#: ../../library/functions.rst:211 +#: ../../builtins/functions.rst:212 msgid "Without an argument, an array of size 0 is created." msgstr "Sem nenhum argumento, um vetor de tamanho 0 é criado." -#: ../../library/functions.rst:213 +#: ../../builtins/functions.rst:214 msgid "See also :ref:`binaryseq` and :ref:`typebytearray`." msgstr "Veja também :ref:`binaryseq` e :ref:`typebytearray`." -#: ../../library/functions.rst:222 +#: ../../builtins/functions.rst:222 msgid "" "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 " +"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 "" "Retorna um novo objeto \"bytes\" que é uma sequência imutável de inteiros no " -"intervalo ``0 <= x < 256``. :class:`bytes` é uma versão imutável de :class:" -"`bytearray` -- tem os mesmos métodos de objetos imutáveis e o mesmo " -"comportamento de índices e fatiamento." +"intervalo ``0 <= x < 256``. :class:`bytes` é uma versão imutável " +"de :class:`bytearray` -- tem os mesmos métodos de objetos imutáveis e o " +"mesmo comportamento de índices e fatiamento." -#: ../../library/functions.rst:227 +#: ../../builtins/functions.rst:227 msgid "" "Accordingly, constructor arguments are interpreted as for :func:`bytearray`." msgstr "" -"Consequentemente, argumentos do construtor são interpretados como os de :" -"func:`bytearray`." +"Consequentemente, argumentos do construtor são interpretados como os " +"de :func:`bytearray`." -#: ../../library/functions.rst:229 +#: ../../builtins/functions.rst:229 msgid "Bytes objects can also be created with literals, see :ref:`strings`." msgstr "" "Objetos bytes também podem ser criados com literais, veja :ref:`strings`." -#: ../../library/functions.rst:231 +#: ../../builtins/functions.rst:231 msgid "See also :ref:`binaryseq`, :ref:`typebytes`, and :ref:`bytes-methods`." msgstr "" "Veja também :ref:`binaryseq`, :ref:`typebytes`, e :ref:`bytes-methods`." -#: ../../library/functions.rst:236 +#: ../../builtins/functions.rst:236 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." +"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." msgstr "" -"Retorna :const:`True` se o argumento *object* parece ser chamável, :const:" -"`False` caso contrário. Se retorna ``True``, ainda é possível que a chamada " -"falhe, mas se é ``False``, chamar *object* nunca será bem sucedido. Note que " -"classes são chamáveis (chamar uma classe devolve uma nova instância); " -"instâncias são chamáveis se suas classes possuem um método :meth:`~object." -"__call__`." +"Retorna :const:`True` se o argumento *object* parece ser " +"chamável, :const:`False` caso contrário. Se retorna ``True``, ainda é " +"possível que a chamada falhe, mas se é ``False``, chamar *object* nunca será " +"bem sucedido. Note que classes são chamáveis (chamar uma classe devolve uma " +"nova instância); instâncias são chamáveis se suas classes possuem um " +"método :meth:`~object.__call__`." -#: ../../library/functions.rst:242 +#: ../../builtins/functions.rst:242 msgid "" "This function was first removed in Python 3.0 and then brought back in " "Python 3.2." msgstr "Esta função foi removida na versão 3.0, mas retornou no Python 3.2." -#: ../../library/functions.rst:249 +#: ../../builtins/functions.rst:249 msgid "" -"Return the string representing a character whose Unicode code point is the " -"integer *i*. For example, ``chr(97)`` returns the string ``'a'``, while " +"Return the string representing a character with the specified Unicode code " +"point. For example, ``chr(97)`` returns the string ``'a'``, while " "``chr(8364)`` returns the string ``'€'``. This is the inverse of :func:`ord`." msgstr "" -"Retorna o caractere que é apontado pelo inteiro *i* no código Unicode. Por " -"exemplo, ``chr(97)`` retorna a string ``'a'``, enquanto ``chr(8364)`` " -"retorna a string ``'€'``. É o inverso de :func:`ord`." +"Retorna a string representando um caractere com o ponto de código Unicode " +"especificado. Por exemplo, ``chr(97)`` retorna a string ``'a'``, enquanto " +"``chr(8364)`` retorna a string ``'€'``. É o inverso de :func:`ord`." -#: ../../library/functions.rst:253 +#: ../../builtins/functions.rst:253 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." +"base 16). :exc:`ValueError` will be raised if it is outside that range." msgstr "" "O intervalo válido para o argumento vai de 0 até 1.114.111 (0x10FFFF na base " -"16). Será lançada uma exceção :exc:`ValueError` se *i* estiver fora desse " +"16). Será lançada uma exceção :exc:`ValueError` se ele estiver fora desse " "intervalo." -#: ../../library/functions.rst:259 +#: ../../builtins/functions.rst:259 msgid "Transform a method into a class method." msgstr "Transforma um método em um método de classe." -#: ../../library/functions.rst:261 +#: ../../builtins/functions.rst:261 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 " @@ -736,15 +764,25 @@ msgstr "" "exatamente como um método de instância recebe a instância. Para declarar um " "método de classe, faça dessa forma::" -#: ../../library/functions.rst:269 +#: ../../builtins/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): ..." + +#: ../../builtins/functions.rst:269 msgid "" -"The ``@classmethod`` form is a function :term:`decorator` -- see :ref:" -"`function` for details." +"The ``@classmethod`` form is a function :term:`decorator` -- " +"see :ref:`function` for details." msgstr "" "O termo ``@classmethod`` é uma função :term:`decoradora ` -- " "veja :ref:`function` para detalhes." -#: ../../library/functions.rst:272 +#: ../../builtins/functions.rst:272 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 " @@ -756,7 +794,7 @@ msgstr "" "por sua classe. Se um método de classe é chamado por uma classe derivada, o " "objeto da classe derivada é passado como primeiro argumento implícito." -#: ../../library/functions.rst:277 +#: ../../builtins/functions.rst:277 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 " @@ -766,25 +804,26 @@ msgstr "" "você quer saber desses, veja :func:`staticmethod` nesta seção. Para mais " "informações sobre métodos de classe, consulte :ref:`types`." -#: ../../library/functions.rst:281 +#: ../../builtins/functions.rst:281 msgid "" -"Class methods can now wrap other :term:`descriptors ` such as :" -"func:`property`." +"Class methods can now wrap other :term:`descriptors ` such " +"as :func:`property`." msgstr "" "Métodos de classe agora podem envolver outros :term:`descritores " "` tal como :func:`property`." -#: ../../library/functions.rst:285 +#: ../../builtins/functions.rst:285 msgid "" -"Class methods now inherit the method attributes (``__module__``, " -"``__name__``, ``__qualname__``, ``__doc__`` and ``__annotations__``) and " -"have a new ``__wrapped__`` attribute." +"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 "" -"Métodos de classe agora herdam os atributos do método (``__module__``, " -"``__name__``, ``__qualname__``, ``__doc__`` e ``__annotations__``) e têm um " -"novo atributo ``__wrapped__``." +"Métodos de classe agora herdam os atributos do método " +"(:attr:`~function.__module__`, :attr:`~function.__name__`, :attr:`~function.__qualname__`, :attr:`~function.__doc__` " +"e :attr:`~function.__annotations__`) e têm um novo atributo ``__wrapped__``." -#: ../../library/functions.rst:290 +#: ../../builtins/functions.rst:292 msgid "" "Class methods can no longer wrap other :term:`descriptors ` such " "as :func:`property`." @@ -792,7 +831,7 @@ msgstr "" "Métodos de classe não podem mais envolver outros :term:`descritores " "` tal como :func:`property`." -#: ../../library/functions.rst:297 +#: ../../builtins/functions.rst:299 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 " @@ -804,7 +843,7 @@ msgstr "" "string normal, uma string byte, ou um objeto AST. Consulte a documentação do " "módulo :mod:`ast` para saber como trabalhar com objetos AST." -#: ../../library/functions.rst:302 +#: ../../builtins/functions.rst:304 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 (``''`` " @@ -814,7 +853,7 @@ msgstr "" "algum valor reconhecível se isso não foi lido de um arquivo (``''`` " "é comumente usado)." -#: ../../library/functions.rst:306 +#: ../../builtins/functions.rst:308 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 " @@ -828,49 +867,50 @@ msgstr "" "de uma única instrução interativa (neste último caso, instruções que são " "avaliadas para alguma coisa diferente de ``None`` serão exibidas)." -#: ../../library/functions.rst:312 -msgid "" -"The optional arguments *flags* and *dont_inherit* control which :ref:" -"`compiler options ` should be activated and which :ref:" -"`future features ` should be allowed. If neither is present (or both " -"are zero) the code is compiled with the same flags that affect the code that " -"is calling :func:`compile`. If the *flags* argument is given and " -"*dont_inherit* is not (or is zero) then the compiler options and the future " -"statements specified by the *flags* argument are used in addition to those " -"that would be used anyway. If *dont_inherit* is a non-zero integer then the " -"*flags* argument is it -- the flags (future features and compiler options) " -"in the surrounding code are ignored." -msgstr "" -"Os argumentos opcionais *flags* e *dont_inherit* controlam quais :ref:" -"`opções do compilador ` devem ser ativadas e quais :ref:" -"`recursos futuros ` devem ser permitidos. Se nenhum estiver presente " -"(ou ambos forem zero), o código é compilado com os mesmos sinalizadores que " -"afetam o código que está chamando :func:`compile`. Se o argumento *flags* " -"for fornecido e *dont_inherit* não for (ou for zero), as opções do " -"compilador e as instruções futuras especificadas pelo argumento *flags* são " -"usadas além daquelas que seriam usadas de qualquer maneira. Se " +#: ../../builtins/functions.rst:314 +msgid "" +"The optional arguments *flags* and *dont_inherit* control " +"which :ref:`compiler options ` should be activated and " +"which :ref:`future features ` should be allowed. If neither is " +"present (or both are zero) the code is compiled with the same flags that " +"affect the code that is calling :func:`compile`. If the *flags* argument is " +"given and *dont_inherit* is not (or is zero) then the compiler options and " +"the future statements specified by the *flags* argument are used in addition " +"to those that would be used anyway. If *dont_inherit* is a non-zero integer " +"then the *flags* argument is it -- the flags (future features and compiler " +"options) in the surrounding code are ignored." +msgstr "" +"Os argumentos opcionais *flags* e *dont_inherit* controlam " +"quais :ref:`opções do compilador ` devem ser ativadas e " +"quais :ref:`recursos futuros ` devem ser permitidos. Se nenhum " +"estiver presente (ou ambos forem zero), o código é compilado com os mesmos " +"sinalizadores que afetam o código que está chamando :func:`compile`. Se o " +"argumento *flags* for fornecido e *dont_inherit* não for (ou for zero), as " +"opções do compilador e as instruções futuras especificadas pelo argumento " +"*flags* são usadas além daquelas que seriam usadas de qualquer maneira. Se " "*dont_inherit* for um inteiro diferente de zero, então o argumento *flags* é " "-- os sinalizadores (recursos futuros e opções do compilador) no código " "circundante são ignorados." -#: ../../library/functions.rst:323 +#: ../../builtins/functions.rst:325 msgid "" "Compiler options and future statements are specified by bits which can be " "bitwise ORed together to specify multiple options. The bitfield required to " -"specify a given future feature can be found as the :attr:`~__future__." -"_Feature.compiler_flag` attribute on the :class:`~__future__._Feature` " -"instance in the :mod:`__future__` module. :ref:`Compiler flags ` can be found in :mod:`ast` module, with ``PyCF_`` prefix." +"specify a given future feature can be found as " +"the :attr:`~__future__._Feature.compiler_flag` attribute on " +"the :class:`~__future__._Feature` instance in the :mod:`__future__` " +"module. :ref:`Compiler flags ` can be found " +"in :mod:`ast` module, with ``PyCF_`` prefix." msgstr "" "Opções de compilador e instruções futuras são especificadas por bits, assim " "pode ocorrer uma operação *OU* bit a bit para especificar múltiplas " "instruções. O sinalizador necessário para especificar um dado recurso futuro " "pode ser encontrado no atributo :attr:`~__future__._Feature.compiler_flag` " -"na instância :class:`~__future__._Feature` do módulo :mod:`__future__`. :ref:" -"`Sinalizadores de compilador ` podem ser encontrados no " -"módulo :mod:`ast`, com o prefixo ``PyCF_``." +"na instância :class:`~__future__._Feature` do " +"módulo :mod:`__future__`. :ref:`Sinalizadores de compilador ` podem ser encontrados no módulo :mod:`ast`, com o prefixo ``PyCF_``." -#: ../../library/functions.rst:331 +#: ../../builtins/functions.rst:333 msgid "" "The argument *optimize* specifies the optimization level of the compiler; " "the default value of ``-1`` selects the optimization level of the " @@ -885,23 +925,34 @@ msgstr "" "``__debug__`` é falso) ou ``2`` (strings de documentação também são " "removidas)." -#: ../../library/functions.rst:337 +#: ../../builtins/functions.rst:339 msgid "" "This function raises :exc:`SyntaxError` if the compiled source is invalid, " -"and :exc:`ValueError` if the source contains null bytes." +"including a *source* containing a null character or that cannot be " +"decoded; :exc:`ValueError` if *mode* or *flags* is invalid, or if a string " +"*source* contains surrogate characters; :exc:`MemoryError` " +"or :exc:`RecursionError` if *source* is too complex to parse or compile, for " +"example an expression with many thousands of nested operators; " +"and :exc:`OverflowError` if *source* is too large." msgstr "" -"Essa função levanta :exc:`SyntaxError` se o código para compilar é inválido, " -"e :exc:`ValueError` se o código contém bytes nulos." +"Esta função levanta :exc:`SyntaxError` se o código-fonte compilado for " +"inválido, incluindo um *source* que contenha um caractere nulo ou que não " +"possa ser decodificado; :exc:`ValueError` se o *mode* ou *flags* forem " +"inválidos, ou se uma string *source* contiver caracteres " +"substitutos; :exc:`MemoryError` ou :exc:`RecursionError` se *source* for " +"complexo demais para analisar ou compilar, por exemplo, uma expressão com " +"muitos milhares de operadores alinhados e :exc:`OverflowError` se *source* " +"for muito grande." -#: ../../library/functions.rst:340 +#: ../../builtins/functions.rst:348 msgid "" -"If you want to parse Python code into its AST representation, see :func:`ast." -"parse`." +"If you want to parse Python code into its AST representation, " +"see :func:`ast.parse`." msgstr "" -"Se você quer analisar código Python em sua representação AST, veja :func:" -"`ast.parse`." +"Se você quer analisar código Python em sua representação AST, " +"veja :func:`ast.parse`." -#: ../../library/functions.rst:343 ../../library/functions.rst:345 +#: ../../builtins/functions.rst:351 ../../builtins/functions.rst:353 msgid "" "Raises an :ref:`auditing event ` ``compile`` with arguments " "``source`` and ``filename``. This event may also be raised by implicit " @@ -911,19 +962,19 @@ msgstr "" "argumentos ``source``, ``filename``. Esse evento pode também ser levantando " "por uma compilação implícita." -#: ../../library/functions.rst:351 +#: ../../builtins/functions.rst:359 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 " -"to facilitate detection of incomplete and complete statements in the :mod:" -"`code` module." +"to facilitate detection of incomplete and complete statements in " +"the :mod:`code` module." msgstr "" "Quando compilando uma string com código multi-linhas em modo ``'single'`` ou " "``'eval'``, entrada deve ser terminada por ao menos um caractere de nova " "linhas. Isso é para facilitar a detecção de instruções completas e " "incompletas no módulo :mod:`code`." -#: ../../library/functions.rst:358 +#: ../../builtins/functions.rst:366 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 " @@ -933,7 +984,7 @@ msgstr "" "grande/complexa ao compilar para um objeto AST, devido limitações do tamanho " "da pilha no compilador AST do Python." -#: ../../library/functions.rst:362 +#: ../../builtins/functions.rst:370 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." @@ -942,7 +993,7 @@ msgstr "" "disso, em modo ``'exec'`` a entrada não precisa mais terminar com uma nova " "linha. Também foi adicionado o parâmetro *optimize*." -#: ../../library/functions.rst:366 +#: ../../builtins/functions.rst:374 msgid "" "Previously, :exc:`TypeError` was raised when null bytes were encountered in " "*source*." @@ -950,7 +1001,7 @@ msgstr "" "Anteriormente, :exc:`TypeError` era levantada quando havia bytes nulos em " "*source*." -#: ../../library/functions.rst:370 +#: ../../builtins/functions.rst:378 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``." @@ -959,7 +1010,15 @@ msgstr "" "habilitar o suporte em nível superior a ``await``, ``async for``, e ``async " "with``." -#: ../../library/functions.rst:379 +#: ../../builtins/functions.rst:382 +msgid "" +":exc:`SyntaxError` is raised instead of :exc:`ValueError` when null bytes " +"are encountered in *source*." +msgstr "" +":exc:`SyntaxError` é levantada, em vez de :exc:`ValueError`, quando bytes " +"nulos são encontrados em *source*." + +#: ../../builtins/functions.rst:391 msgid "" "Convert a single string or number to a complex number, or create a complex " "number from real and imaginary parts." @@ -967,12 +1026,48 @@ msgstr "" "Converte uma única string ou número para um número complexo, ou cria um " "número complexo a partir de partes real e imaginária." -#: ../../library/functions.rst:382 ../../library/functions.rst:739 -#: ../../library/functions.rst:985 +#: ../../builtins/functions.rst:394 ../../builtins/functions.rst:768 +#: ../../builtins/functions.rst:1014 msgid "Examples:" msgstr "Exemplos:" -#: ../../library/functions.rst:403 +#: ../../builtins/functions.rst:396 +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)" + +#: ../../builtins/functions.rst:415 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 " @@ -982,9 +1077,9 @@ msgid "" "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:" +"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 "" "Se o argumento for uma string, ele deve conter ou a parte real (com o mesmo " "formato usado em :func:`float`) ou uma parte imaginária (com o mesmo " @@ -993,29 +1088,29 @@ msgstr "" "A string pode opcionalmente ser cercada por espaços em branco e parênteses " "``'('`` e ``')'``, que são ignorados. A string não deve conter espaços em " "branco entre os símbolos ``'+'``, ``'-'``, o sufixo ``'j'`` ou ``'J'``, e o " -"número decimal. Por examplo, ``complex('1+2j')`` é ok, mas ``complex('1 + " +"número decimal. Por exemplo, ``complex('1+2j')`` é ok, mas ``complex('1 + " "2j')`` levanta :exc:`ValueError`. Mais precisamente, após descartar os " "parênteses e os espaços em branco do início e do final, a entrada deve ser " "conforme a regra de produção :token:`~float:complexvalue` da gramática a " "seguir:" -#: ../../library/functions.rst:422 +#: ../../builtins/functions.rst:434 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__`." +"``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 "" "Se o argumento for um número, o construtor serve como uma conversão numérica " "tal qual :class:`int` e :class:`float`. Para um objeto Python ``x`` " -"qualquer, ``complex(x)`` delega para ``x.__complex__()``. Se :meth:`~object." -"__complex__` não está definido então a chamada é repassada para :meth:" -"`~object.__float__`. Se :meth:`!__float__` não está definido então a chamada " -"é, novamente, repassada para :meth:`~object.__index__`." +"qualquer, ``complex(x)`` delega para ``x.__complex__()``. " +"Se :meth:`~object.__complex__` não está definido então a chamada é repassada " +"para :meth:`~object.__float__`. Se :meth:`!__float__` não está definido " +"então a chamada é, novamente, repassada para :meth:`~object.__index__`." -#: ../../library/functions.rst:431 +#: ../../builtins/functions.rst:443 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 " @@ -1034,29 +1129,29 @@ msgstr "" "for um número real, somente a sua parte real é usada nas expressões " "anteriores." -#: ../../library/functions.rst:441 +#: ../../builtins/functions.rst:453 msgid "If all arguments are omitted, returns ``0j``." msgstr "Se todos os argumentos forem omitidos, retorna ``0j``." -#: ../../library/functions.rst:443 +#: ../../builtins/functions.rst:455 msgid "The complex type is described in :ref:`typesnumeric`." msgstr "O tipo complexo está descrito em :ref:`typesnumeric`." -#: ../../library/functions.rst:445 ../../library/functions.rst:791 -#: ../../library/functions.rst:1034 +#: ../../builtins/functions.rst:457 ../../builtins/functions.rst:820 +#: ../../builtins/functions.rst:1063 msgid "Grouping digits with underscores as in code literals is allowed." msgstr "" "Agrupar dígitos com sublinhados como em literais de código é permitido." -#: ../../library/functions.rst:448 +#: ../../builtins/functions.rst:460 msgid "" -"Falls back to :meth:`~object.__index__` if :meth:`~object.__complex__` and :" -"meth:`~object.__float__` are not defined." +"Falls back to :meth:`~object.__index__` if :meth:`~object.__complex__` " +"and :meth:`~object.__float__` are not defined." msgstr "" -"Chamadas para :meth:`~object.__index__` se :meth:`~object.__complex__` e :" -"meth:`~object.__float__` não estão definidas." +"Chamadas para :meth:`~object.__index__` se :meth:`~object.__complex__` " +"e :meth:`~object.__float__` não estão definidas." -#: ../../library/functions.rst:455 +#: ../../builtins/functions.rst:467 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 " @@ -1070,23 +1165,24 @@ msgstr "" "exemplo, ``delattr(x, 'foobar')`` é equivalente a ``del x.foobar``. *name* " "não precisa ser um identificador Python (veja :func:`setattr`)." -#: ../../library/functions.rst:468 +#: ../../builtins/functions.rst:480 msgid "" "Create a new dictionary. The :class:`dict` object is the dictionary class. " -"See :class:`dict` and :ref:`typesmapping` for documentation about this class." +"See also :ref:`typesmapping` for documentation about this class." msgstr "" "Cria um novo dicionário. O objeto :class:`dict` é a classe do dicionário. " -"Veja :class:`dict` e :ref:`typesmapping` para documentação sobre esta classe." +"Veja também :ref:`typesmapping` para documentação sobre esta classe." -#: ../../library/functions.rst:471 +#: ../../builtins/functions.rst:483 msgid "" -"For other containers see the built-in :class:`list`, :class:`set`, and :" -"class:`tuple` classes, as well as the :mod:`collections` module." +"For other containers see the built-in :class:`list`, :class:`set`, " +"and :class:`tuple` classes, as well as the :mod:`collections` module." msgstr "" -"Para outros contêineres, consulte as classes embutidas :class:`list`, :class:" -"`set` e :class:`tuple`, bem como o módulo :mod:`collections`." +"Para outros contêineres, consulte as classes " +"embutidas :class:`list`, :class:`set` e :class:`tuple`, bem como o " +"módulo :mod:`collections`." -#: ../../library/functions.rst:478 +#: ../../builtins/functions.rst:490 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 " @@ -1095,35 +1191,35 @@ msgstr "" "Sem argumentos, devolve a lista de nomes no escopo local atual. Com um " "argumento, tentará devolver uma lista de atributos válidos para esse objeto." -#: ../../library/functions.rst:481 +#: ../../builtins/functions.rst:493 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." +"implement a custom :func:`~object.__getattr__` " +"or :func:`~object.__getattribute__` function to customize the " +"way :func:`dir` reports their attributes." msgstr "" "Se o objeto tiver um método chamado :meth:`~object.__dir__`, esse método " "será chamado e deve devolver a lista de atributos. Isso permite que objetos " -"que implementam uma função personalizada :func:`~object.__getattr__` ou :" -"func:`~object.__getattribute__` personalizem a maneira como :func:`dir` " +"que implementam uma função personalizada :func:`~object.__getattr__` " +"ou :func:`~object.__getattribute__` personalizem a maneira como :func:`dir` " "relata seus atributos." -#: ../../library/functions.rst:488 +#: ../../builtins/functions.rst:500 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__`." +"necessarily complete and may be inaccurate when the object has a " +"custom :func:`~object.__getattr__`." msgstr "" -"Se o objeto não fornecer :meth:`__dir__`, a função tentará o melhor possível " -"para coletar informações do atributo :attr:`~object.__dict__` do objeto, se " -"definido, e do seu objeto de tipo. A lista resultante não está " -"necessariamente completa e pode ser imprecisa quando o objeto possui um :" -"func:`~object.__getattr__` personalizado." +"Se o objeto não fornecer :meth:`~object.__dir__`, a função tentará o melhor " +"possível para coletar informações do atributo :attr:`~object.__dict__` do " +"objeto, se definido, e do seu objeto de tipo. A lista resultante não está " +"necessariamente completa e pode ser imprecisa quando o objeto possui " +"um :func:`~object.__getattr__` personalizado." -#: ../../library/functions.rst:494 +#: ../../builtins/functions.rst:506 msgid "" "The default :func:`dir` mechanism behaves differently with different types " "of objects, as it attempts to produce the most relevant, rather than " @@ -1133,7 +1229,7 @@ msgstr "" "diferentes tipos de objetos, pois tenta produzir as informações mais " "relevantes e não completas:" -#: ../../library/functions.rst:498 +#: ../../builtins/functions.rst:510 msgid "" "If the object is a module object, the list contains the names of the " "module's attributes." @@ -1141,7 +1237,7 @@ msgstr "" "Se o objeto for um objeto de módulo, a lista conterá os nomes dos atributos " "do módulo." -#: ../../library/functions.rst:501 +#: ../../builtins/functions.rst:513 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." @@ -1149,7 +1245,7 @@ msgstr "" "Se o objeto for um objeto de tipo ou classe, a lista conterá os nomes de " "seus atributos e recursivamente os atributos de suas bases." -#: ../../library/functions.rst:504 +#: ../../builtins/functions.rst:516 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 " @@ -1159,11 +1255,11 @@ msgstr "" "dos atributos da classe e recursivamente os atributos das classes base da " "classe." -#: ../../library/functions.rst:508 +#: ../../builtins/functions.rst:520 msgid "The resulting list is sorted alphabetically. For example:" msgstr "A lista resultante é alfabeticamente ordenada. Por exemplo:" -#: ../../library/functions.rst:528 +#: ../../builtins/functions.rst:540 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 " @@ -1178,16 +1274,16 @@ msgstr "" "lançamentos. Por exemplo, os atributos de metaclasse não estão na lista de " "resultados quando o argumento é uma classe." -#: ../../library/functions.rst:538 +#: ../../builtins/functions.rst:550 msgid "" "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-" -"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)``." +"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 "" "Recebe dois números (não complexos) como argumentos e retorna um par de " "números que consiste em seu quociente e resto ao usar a divisão inteira. Com " @@ -1198,95 +1294,117 @@ msgstr "" "qualquer caso, ``q * b + a % b`` está muito próximo de *a*, se ``a % b`` é " "diferente de zero, tem o mesmo sinal que *b* e ``0 <= abs(a % b) < abs(b)``." -#: ../../library/functions.rst:550 +#: ../../builtins/functions.rst:562 msgid "" -"Return an enumerate object. *iterable* must be a sequence, an :term:" -"`iterator`, or some other object which supports iteration. The :meth:" -"`~iterator.__next__` method of the iterator returned by :func:`enumerate` " -"returns a tuple containing a count (from *start* which defaults to 0) and " -"the values obtained from iterating over *iterable*." +"Return an enumerate object. *iterable* must be a sequence, " +"an :term:`iterator`, or some other object which supports iteration. " +"The :meth:`~iterator.__next__` method of the iterator returned " +"by :func:`enumerate` returns a tuple containing a count (from *start* which " +"defaults to 0) and the values obtained from iterating over *iterable*." msgstr "" -"Devolve um objeto enumerado. *iterable* deve ser uma sequência, um :term:" -"`iterador` ou algum outro objeto que suporte a iteração. O método :meth:" -"`~iterator.__next__` do iterador retornado por :func:`enumerate` devolve uma " -"tupla contendo uma contagem (a partir de *start*, cujo padrão é 0) e os " -"valores obtidos na iteração sobre *iterable*." +"Devolve um objeto enumerado. *iterable* deve ser uma sequência, " +"um :term:`iterador` ou algum outro objeto que suporte a iteração. O " +"método :meth:`~iterator.__next__` do iterador retornado " +"por :func:`enumerate` devolve uma tupla contendo uma contagem (a partir de " +"*start*, cujo padrão é 0) e os valores obtidos na iteração sobre *iterable*." -#: ../../library/functions.rst:562 +#: ../../builtins/functions.rst:574 msgid "Equivalent to::" msgstr "Equivalente a::" -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:576 +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" + +#: ../../builtins/functions.rst:0 msgid "Parameters" msgstr "Parâmetros" -#: ../../library/functions.rst:574 +#: ../../builtins/functions.rst:586 msgid "A Python expression." msgstr "Uma expressão Python." -#: ../../library/functions.rst:578 +#: ../../builtins/functions.rst:590 msgid "The global namespace (default: ``None``)." msgstr "O espaço de nomes global (por padrão, ``None``)." -#: ../../library/functions.rst:582 +#: ../../builtins/functions.rst:594 msgid "The local namespace (default: ``None``)." msgstr "O espaço de nomes local (por padrão, ``None``)." -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "Returns" msgstr "Retorna" -#: ../../library/functions.rst:586 +#: ../../builtins/functions.rst:598 msgid "The result of the evaluated expression." msgstr "O resultado da expressão avaliada." -#: ../../library/functions.rst:0 +#: ../../builtins/functions.rst:0 msgid "raises" msgstr "levanta" -#: ../../library/functions.rst:587 +#: ../../builtins/functions.rst:599 msgid "Syntax errors are reported as exceptions." msgstr "Erros de sintaxe são reportados como exceções." -#: ../../library/functions.rst:589 -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 " -"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 "" -"O argumento *expression* é analisado e avaliado como uma expressão Python " -"(tecnicamente falando, uma lista de condições) usando os mapeamentos " -"*globals* e *locals* como espaços de nomes globais e locais. Se o dicionário " -"*globals* estiver presente e não contiver um valor para a chave " -"``__builtins__``, uma referência ao dicionário do módulo embutido :mod:" -"`builtins` será inserida sob essa chave antes de *expression* ser analisado. " -"Dessa forma, você pode controlar quais funções embutidas estão disponíveis " -"para o código executado inserindo seu próprio dicionário ``__builtins__`` em " -"*globals* antes de passá-lo para :func:`eval`. Se o mapeamento *locals* for " -"omitido, o padrão será o dicionário *globals*. Se os dois mapeamentos forem " -"omitidos, a expressão será executada com os *globals* e *locals* no ambiente " -"em que :func:`eval` é chamado. Observe que *eval()* terá acesso a :term:" -"`escopos aninhados ` (não locais) no ambiente anexo somente se " -"eles já forem referenciados pelo escopo que está chamando :func:`eval` (por " -"exemplo, via uma instrução :keyword:`nonlocal`)." - -#: ../../library/functions.rst:605 +#: ../../builtins/functions.rst:603 ../../builtins/functions.rst:669 +msgid "" +"This function executes arbitrary code. Calling it with untrusted user-" +"supplied input will lead to security vulnerabilities." +msgstr "" +"Esta função executa código arbitrário. Chamá-la com entrada fornecida pelo " +"usuário não confiável levará a vulnerabilidades de segurança." + +#: ../../builtins/functions.rst:606 +msgid "" +"The *source* argument is parsed and evaluated as a Python expression " +"(technically speaking, an :ref:`expression list `) using the " +"*globals* and *locals* mappings 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 *source* is parsed. " +"Overriding ``__builtins__`` can be used to restrict or change the available " +"names, but this is **not** a security mechanism: the executed code can still " +"access all builtins. If the *locals* mapping is omitted it defaults to the " +"*globals* dictionary. If both mappings are omitted, the source 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 "" +"O argumento *source* é analisado e avaliado como uma expressão Python " +"(tecnicamente, uma :ref:`lista de expressões`), usando os " +"dicionários *globals* e *locals* como espaços de nomes global e local. Se o " +"dicionário *globals* estiver presente e não contiver um valor para a chave " +"``__builtins__``, uma referência ao dicionário do módulo :mod:`builtins` é " +"inserida sob essa chave antes de *source* ser analisado. A sobrescrita de " +"``__builtins__`` pode ser usada para controlar ou alterar os nomes " +"disponíveis, mas isso **não** é um mecanismo de segurança: o código " +"executado ainda pode acessar todos os embutidos. Se o dicionário *locals* " +"for omitido, o valor predefinido é o dicionário *globals*. Se ambos os " +"mapeamentos forem omitidos, *source* é executado com os *globals* e *locals* " +"do ambiente em que :func:`eval` é chamada. Note que *eval()* só terá acesso " +"aos :term:`escopos aninhados ` (*non-locals*) no ambiente que " +"a contém se eles já estiverem referenciados no escopo que chama :func:`eval` " +"(por exemplo, através de uma instrução :keyword:`nonlocal`)." + +#: ../../builtins/functions.rst:624 msgid "Example:" msgstr "Exemplo:" -#: ../../library/functions.rst:611 +#: ../../builtins/functions.rst:633 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 " @@ -1298,19 +1416,19 @@ msgstr "" "vez de uma string. Se o objeto código foi compilado com ``'exec'`` como o " "argumento *mode*, o valor de retorno de :func:`eval` será ``None``." -#: ../../library/functions.rst:616 +#: ../../builtins/functions.rst:638 msgid "" "Hints: dynamic execution of statements is supported by the :func:`exec` " "function. The :func:`globals` and :func:`locals` functions return the " "current global and local dictionary, respectively, which may be useful to " "pass around for use by :func:`eval` or :func:`exec`." msgstr "" -"Dicas: a execução dinâmica de instruções é suportada pela função :func:" -"`exec`. As funções :func:`globals` e :func:`locals` retornam o dicionário " -"global e local atual, respectivamente, o que pode ser útil para ser usado " -"por :func:`eval` ou :func:`exec`." +"Dicas: a execução dinâmica de instruções é implementada pela " +"função :func:`exec`. As funções :func:`globals` e :func:`locals` retornam os " +"dicionários global e local atuais, respectivamente, o que pode ser útil para " +"serem usados por :func:`eval` ou :func:`exec`." -#: ../../library/functions.rst:621 +#: ../../builtins/functions.rst:643 msgid "" "If the given source is a string, then leading and trailing spaces and tabs " "are stripped." @@ -1318,16 +1436,16 @@ msgstr "" "Se a fonte fornecida for uma string, os espaços e tabulações à esquerda ou à " "direita serão removidos." -#: ../../library/functions.rst:624 +#: ../../builtins/functions.rst:646 msgid "" -"See :func:`ast.literal_eval` for a function that can safely evaluate strings " -"with expressions containing only literals." +"See :func:`ast.literal_eval` for a function to evaluate strings with " +"expressions containing only literals." msgstr "" -"Veja :func:`ast.literal_eval` para uma função que pode avaliar com segurança " -"strings com expressões contendo apenas literais." +"Veja :func:`ast.literal_eval` para uma função para avaliar strings com " +"expressões que contêm apenas literais." -#: ../../library/functions.rst:627 ../../library/functions.rst:629 -#: ../../library/functions.rst:683 ../../library/functions.rst:685 +#: ../../builtins/functions.rst:649 ../../builtins/functions.rst:651 +#: ../../builtins/functions.rst:712 ../../builtins/functions.rst:714 msgid "" "Raises an :ref:`auditing event ` ``exec`` with the code object as " "the argument. Code compilation events may also be raised." @@ -1336,45 +1454,45 @@ msgstr "" "objeto como argumento. Eventos de compilação de código também podem ser " "levantados." -#: ../../library/functions.rst:634 ../../library/functions.rst:705 +#: ../../builtins/functions.rst:656 ../../builtins/functions.rst:734 msgid "The *globals* and *locals* arguments can now be passed as keywords." msgstr "" "Os argumentos *globals* e *locals* podem agora ser passados como argumentos " "nomeados." -#: ../../library/functions.rst:638 ../../library/functions.rst:709 +#: ../../builtins/functions.rst:660 ../../builtins/functions.rst:738 msgid "" "The semantics of the default *locals* namespace have been adjusted as " "described for the :func:`locals` builtin." msgstr "" -"A forma de uso do espaço de nomes *locals* padrão foi ajustado conforme " +"A forma de uso do espaço de nomes *locals* padrão foi ajustada conforme " "descrito na função embutida :func:`locals`." -#: ../../library/functions.rst:645 +#: ../../builtins/functions.rst:672 msgid "" "This function supports dynamic execution of Python code. *source* 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 :" -"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``." +"the section :ref:`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 "" -"Esta função suporta a execução dinâmica de código Python. O parâmetro " +"Esta função permite a execução dinâmica de código Python. O parâmetro " "*source* deve ser ou uma string ou um objeto código. Se for uma string, a " "mesma é analisada como um conjunto de instruções Python, o qual é então " "executado (exceto caso um erro de sintaxe ocorra). [#]_ Se for um objeto " "código, ele é simplesmente executado. Em todos os casos, espera-se que o " -"código a ser executado seja válido como um arquivo de entrada (veja a seção :" -"ref:`file-input` no Manual de Referência). Tenha cuidado, pois as " +"código a ser executado seja válido como um arquivo de entrada (veja a " +"seção :ref:`file-input` no Manual de Referência). Tenha cuidado, pois as " "instruções :keyword:`nonlocal`, :keyword:`yield` e :keyword:`return` não " "podem ser usadas fora das definições de funções mesmo dentro do contexto do " "código passado para a função :func:`exec` . O valor de retorno é sempre " "``None``." -#: ../../library/functions.rst:656 +#: ../../builtins/functions.rst:683 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 " @@ -1390,10 +1508,10 @@ msgstr "" "variáveis globais quanto para locais. Se *globals* e *locals* são " "fornecidos, eles são usados para as variáveis globais e locais, " "respectivamente. Se fornecido, *locals* pode ser qualquer objeto de " -"mapeamento. Lembre que no nível de módulo, globais e locais são o mesmo " +"mapeamento. Lembre que no nível de módulo, globals e locals são o mesmo " "dicionário." -#: ../../library/functions.rst:666 +#: ../../builtins/functions.rst:693 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 " @@ -1401,64 +1519,67 @@ msgid "" "access variables assigned at the top level (as the \"top level\" variables " "are treated as class variables in a class definition)." msgstr "" -"Quando or ``exec`` recebe dois objetos separados como *globals* and " -"*locals*, o código será executado como se estivesse embutido em uma " -"definição de classe. Isso significa que funções e classes definidas no " -"código executado não poderão acessar variáveis que sofreram atribuições no " -"escopo mais externo (pois, em uma definição de classe, tais variáveis seriam " -"tratadas como variáveis de classe)." +"Quando ``exec`` recebe dois objetos separados como *globals* e *locals*, o " +"código será executado como se estivesse embutido em uma definição de classe. " +"Isso significa que funções e classes definidas no código executado não " +"poderão acessar variáveis que sofreram atribuições no escopo mais externo " +"(pois, em uma definição de classe, tais variáveis seriam tratadas como " +"variáveis de classe)." -#: ../../library/functions.rst:672 +#: ../../builtins/functions.rst:699 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:" -"`builtins` is inserted under that key. 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:`exec`." +"``__builtins__``, a reference to the dictionary of the built-in " +"module :mod:`builtins` is inserted under that key. Overriding " +"``__builtins__`` can be used to restrict or change the available names, but " +"this is **not** a security mechanism: the executed code can still access all " +"builtins." msgstr "" -"Se o dicionário *globals* não contém um valor para a chave ``__builtins__``, " -"a referência para o dicionário do módulo embutido :mod:`builtins` é inserido " -"com essa chave. A maneira que você pode controlar quais embutidos estão " -"disponíveis para o código executado é inserindo seu próprio ``__builtins__`` " -"dicionário em *globals* antes de passar para :func:`exec`." +"Se o dicionário *globals* não contiver um valor para a chave " +"``__builtins__``, a referência ao dicionário do módulo " +"embutido :mod:`builtins` é inserida com essa chave. A sobrescrita de " +"``__builtins__`` pode ser usada para controlar ou alterar os nomes " +"disponíveis, mas isso **não** é um mecanismo de segurança: o código " +"executado ainda pode acessar todos os embutidos." -#: ../../library/functions.rst:678 +#: ../../builtins/functions.rst:706 msgid "" "The *closure* argument specifies a closure--a tuple of cellvars. It's only " -"valid when the *object* is a code object containing free variables. The " -"length of the tuple must exactly match the number of free variables " -"referenced by the code object." +"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 "" -"O argumento *closure* especifica um encerramento -- uma tupla de cellvars. " -"Só é válido quando o *objeto* é um objeto código contendo variáveis livres. " -"O comprimento da tupla deve corresponder exatamente ao número de variáveis " -"livres referenciadas pelo objeto código." +"O argumento *closure* especifica uma clausura -- uma tupla de cellvars. Só é " +"válido quando o *objeto* é um objeto código contendo :term:`variáveis livres " +"(de clausura) `. O comprimento da tupla deve corresponder " +"exatamente ao comprimento do atributo :attr:`~codeobject.co_freevars` do " +"objeto código." -#: ../../library/functions.rst:690 +#: ../../builtins/functions.rst:719 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`." msgstr "" -"As funções embutidas :func:`globals` e :func:`locals` devolvem o espaço de " +"As funções embutidas :func:`globals` e :func:`locals` devolvem os espaços de " "nomes global e local, respectivamente, o que pode ser útil para passar " -"adiante e usar como segundo ou terceiro argumento para :func:`exec`." +"adiante e usá-los como segundo ou terceiro argumento para :func:`exec`." -#: ../../library/functions.rst:696 +#: ../../builtins/functions.rst:725 msgid "" "The default *locals* act as described for function :func:`locals` below. " "Pass an explicit *locals* dictionary if you need to see effects of the code " "on *locals* after function :func:`exec` returns." msgstr "" -"*locals* padrão atua como descrito pela função :func:`locals` abaixo. Se " -"você precisa ver efeitos do código em *locals* depois da função :func:`exec` " -"retornar passe um dicionário *locals* explícito." +"*locals* padrão atua como descrito na função :func:`locals` abaixo. Se você " +"precisa ver os efeitos do código em *locals* após a função :func:`exec` " +"retornar, passe um dicionário *locals* explícito." -#: ../../library/functions.rst:700 +#: ../../builtins/functions.rst:729 msgid "Added the *closure* parameter." msgstr "Adicionado o parâmetro *closure*." -#: ../../library/functions.rst:715 +#: ../../builtins/functions.rst:744 msgid "" "Construct an iterator from those elements of *iterable* for which *function* " "is true. *iterable* may be either a sequence, a container which supports " @@ -1471,7 +1592,7 @@ msgstr "" "identidade será usada, isto é, todos os elementos de *iterable* que são " "falsos são removidos." -#: ../../library/functions.rst:721 +#: ../../builtins/functions.rst:750 msgid "" "Note that ``filter(function, iterable)`` is equivalent to the generator " "expression ``(item for item in iterable if function(item))`` if function is " @@ -1483,7 +1604,7 @@ msgstr "" "``None`` e ``(item for item in iterable if item)`` se *function* for " "``None``." -#: ../../library/functions.rst:726 +#: ../../builtins/functions.rst:755 msgid "" "See :func:`itertools.filterfalse` for the complementary function that " "returns elements of *iterable* for which *function* is false." @@ -1491,13 +1612,37 @@ msgstr "" "Veja :func:`itertools.filterfalse` para a função complementar que devolve " "elementos de *iterable* para os quais *function* é falso." -#: ../../library/functions.rst:737 +#: ../../builtins/functions.rst:766 msgid "Return a floating-point number constructed from a number or a string." msgstr "" "Retorna um número de ponto flutuante construído a partir de um número ou " "string." -#: ../../library/functions.rst:754 +#: ../../builtins/functions.rst:770 +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" + +#: ../../builtins/functions.rst:783 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 " @@ -1512,11 +1657,11 @@ msgstr "" "em branco. O sinal opcional pode ser ``'+'`` ou ``'-'``; um sinal ``'+'`` " "não tem efeito no valor produzido. O argumento também pode ser uma string " "representando um NaN (não um número) ou infinito positivo ou negativo. Mais " -"precisamente, a entrada deve estar de acordo com a regra de produção :token:" -"`~float:floatvalue` na seguinte gramática, depois que os espaços em branco " -"iniciais e finais forem removidos:" +"precisamente, a entrada deve estar de acordo com a regra de " +"produção :token:`~float:floatvalue` na seguinte gramática, depois que os " +"espaços em branco iniciais e finais forem removidos:" -#: ../../library/functions.rst:775 +#: ../../builtins/functions.rst:804 msgid "" "Case is not significant, so, for example, \"inf\", \"Inf\", \"INFINITY\", " "and \"iNfINity\" are all acceptable spellings for positive infinity." @@ -1525,7 +1670,7 @@ msgstr "" "\"INFINITY\" e \"iNfINity\" são todas grafias aceitáveis para o infinito " "positivo." -#: ../../library/functions.rst:778 +#: ../../builtins/functions.rst:807 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 " @@ -1537,25 +1682,25 @@ msgstr "" "flutuante de Python) é retornado. Se o argumento está fora do intervalo de " "um ponto flutuante Python, uma exceção :exc:`OverflowError` será lançada." -#: ../../library/functions.rst:783 +#: ../../builtins/functions.rst:812 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__`." +"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__`." msgstr "" -"Para um objeto Python genérico ``x``, ``float(x)`` delega para o método ``x." -"__float__()``. Se :meth:`~object.__float__` não estiver definido, então ele " -"delega para o método :meth:`~object.__index__`." +"Para um objeto Python genérico ``x``, ``float(x)`` delega para o método " +"``x.__float__()``. Se :meth:`~object.__float__` não estiver definido, então " +"ele delega para o método :meth:`~object.__index__`." -#: ../../library/functions.rst:787 +#: ../../builtins/functions.rst:816 msgid "If no argument is given, ``0.0`` is returned." msgstr "Se nenhum argumento for fornecido, será retornado ``0.0``." -#: ../../library/functions.rst:789 +#: ../../builtins/functions.rst:818 msgid "The float type is described in :ref:`typesnumeric`." msgstr "O tipo float é descrito em :ref:`typesnumeric`." -#: ../../library/functions.rst:797 +#: ../../builtins/functions.rst:826 msgid "" "Falls back to :meth:`~object.__index__` if :meth:`~object.__float__` is not " "defined." @@ -1563,7 +1708,7 @@ msgstr "" "Chamada para :meth:`~object.__index__` se :meth:`~object.__float__` não está " "definido." -#: ../../library/functions.rst:807 +#: ../../builtins/functions.rst:836 msgid "" "Convert a *value* to a \"formatted\" representation, as controlled by " "*format_spec*. The interpretation of *format_spec* will depend on the type " @@ -1575,7 +1720,7 @@ msgstr "" "argumento *value*; no entanto há uma sintaxe de formatação padrão usada pela " "maioria dos tipos embutidos: :ref:`formatspec`." -#: ../../library/functions.rst:812 +#: ../../builtins/functions.rst:841 msgid "" "The default *format_spec* is an empty string which usually gives the same " "effect as calling :func:`str(value) `." @@ -1583,23 +1728,23 @@ msgstr "" "O *format_spec* padrão é uma string vazia que geralmente produz o mesmo " "efeito que chamar :func:`str(value) `." -#: ../../library/functions.rst:815 +#: ../../builtins/functions.rst:844 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." +"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." msgstr "" -"Uma chamada de ``format(value, format_spec)`` é convertida em ``type(value)." -"__format__(value, format_spec)``, que ignora o dicionário da instância ao " -"pesquisar o método :meth:`~object.__format__` de ``value``. Uma exceção :exc:" -"`TypeError` é levantada se a pesquisa do método atingir :mod:`object` e o " -"*format_spec* não estiver vazio, ou se o *format_spec* ou o valor de retorno " -"não forem strings." +"Uma chamada de ``format(value, format_spec)`` é convertida em " +"``type(value).__format__(value, format_spec)``, que ignora o dicionário da " +"instância ao pesquisar o método :meth:`~object.__format__` de ``value``. Uma " +"exceção :exc:`TypeError` é levantada se a pesquisa do método " +"atingir :mod:`object` e o *format_spec* não estiver vazio, ou se o " +"*format_spec* ou o valor de retorno não forem strings." -#: ../../library/functions.rst:822 +#: ../../builtins/functions.rst:851 msgid "" "``object().__format__(format_spec)`` raises :exc:`TypeError` if " "*format_spec* is not an empty string." @@ -1607,26 +1752,27 @@ msgstr "" "``object().__format__(format_spec)`` levanta um :exc:`TypeError` se " "*format_spec* não for uma string vazia." -#: ../../library/functions.rst:831 +#: ../../builtins/functions.rst:860 msgid "" "Return a new :class:`frozenset` object, optionally with elements taken from " -"*iterable*. ``frozenset`` is a built-in class. See :class:`frozenset` and :" -"ref:`types-set` for documentation about this class." +"*iterable*. :class:`frozenset` is a built-in class. See also :ref:`types-" +"set` for documentation about this class." msgstr "" -"Devolve um novo objeto :class:`frozenset`, opcionalmente com elementos " -"obtidos de *iterable*. ``frozenset`` é uma classe embutida. Veja :class:" -"`frozenset` e :ref:`types-set` para documentação sobre essas classes." +"Retorna um novo objeto :class:`frozenset`, opcionalmente com elementos " +"obtidos de *iteráveis*. :class:`frozenset` é uma classe embutida. Veja " +"também :ref:`types-set` para documentação sobre essa classe." -#: ../../library/functions.rst:835 +#: ../../builtins/functions.rst:864 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." +"For other containers see the built-" +"in :class:`set`, :class:`list`, :class:`tuple`, and :class:`dict` classes, " +"as well as the :mod:`collections` module." msgstr "" -"Para outros contêineres veja as classes embutidas :class:`set`, :class:" -"`list`, :class:`tuple`, e :class:`dict`, assim como o módulo :mod:" -"`collections`." +"Para outros contêineres veja as classes " +"embutidas :class:`set`, :class:`list`, :class:`tuple`, e :class:`dict`, " +"assim como o módulo :mod:`collections`." -#: ../../library/functions.rst:843 +#: ../../builtins/functions.rst:872 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 " @@ -1637,24 +1783,24 @@ msgid "" msgstr "" "Devolve o valor do atributo *name* de *object*. *name* deve ser uma string. " "Se a string é o nome de um dos atributos do objeto, o resultado é o valor de " -"tal atributo. Por exemplo, ``getattr(x, 'foobar')`` é equivalente a ``x." -"foobar``. Se o atributo não existir, *default* é devolvido se tiver sido " +"tal atributo. Por exemplo, ``getattr(x, 'foobar')`` é equivalente a " +"``x.foobar``. Se o atributo não existir, *default* é devolvido se tiver sido " "fornecido, caso contrário a exceção :exc:`AttributeError` é levantada. " "*name* não precisa ser um identificador Python (veja :func:`setattr`)." -#: ../../library/functions.rst:852 +#: ../../builtins/functions.rst:881 msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " -"with two leading underscores) name in order to retrieve it with :func:" -"`getattr`." +"with two leading underscores) name in order to retrieve it " +"with :func:`getattr`." msgstr "" "Uma vez que :ref:`desfiguração de nome privado ` " "acontece em tempo de compilação, deve-se manualmente mutilar o nome de um " "atributo privado (atributos com dois sublinhados à esquerda) para recuperá-" "lo com :func:`getattr`." -#: ../../library/functions.rst:860 +#: ../../builtins/functions.rst:889 msgid "" "Return the dictionary implementing the current module namespace. For code " "within functions, this is set when the function is defined and remains the " @@ -1664,7 +1810,7 @@ msgstr "" "código dentro de funções, isso é definido quando a função é definida e " "permanece o mesmo, independentemente de onde a função é chamada." -#: ../../library/functions.rst:867 +#: ../../builtins/functions.rst:896 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. " @@ -1673,10 +1819,10 @@ msgid "" msgstr "" "Os argumentos são um objeto e uma string. O resultado é ``True`` se a string " "é o nome de um dos atributos do objeto, e ``False`` se ela não for. (Isto é " -"implementado chamando ``getattr(object, name)`` e vendo se levanta um :exc:" -"`AttributeError` ou não.)" +"implementado chamando ``getattr(object, name)`` e vendo se levanta " +"um :exc:`AttributeError` ou não.)" -#: ../../library/functions.rst:875 +#: ../../builtins/functions.rst:904 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 " @@ -1689,16 +1835,17 @@ msgstr "" "comparados são iguais, possuem o mesmo valor hash (mesmo que eles sejam de " "tipos diferentes, como é o caso de 1 e 1.0)." -#: ../../library/functions.rst:882 +#: ../../builtins/functions.rst:911 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:`~object.__hash__` methods, note " +"that :func:`hash` truncates the return value based on the bit width of the " +"host machine." msgstr "" "Para objetos com métodos :meth:`~object.__hash__` personalizados, fique " "atento que :func:`hash` trunca o valor devolvido baseado no comprimento de " "bits da máquina hospedeira." -#: ../../library/functions.rst:889 +#: ../../builtins/functions.rst:918 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 " @@ -1715,7 +1862,7 @@ msgstr "" "console. Se o argumento é qualquer outro tipo de objeto, uma página de ajuda " "para o objeto é gerada." -#: ../../library/functions.rst:896 +#: ../../builtins/functions.rst:925 msgid "" "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 " @@ -1727,13 +1874,13 @@ msgstr "" "barra são apenas posicionais. Para mais informações, veja :ref:`a entrada no " "FAQ sobre parâmetros somente-posicionais `." -#: ../../library/functions.rst:901 +#: ../../builtins/functions.rst:930 msgid "" "This function is added to the built-in namespace by the :mod:`site` module." msgstr "" "Esta função é adicionada ao espaço de nomes embutido pelo módulo :mod:`site`." -#: ../../library/functions.rst:903 +#: ../../builtins/functions.rst:932 msgid "" "Changes to :mod:`pydoc` and :mod:`inspect` mean that the reported signatures " "for callables are now more comprehensive and consistent." @@ -1741,18 +1888,18 @@ msgstr "" "Mudanças em :mod:`pydoc` e :mod:`inspect` significam que as assinaturas " "reportadas para chamáveis agora são mais compreensíveis e consistentes." -#: ../../library/functions.rst:910 +#: ../../builtins/functions.rst:939 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:" +"\"0x\". If *integer* is not a Python :class:`int` object, it has to define " +"an :meth:`~object.__index__` method that returns an integer. Some examples:" msgstr "" "Converte um número inteiro para uma string hexadecimal em letras minúsculas " -"pré-fixada com \"0x\". Se *x* não é um objeto :class:`int` do Python, ele " -"tem que definir um método :meth:`~object.__index__` que retorne um inteiro. " -"Alguns exemplos:" +"prefixada com \"0x\". Se *integer* não é um objeto :class:`int` do Python, " +"ele tem que definir um método :meth:`~object.__index__` que retorne um " +"inteiro. Alguns exemplos:" -#: ../../library/functions.rst:919 +#: ../../builtins/functions.rst:948 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 " @@ -1762,7 +1909,7 @@ msgstr "" "letras maiúsculas ou minúsculas, com prefixo ou sem, você pode usar qualquer " "uma das seguintes maneiras:" -#: ../../library/functions.rst:931 +#: ../../builtins/functions.rst:960 msgid "" "See also :func:`int` for converting a hexadecimal string to an integer using " "a base of 16." @@ -1770,15 +1917,15 @@ msgstr "" "Veja também :func:`int` para converter uma string hexadecimal para um " "inteiro usando a base 16." -#: ../../library/functions.rst:936 +#: ../../builtins/functions.rst:965 msgid "" -"To obtain a hexadecimal string representation for a float, use the :meth:" -"`float.hex` method." +"To obtain a hexadecimal string representation for a float, use " +"the :meth:`float.hex` method." msgstr "" -"Para obter uma string hexadecimal de um ponto flutuante, use o método :meth:" -"`float.hex`." +"Para obter uma string hexadecimal de um ponto flutuante, use o " +"método :meth:`float.hex`." -#: ../../library/functions.rst:942 +#: ../../builtins/functions.rst:971 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. " @@ -1790,11 +1937,11 @@ msgstr "" "vida. Dois objetos com ciclos de vida não sobrepostos podem ter o mesmo " "valor para :func:`id`." -#: ../../library/functions.rst:947 +#: ../../builtins/functions.rst:976 msgid "This is the address of the object in memory." msgstr "Este é o endereço do objeto na memória." -#: ../../library/functions.rst:949 +#: ../../builtins/functions.rst:978 msgid "" "Raises an :ref:`auditing event ` ``builtins.id`` with argument " "``id``." @@ -1802,7 +1949,7 @@ msgstr "" "Levanta um :ref:`evento de auditoria ` ``builtins.id`` com o " "argumento ``id``." -#: ../../library/functions.rst:955 +#: ../../builtins/functions.rst:984 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, " @@ -1815,7 +1962,19 @@ msgstr "" "final), e devolve isso. Quando o final do arquivo (EOF / end-of-file) é " "encontrado, um erro :exc:`EOFError` é levantado. Exemplo::" -#: ../../library/functions.rst:965 +#: ../../builtins/functions.rst:989 +msgid "" +">>> s = input('--> ')\n" +"--> Monty Python's Flying Circus\n" +">>> s\n" +"\"Monty Python's Flying Circus\"" +msgstr "" +">>> s = input('--> ')\n" +"--> Monty Python's Flying Circus\n" +">>> s\n" +"\"Monty Python's Flying Circus\"" + +#: ../../builtins/functions.rst:994 msgid "" "If the :mod:`readline` module was loaded, then :func:`input` will use it to " "provide elaborate line editing and history features." @@ -1823,7 +1982,7 @@ msgstr "" "Se o módulo :mod:`readline` foi carregado, então :func:`input` usará ele " "para prover edição de linhas elaboradas e funcionalidades de histórico." -#: ../../library/functions.rst:968 ../../library/functions.rst:970 +#: ../../builtins/functions.rst:997 ../../builtins/functions.rst:999 msgid "" "Raises an :ref:`auditing event ` ``builtins.input`` with argument " "``prompt`` before reading input" @@ -1831,7 +1990,7 @@ msgstr "" "Levanta um :ref:`evento de auditoria ` ``builtins.input`` com " "argumento ``prompt`` antes de ler a entrada." -#: ../../library/functions.rst:973 ../../library/functions.rst:975 +#: ../../builtins/functions.rst:1002 ../../builtins/functions.rst:1004 msgid "" "Raises an :ref:`auditing event ` ``builtins.input/result`` with " "the result after successfully reading input." @@ -1839,7 +1998,7 @@ msgstr "" "Levanta um :ref:`evento de auditoria ` ``builtins.input/result`` " "com o resultado depois de ler a entrada com sucesso." -#: ../../library/functions.rst:982 +#: ../../builtins/functions.rst:1011 msgid "" "Return an integer object constructed from a number or a string, or return " "``0`` if no arguments are given." @@ -1847,21 +2006,49 @@ msgstr "" "Retorna um objeto do tipo inteiro construído a partir de um número ou " "string, ou retorna ``0`` caso nenhum argumento seja passado." -#: ../../library/functions.rst:1002 -msgid "" -"If the argument defines :meth:`~object.__int__`, ``int(x)`` returns ``x." -"__int__()``. If the argument defines :meth:`~object.__index__`, it returns " -"``x.__index__()``. If the argument defines :meth:`~object.__trunc__`, it " -"returns ``x.__trunc__()``. For floating-point numbers, this truncates " -"towards zero." +#: ../../builtins/functions.rst:1016 +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" + +#: ../../builtins/functions.rst:1031 +msgid "" +"If the argument defines :meth:`~object.__int__`, ``int(x)`` returns " +"``x.__int__()``. If the argument defines :meth:`~object.__index__`, it " +"returns ``x.__index__()``. If the argument " +"defines :meth:`~object.__trunc__`, it returns ``x.__trunc__()``. For " +"floating-point numbers, this truncates towards zero." msgstr "" "Se o argumento definir um método :meth:`~object.__int__`, então ``int(x)`` " "retorna ``x.__int__()``. Se *x* definir um método :meth:`~object.__index__`, " -"então ele retorna ``x.__index__()``. Se o argumento definir um método :meth:" -"`~object.__trunc__`, então ele retorna ``x.__trunc__()``. Para números de " -"ponto flutuante, isto trunca o número na direção do zero." +"então ele retorna ``x.__index__()``. Se o argumento definir um " +"método :meth:`~object.__trunc__`, então ele retorna ``x.__trunc__()``. Para " +"números de ponto flutuante, isto trunca o número na direção do zero." -#: ../../library/functions.rst:1008 +#: ../../builtins/functions.rst:1037 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 " @@ -1870,13 +2057,13 @@ msgid "" "whitespace, and have single underscores interspersed between digits." msgstr "" "Se o argumento não for um número ou se *base* for fornecido, então o " -"argumento deve ser uma instância de string, :class:`bytes` ou :class:" -"`bytearray` representando um inteiro na base *base*. Opcionalmente, a string " -"pode ser precedida por ``+`` ou ``-`` (sem espaço entre eles), ter zeros à " -"esquerda, estar entre espaços em branco e ter sublinhados simples " -"intercalados entre os dígitos." +"argumento deve ser uma instância de string, :class:`bytes` " +"ou :class:`bytearray` representando um inteiro na base *base*. " +"Opcionalmente, a string pode ser precedida por ``+`` ou ``-`` (sem espaço " +"entre eles), ter zeros à esquerda, estar entre espaços em branco e ter " +"sublinhados simples intercalados entre os dígitos." -#: ../../library/functions.rst:1014 +#: ../../builtins/functions.rst:1043 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 " @@ -1901,28 +2088,28 @@ msgstr "" "permite zeros à esquerda: ``int('010', 0)`` não é válido, enquanto " "``int('010')`` e ``int('010', 8)`` são." -#: ../../library/functions.rst:1025 +#: ../../builtins/functions.rst:1054 msgid "The integer type is described in :ref:`typesnumeric`." msgstr "O tipo inteiro está descrito em :ref:`typesnumeric`." -#: ../../library/functions.rst:1027 +#: ../../builtins/functions.rst:1056 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 " +"If *base* is not an instance of :class:`int` and the *base* object has " +"a :meth:`base.__index__ ` method, that method is called to " "obtain an integer for the base. Previous versions used :meth:`base.__int__ " "` instead of :meth:`base.__index__ `." msgstr "" "Se *base* não é uma instância de :class:`int` e o objeto *base* tem um " "método :meth:`base.__index__ `, então esse método é " -"chamado para obter um inteiro para a base. Versões anteriores usavam :meth:" -"`base.__int__ ` ao invés de :meth:`base.__index__ `." +"chamado para obter um inteiro para a base. Versões anteriores " +"usavam :meth:`base.__int__ ` ao invés " +"de :meth:`base.__index__ `." -#: ../../library/functions.rst:1037 +#: ../../builtins/functions.rst:1066 msgid "The first parameter is now positional-only." msgstr "O primeiro parâmetro agora é somente-posicional." -#: ../../library/functions.rst:1040 +#: ../../builtins/functions.rst:1069 msgid "" "Falls back to :meth:`~object.__index__` if :meth:`~object.__int__` is not " "defined." @@ -1930,27 +2117,28 @@ msgstr "" "Chamada para :meth:`~object.__index__` se :meth:`~object.__int__` não está " "definido." -#: ../../library/functions.rst:1043 +#: ../../builtins/functions.rst:1072 msgid "The delegation to :meth:`~object.__trunc__` is deprecated." msgstr "A delegação de :meth:`~object.__trunc__` foi descontinuada." -#: ../../library/functions.rst:1046 +#: ../../builtins/functions.rst:1075 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 ` " +"converting an :class:`int` into a string would exceed the limit. See " +"the :ref:`integer string conversion length limitation ` " "documentation." msgstr "" "Entradas de strings para :class:`int` e representações em strings podem ser " -"limitadas para ajudar a evitar ataques de negação de serviço. Uma exceção :" -"exc:`ValueError` é levantada quando o limite é excedido durante a conversão " -"de uma string em um :class:`int` ou quando a conversão de um :class:`int` em " -"uma string excede o limite. Consulte a documentação sobre :ref:`limitação de " -"comprimento de conversão de string em inteiro `." +"limitadas para ajudar a evitar ataques de negação de serviço. Uma " +"exceção :exc:`ValueError` é levantada quando o limite é excedido durante a " +"conversão de uma string em um :class:`int` ou quando a conversão de " +"um :class:`int` em uma string excede o limite. Consulte a documentação " +"sobre :ref:`limitação de comprimento de conversão de string em inteiro " +"`." -#: ../../library/functions.rst:1056 +#: ../../builtins/functions.rst:1086 msgid "" "Return ``True`` if the *object* argument is an instance of the *classinfo* " "argument, or of a (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 (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." msgstr "" -"Retorna ``True`` se *class* for uma subclasse (direta, indireta ou :term:" -"`virtual `) de *classinfo*. Uma classe é considerada " -"uma subclasse de si mesma. *classinfo* pode ser uma tupla de objetos de " -"classe (ou recursivamente, outras tuplas) ou um :ref:`types-union`, caso em " -"que retorna ``True`` se *class* for uma subclasse de qualquer entrada em " -"*classinfo*. Em qualquer outro caso, é levantada uma exceção :exc:" -"`TypeError`." +"Retorna ``True`` se *class* for uma subclasse (direta, indireta " +"ou :term:`virtual `) de *classinfo*. Uma classe é " +"considerada uma subclasse de si mesma. *classinfo* pode ser uma tupla de " +"objetos de classe (ou recursivamente, outras tuplas) ou um :ref:`types-" +"union`, caso em que retorna ``True`` se *class* for uma subclasse de " +"qualquer entrada em *classinfo*. Em qualquer outro caso, é levantada uma " +"exceção :exc:`TypeError`." -#: ../../library/functions.rst:1088 +#: ../../builtins/functions.rst:1118 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 " +"second argument, the single argument 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 the first " +"argument must be a callable object. The iterator created in this case will " +"call *callable* 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 "" "Retorna um objeto :term:`iterador`. O primeiro argumento é interpretado " "muito diferentemente dependendo da presença do segundo argumento. Sem um " -"segundo argumento, *object* deve ser uma coleção de objetos com suporte ao " -"protocolo :term:`iterável` (o método :meth:`~object.__iter__`), ou ele deve " -"ter suporte ao protocolo de sequência (o método :meth:`~object.__getitem__` " -"com argumentos inteiros começando em ``0``). Se ele não tem suporte nenhum " -"desses protocolos, uma :exc:`TypeError` é levantada. Se o segundo argumento, " -"*sentinel*, é fornecido, então *object* deve ser um objeto chamável. O " -"iterador criado neste caso irá chamar *object* sem nenhum argumento para " +"segundo argumento, o primeiro argumento deve ser uma coleção de objetos com " +"suporte ao protocolo :term:`iterável` (o método :meth:`~object.__iter__`), " +"ou ele deve ter suporte ao protocolo de sequência (o " +"método :meth:`~object.__getitem__` com argumentos inteiros começando em " +"``0``). Se ele não tem suporte nenhum desses protocolos, " +"uma :exc:`TypeError` é levantada. Se o segundo argumento, *sentinel*, é " +"fornecido, então o primeiro argumento deve ser um objeto chamável. O " +"iterador criado neste caso irá chamar *callable* sem nenhum argumento para " "cada chamada para o seu método :meth:`~iterator.__next__`; se o valor " "devolvido é igual a *sentinel*, então :exc:`StopIteration` será levantado, " "caso contrário o valor será devolvido." -#: ../../library/functions.rst:1102 +#: ../../builtins/functions.rst:1132 msgid "See also :ref:`typeiter`." msgstr "Veja também :ref:`typeiter`." -#: ../../library/functions.rst:1104 +#: ../../builtins/functions.rst:1134 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 " @@ -2035,7 +2225,19 @@ msgstr "" "bloco de leitura. Por exemplo, ler blocos de comprimento fixo de um arquivo " "binário de banco de dados até que o final do arquivo seja atingido::" -#: ../../library/functions.rst:1116 +#: ../../builtins/functions.rst:1138 +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('meusdados.db', 'rb') as f:\n" +" for bloco in iter(partial(f.read, 64), b''):\n" +" process_block(bloco)" + +#: ../../builtins/functions.rst:1146 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 " @@ -2045,15 +2247,15 @@ msgstr "" "uma sequência (tal como uma string, bytes, tupla, lista, ou um intervalo) ou " "uma coleção (tal como um dicionário, conjunto, ou conjunto imutável)." -#: ../../library/functions.rst:1122 +#: ../../builtins/functions.rst:1152 msgid "" -"``len`` raises :exc:`OverflowError` on lengths larger than :data:`sys." -"maxsize`, such as :class:`range(2 ** 100) `." +"``len`` raises :exc:`OverflowError` on lengths larger " +"than :data:`sys.maxsize`, such as :class:`range(2 ** 100) `." msgstr "" -"``len`` levanta :exc:`OverflowError` em tamanhos maiores que :data:`sys." -"maxsize`, tal como :class:`range(2 ** 100) `." +"``len`` levanta :exc:`OverflowError` em tamanhos maiores " +"que :data:`sys.maxsize`, tal como :class:`range(2 ** 100) `." -#: ../../library/functions.rst:1131 +#: ../../builtins/functions.rst:1160 msgid "" "Rather than being a function, :class:`list` is actually a mutable sequence " "type, as documented in :ref:`typesseq-list` and :ref:`typesseq`." @@ -2061,7 +2263,7 @@ msgstr "" "Ao invés de ser uma função, :class:`list` é na verdade um tipo de sequência " "mutável, conforme documentado em :ref:`typesseq-list` e :ref:`typesseq`." -#: ../../library/functions.rst:1137 +#: ../../builtins/functions.rst:1166 msgid "" "Return a mapping object representing the current local symbol table, with " "variable names as the keys, and their currently bound references as the " @@ -2071,17 +2273,17 @@ msgstr "" "com nomes de variáveis como as chaves, e as referências às quais cada " "variável está atrelada no momento como os valores." -#: ../../library/functions.rst:1141 +#: ../../builtins/functions.rst:1170 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`." +"single namespace, this function returns the same namespace " +"as :func:`globals`." msgstr "" -"Em um escopo de módulo, assim como quando usando :func:`exec` ou :func:" -"`eval` com um único espaço de nomes, esta função retorna o mesmo espaço de " -"nomes que :func:`globals`." +"Em um escopo de módulo, assim como quando usando :func:`exec` " +"ou :func:`eval` com um único espaço de nomes, esta função retorna o mesmo " +"espaço de nomes que :func:`globals`." -#: ../../library/functions.rst:1145 +#: ../../builtins/functions.rst:1174 msgid "" "At class scope, it returns the namespace that will be passed to the " "metaclass constructor." @@ -2089,7 +2291,7 @@ msgstr "" "Em um escopo de classe, ela retorna o espaço de nomes que será passado para " "o construtor da metaclasse." -#: ../../library/functions.rst:1148 +#: ../../builtins/functions.rst:1177 msgid "" "When using ``exec()`` or ``eval()`` with separate local and global " "arguments, it returns the local namespace passed in to the function call." @@ -2097,7 +2299,7 @@ msgstr "" "Quando usando ``exec()`` ou ``eval()`` com argumentos de espaço local e " "global distintos, ela retorna o espaço de nomes local passado na chamada." -#: ../../library/functions.rst:1151 +#: ../../builtins/functions.rst:1180 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 " @@ -2113,7 +2315,7 @@ msgstr "" "reatribuir ou deletar variáveis locais afetará imediatamente o conteúdo do " "objeto de mapeamento retornado." -#: ../../library/functions.rst:1158 +#: ../../builtins/functions.rst:1187 msgid "" "In an :term:`optimized scope` (including functions, generators, and " "coroutines), each call to ``locals()`` instead returns a fresh dictionary " @@ -2134,7 +2336,7 @@ msgstr "" "células com referências não-locais *não* afeta o conteúdo dos dicionários " "que já foram retornados." -#: ../../library/functions.rst:1167 +#: ../../builtins/functions.rst:1196 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 " @@ -2148,7 +2350,7 @@ msgstr "" "compreensão serão incluídas. Em outros escopos, essa função se comporta como " "se a compreensão estivesse executando como uma função aninhada." -#: ../../library/functions.rst:1173 +#: ../../builtins/functions.rst:1202 msgid "" "Calling ``locals()`` as part of a generator expression is equivalent to " "calling it in a nested generator function." @@ -2156,7 +2358,7 @@ msgstr "" "Chamar a função ``locals()`` como parte de uma expressão geradora é " "equivalente a chamá-la em uma função geradora aninhada." -#: ../../library/functions.rst:1176 +#: ../../builtins/functions.rst:1205 msgid "" "The behaviour of ``locals()`` in a comprehension has been updated as " "described in :pep:`709`." @@ -2164,21 +2366,21 @@ msgstr "" "O comportamento de ``locals()`` em uma compreensão foi atualizado conforme " "descrito na :pep:`709`." -#: ../../library/functions.rst:1180 +#: ../../builtins/functions.rst:1209 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." +"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." msgstr "" "Como parte da :pep:`667`, o que acontece após a mutação de objetos de " -"mapeamento retornados desta função está agora definido. O comportamento em :" -"term:`escopos otimizados ` agora é o descrito acima. Além " -"de estar definido, o comportamento em outros escopos não foi modificado em " -"relação aos comportamentos em versões passadas." +"mapeamento retornados desta função está agora definido. O comportamento " +"em :term:`escopos otimizados ` agora é o descrito acima. " +"Além de estar definido, o comportamento em outros escopos não foi modificado " +"em relação aos comportamentos em versões passadas." -#: ../../library/functions.rst:1190 +#: ../../builtins/functions.rst:1219 msgid "" "Return an iterator that applies *function* to every item of *iterable*, " "yielding the results. If additional *iterables* arguments are passed, " @@ -2192,17 +2394,17 @@ msgstr "" "*function* deve ter a mesma quantidade de argumentos e ela é aplicada aos " "itens de todos os iteráveis em paralelo. Com múltiplos iteráveis, o iterador " "para quando o iterador mais curto é encontrado. Para casos onde os " -"parâmetros de entrada da função já estão organizados em tuplas, veja :func:" -"`itertools.starmap`\\." +"parâmetros de entrada da função já estão organizados em tuplas, " +"veja :func:`itertools.starmap`\\." -#: ../../library/functions.rst:1202 +#: ../../builtins/functions.rst:1231 msgid "" "Return the largest item in an iterable or the largest of two or more " "arguments." msgstr "" "Devolve o maior item em um iterável ou o maior de dois ou mais argumentos." -#: ../../library/functions.rst:1205 +#: ../../builtins/functions.rst:1234 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 " @@ -2212,13 +2414,13 @@ msgstr "" "maior item no iterável é retornado. Se dois ou mais argumentos posicionais " "são fornecidos, o maior dos argumentos posicionais é devolvido." -#: ../../library/functions.rst:1210 ../../library/functions.rst:1248 +#: ../../builtins/functions.rst:1239 ../../builtins/functions.rst:1277 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 " "*default* argument specifies an object to return if the provided iterable is " -"empty. If the iterable is empty and *default* is not provided, a :exc:" -"`ValueError` is raised." +"empty. If the iterable is empty and *default* is not provided, " +"a :exc:`ValueError` is raised." msgstr "" "Existem dois parâmetros somente-nomeados opcionais. O parâmetro *key* " "especifica uma função de ordenamento de um argumento, como aquelas usadas " @@ -2227,42 +2429,42 @@ msgstr "" "vazio, e *default* não foi fornecido, uma exceção :exc:`ValueError` é " "levantada." -#: ../../library/functions.rst:1216 +#: ../../builtins/functions.rst:1245 msgid "" "If multiple items are maximal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " -"such as ``sorted(iterable, key=keyfunc, reverse=True)[0]`` and ``heapq." -"nlargest(1, iterable, key=keyfunc)``." +"such as ``sorted(iterable, key=keyfunc, reverse=True)[0]`` and " +"``heapq.nlargest(1, iterable, key=keyfunc)``." msgstr "" "Se múltiplos itens são máximos, a função devolve o primeiro encontrado. Isto " "é consistente com outras ferramentas de ordenamento que preservam a " "estabilidade, tais como ``sorted(iterable, key=keyfunc, reverse=True)[0]`` e " "``heapq.nlargest(1, iterable, key=keyfunc)``." -#: ../../library/functions.rst:1221 ../../library/functions.rst:1259 +#: ../../builtins/functions.rst:1250 ../../builtins/functions.rst:1288 msgid "Added the *default* keyword-only parameter." msgstr "Adicionado o parâmetro *default* somente-nomeado." -#: ../../library/functions.rst:1224 ../../library/functions.rst:1262 +#: ../../builtins/functions.rst:1253 ../../builtins/functions.rst:1291 msgid "The *key* can be ``None``." msgstr "O valor de *key* pode ser ``None``." -#: ../../library/functions.rst:1232 +#: ../../builtins/functions.rst:1261 msgid "" -"Return a \"memory view\" object created from the given argument. See :ref:" -"`typememoryview` for more information." +"Return a \"memory view\" object created from the given argument. " +"See :ref:`typememoryview` for more information." msgstr "" "Devolve um objeto de \"visão da memória\" criado a partir do argumento " "fornecido. Veja :ref:`typememoryview` para mais informações." -#: ../../library/functions.rst:1240 +#: ../../builtins/functions.rst:1269 msgid "" "Return the smallest item in an iterable or the smallest of two or more " "arguments." msgstr "" "Devolve o menor item de um iterável ou o menor de dois ou mais argumentos." -#: ../../library/functions.rst:1243 +#: ../../builtins/functions.rst:1272 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 " @@ -2272,7 +2474,7 @@ msgstr "" "menor item no iterável é devolvido. Se dois ou mais argumentos posicionais " "são fornecidos, o menor dos argumentos posicionais é devolvido." -#: ../../library/functions.rst:1254 +#: ../../builtins/functions.rst:1283 msgid "" "If multiple items are minimal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -2281,52 +2483,55 @@ msgid "" msgstr "" "Se múltiplos itens são mínimos, a função devolve o primeiro encontrado. Isto " "é consistente com outras ferramentas de ordenamento que preservam a " -"estabilidade, tais como ``sorted(iterable, key=keyfunc)[0]`` e ``heapq." -"nsmallest(1, iterable, key=keyfunc)``." +"estabilidade, tais como ``sorted(iterable, key=keyfunc)[0]`` e " +"``heapq.nsmallest(1, iterable, key=keyfunc)``." -#: ../../library/functions.rst:1269 +#: ../../builtins/functions.rst:1298 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 :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." msgstr "" -"Recupera o próximo item do :term:`iterador` chamando o seu método :meth:" -"`~iterator.__next__`. Se *default* foi fornecido, ele é devolvido caso o " -"iterável tenha sido percorrido por completo, caso contrário :exc:" -"`StopIteration` é levantada." +"Recupera o próximo item do :term:`iterador` chamando o seu " +"método :meth:`~iterator.__next__`. Se *default* foi fornecido, ele é " +"devolvido caso o iterável tenha sido percorrido por completo, caso " +"contrário :exc:`StopIteration` é levantada." -#: ../../library/functions.rst:1276 +#: ../../builtins/functions.rst:1305 msgid "" -"Return a new featureless object. :class:`object` is a base for all classes. " -"It has methods that are common to all instances of Python classes. This " -"function does not accept any arguments." +"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." msgstr "" -"Devolve um novo objeto sem funcionalidades. :class:`object` é a classe base " -"para todas as classes. Ela tem os métodos que são comuns para todas as " -"instâncias de classes Python. Esta função não aceita nenhum argumento." +"Esta é a classe base definitiva de todas as outras classes. Ela tem métodos " +"que são comuns a todas as instâncias de classes Python. Quando o construtor " +"é chamado, ele retorna um novo objeto sem características. O construtor não " +"aceita nenhum argumento." -#: ../../library/functions.rst:1282 +#: ../../builtins/functions.rst:1312 msgid "" -":class:`object` does *not* have a :attr:`~object.__dict__`, so you can't " -"assign arbitrary attributes to an instance of the :class:`object` class." +":class:`object` instances do *not* have :attr:`~object.__dict__` attributes, " +"so you can't assign arbitrary attributes to an instance of :class:`object`." msgstr "" -":class:`object` *não* tem um atributo :attr:`~object.__dict__`, então você " -"não consegue definir atributos arbitrários para uma instância da classe :" -"class:`object`." +"Instâncias de :class:`object` *não* têm atributos :attr:`~object.__dict__`, " +"então você não pode atribuir atributos arbitrários a uma instância " +"de :class:`object`." -#: ../../library/functions.rst:1288 +#: ../../builtins/functions.rst:1319 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 " -"integer. For example:" +"result is a valid Python expression. If *integer* is not a " +"Python :class:`int` object, it has to define an :meth:`~object.__index__` " +"method that returns an integer. For example:" msgstr "" -"Converte um número inteiro para uma string em base octal, pré-fixada com " -"\"0o\". O resultado é uma expressão Python válida. Se *x* não for um objeto :" -"class:`int` Python, ele tem que definir um método :meth:`~object.__index__` " -"que devolve um inteiro. Por exemplo:" +"Converte um número inteiro para uma string em base octal, prefixada com " +"\"0o\". O resultado é uma expressão Python válida. Se *integer* não for um " +"objeto :class:`int` Python, ele tem que definir um " +"método :meth:`~object.__index__` que devolve um inteiro. Por exemplo:" -#: ../../library/functions.rst:1298 +#: ../../builtins/functions.rst:1329 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." @@ -2334,7 +2539,7 @@ msgstr "" "Se você quiser converter um número inteiro para uma string octal, com o " "prefixo \"0o\" ou não, você pode usar qualquer uma das formas a seguir." -#: ../../library/functions.rst:1315 +#: ../../builtins/functions.rst:1346 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 " @@ -2344,7 +2549,7 @@ msgstr "" "não puder ser aberto, uma :exc:`OSError` é levantada. Veja :ref:`tut-files` " "para mais exemplos de como usar esta função." -#: ../../library/functions.rst:1319 +#: ../../builtins/functions.rst:1350 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 " @@ -2358,7 +2563,7 @@ msgstr "" "arquivo é fornecido, ele é fechado quando o objeto de I/O retornado é " "fechado, a não ser que *closefd* esteja marcado como ``False``)." -#: ../../library/functions.rst:1325 +#: ../../builtins/functions.rst:1356 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. " @@ -2366,10 +2571,10 @@ msgid "" "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:" +"*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* é uma string opcional que especifica o modo no qual o arquivo é " "aberto. O valor padrão é ``'r'``, o qual significa abrir para leitura em " @@ -2378,77 +2583,77 @@ msgstr "" "anexar (o qual em *alguns* sistemas Unix, significa que *todas* as escritas " "anexam ao final do arquivo independentemente da posição de busca atual). No " "modo texto, se *encoding* não for especificada, a codificação usada depende " -"da plataforma: :func:`locale.getencoding()` é chamada para obter a " -"codificação da localidade atual (Para ler e escrever bytes diretamente, use " -"o modo binário e não especifique *encoding*). Os modos disponíveis são:" +"da plataforma: :func:`locale.getencoding` é chamada para obter a codificação " +"da localidade atual (Para ler e escrever bytes diretamente, use o modo " +"binário e não especifique *encoding*). Os modos disponíveis são:" -#: ../../library/functions.rst:1342 +#: ../../builtins/functions.rst:1373 msgid "Character" msgstr "Caractere" -#: ../../library/functions.rst:1342 +#: ../../builtins/functions.rst:1373 msgid "Meaning" msgstr "Significado" -#: ../../library/functions.rst:1344 +#: ../../builtins/functions.rst:1375 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/functions.rst:1344 +#: ../../builtins/functions.rst:1375 msgid "open for reading (default)" msgstr "abre para leitura (padrão)" -#: ../../library/functions.rst:1345 +#: ../../builtins/functions.rst:1376 msgid "``'w'``" msgstr "``'w'``" -#: ../../library/functions.rst:1345 +#: ../../builtins/functions.rst:1376 msgid "open for writing, truncating the file first" msgstr "" "abre para escrita, truncando o arquivo primeiro (removendo tudo o que " "estiver contido no mesmo)" -#: ../../library/functions.rst:1346 +#: ../../builtins/functions.rst:1377 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/functions.rst:1346 +#: ../../builtins/functions.rst:1377 msgid "open for exclusive creation, failing if the file already exists" msgstr "abre para criação exclusiva, falhando caso o arquivo exista" -#: ../../library/functions.rst:1347 +#: ../../builtins/functions.rst:1378 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/functions.rst:1347 +#: ../../builtins/functions.rst:1378 msgid "open for writing, appending to the end of file if it exists" msgstr "abre para escrita, anexando ao final do arquivo caso o mesmo exista" -#: ../../library/functions.rst:1348 +#: ../../builtins/functions.rst:1379 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/functions.rst:1348 ../../library/functions.rst:1492 +#: ../../builtins/functions.rst:1379 ../../builtins/functions.rst:1523 msgid "binary mode" msgstr "modo binário" -#: ../../library/functions.rst:1349 +#: ../../builtins/functions.rst:1380 msgid "``'t'``" msgstr "``'t'``" -#: ../../library/functions.rst:1349 +#: ../../builtins/functions.rst:1380 msgid "text mode (default)" msgstr "modo texto (padrão)" -#: ../../library/functions.rst:1350 +#: ../../builtins/functions.rst:1381 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/functions.rst:1350 +#: ../../builtins/functions.rst:1381 msgid "open for updating (reading and writing)" msgstr "aberto para atualização (leitura e escrita)" -#: ../../library/functions.rst:1353 +#: ../../builtins/functions.rst:1384 msgid "" "The default mode is ``'r'`` (open for reading text, a synonym of ``'rt'``). " "Modes ``'w+'`` and ``'w+b'`` open and truncate the file. Modes ``'r+'`` and " @@ -2458,7 +2663,7 @@ msgstr "" "``'rt'``). Modos ``'w+'`` e ``'w+b'`` abrem e truncam o arquivo. Modos " "``'r+'`` e ``'r+b'`` abrem o arquivo sem truncar o mesmo." -#: ../../library/functions.rst:1357 +#: ../../builtins/functions.rst:1388 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* " @@ -2472,12 +2677,12 @@ msgstr "" "saída binária e de texto. Arquivos abertos em modo binário (incluindo " "``'b'`` no parâmetro *mode*) retornam o conteúdo como objetos :class:`bytes` " "sem usar nenhuma decodificação. No modo texto (o padrão, ou quando ``'t'`` é " -"incluído no parâmetro *mode*), o conteúdo do arquivo é retornado como :class:" -"`str`, sendo os bytes primeiramente decodificados usando uma codificação " -"dependente da plataforma, ou usando a codificação definida em *encoding* se " -"fornecida." +"incluído no parâmetro *mode*), o conteúdo do arquivo é retornado " +"como :class:`str`, sendo os bytes primeiramente decodificados usando uma " +"codificação dependente da plataforma, ou usando a codificação definida em " +"*encoding* se fornecida." -#: ../../library/functions.rst:1367 +#: ../../builtins/functions.rst:1398 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 " @@ -2487,7 +2692,7 @@ msgstr "" "texto; todo processamento é feito pelo próprio Python, e é então " "independente de plataforma." -#: ../../library/functions.rst:1371 +#: ../../builtins/functions.rst:1402 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 " @@ -2511,7 +2716,7 @@ msgstr "" "*buffering* é fornecido, a política de buffering padrão funciona da seguinte " "forma:" -#: ../../library/functions.rst:1381 +#: ../../builtins/functions.rst:1412 msgid "" "Binary files are buffered in fixed-size chunks; the size of the buffer is " "chosen using a heuristic trying to determine the underlying device's \"block " @@ -2524,17 +2729,18 @@ msgstr "" "caso não consiga. Em muitos sistemas, o buffer possuirá tipicamente 4096 ou " "8192 bytes de comprimento." -#: ../../library/functions.rst:1386 +#: ../../builtins/functions.rst:1417 msgid "" "\"Interactive\" text files (files for which :meth:`~io.IOBase.isatty` " "returns ``True``) use line buffering. Other text files use the policy " "described above for binary files." msgstr "" -"Arquivos de texto \"interativos\" (arquivos para os quais :meth:`~io.IOBase." -"isatty` retornam ``True``) usam buffering de linha. Outros arquivos de texto " -"usam a política descrita acima para arquivos binários." +"Arquivos de texto \"interativos\" (arquivos para os " +"quais :meth:`~io.IOBase.isatty` retornam ``True``) usam buffering de linha. " +"Outros arquivos de texto usam a política descrita acima para arquivos " +"binários." -#: ../../library/functions.rst:1390 +#: ../../builtins/functions.rst:1421 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 " @@ -2545,16 +2751,17 @@ msgstr "" "*encoding* é o nome da codificação usada para codificar ou decodificar o " "arquivo. Isto deve ser usado apenas no modo texto. A codificação padrão " "depende da plataforma (seja qual valor :func:`locale.getencoding` retornar), " -"mas qualquer :term:`codificador de texto` suportado pelo Python pode ser " +"mas qualquer :term:`codificação do texto` suportado pelo Python pode ser " "usada. Veja o módulo :mod:`codecs` para a lista de codificações suportadas." -#: ../../library/functions.rst:1396 +#: ../../builtins/functions.rst:1427 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 " "standard error handlers are available (listed under :ref:`error-handlers`), " -"though any error handling name that has been registered with :func:`codecs." -"register_error` is also valid. The standard names include:" +"though any error handling name that has been registered " +"with :func:`codecs.register_error` is also valid. The standard names " +"include:" msgstr "" "*errors* é uma string opcional que especifica como erros de codificação e de " "decodificação devem ser tratados — isso não pode ser utilizado no modo " @@ -2563,7 +2770,7 @@ msgstr "" "tratamento de erro registrado com :func:`codecs.register_error` também é " "válido. Os nomes padrões incluem:" -#: ../../library/functions.rst:1404 +#: ../../builtins/functions.rst:1435 msgid "" "``'strict'`` to raise a :exc:`ValueError` exception if there is an encoding " "error. The default value of ``None`` has the same effect." @@ -2571,7 +2778,7 @@ msgstr "" "``'strict'`` para levantar uma exceção :exc:`ValueError` se existir um erro " "de codificação. O valor padrão ``None`` tem o mesmo efeito." -#: ../../library/functions.rst:1408 +#: ../../builtins/functions.rst:1439 msgid "" "``'ignore'`` ignores errors. Note that ignoring encoding errors can lead to " "data loss." @@ -2579,7 +2786,7 @@ msgstr "" "``'ignore'`` ignora erros. Note que ignorar erros de código pode levar à " "perda de dados." -#: ../../library/functions.rst:1411 +#: ../../builtins/functions.rst:1442 msgid "" "``'replace'`` causes a replacement marker (such as ``'?'``) to be inserted " "where there is malformed data." @@ -2587,7 +2794,7 @@ msgstr "" "``'replace'`` faz um marcador de substituição (tal como ``'?'``) ser " "inserido onde existem dados malformados." -#: ../../library/functions.rst:1414 +#: ../../builtins/functions.rst:1445 msgid "" "``'surrogateescape'`` will represent any incorrect bytes as low surrogate " "code units ranging from U+DC80 to U+DCFF. These surrogate code units will " @@ -2601,7 +2808,7 @@ msgstr "" "erros for usado ao gravar dados. Isso é útil para processar arquivos em uma " "codificação desconhecida." -#: ../../library/functions.rst:1421 +#: ../../builtins/functions.rst:1452 msgid "" "``'xmlcharrefreplace'`` is only supported when writing to a file. Characters " "not supported by the encoding are replaced with the appropriate XML " @@ -2611,7 +2818,7 @@ msgstr "" "caracteres não suportados pela codificação são substituídos pela referência " "de caracteres XML apropriada :samp:`&#{nnn};`." -#: ../../library/functions.rst:1425 +#: ../../builtins/functions.rst:1456 msgid "" "``'backslashreplace'`` replaces malformed data by Python's backslashed " "escape sequences." @@ -2619,7 +2826,7 @@ msgstr "" "``'backslashreplace'`` substitui dados malformados pela sequência de escape " "utilizando contrabarra do Python." -#: ../../library/functions.rst:1428 +#: ../../builtins/functions.rst:1459 msgid "" "``'namereplace'`` (also only supported when writing) replaces unsupported " "characters with ``\\N{...}`` escape sequences." @@ -2627,7 +2834,7 @@ msgstr "" "``'namereplace'`` (também é suportado somente quando estiver escrevendo) " "substitui caractere não suportados com sequências de escape ``\\N{...}``." -#: ../../library/functions.rst:1436 +#: ../../builtins/functions.rst:1467 msgid "" "*newline* determines how to parse newline characters from the stream. It can " "be ``None``, ``''``, ``'\\n'``, ``'\\r'``, and ``'\\r\\n'``. It works as " @@ -2637,7 +2844,7 @@ msgstr "" "pode ser ``None``, ``''``, ``'\\n'``, ``'\\r'`` e ``'\\r\\n'``. Ele funciona " "da seguinte forma:" -#: ../../library/functions.rst:1440 +#: ../../builtins/functions.rst:1471 msgid "" "When reading input from the stream, if *newline* is ``None``, universal " "newlines mode is enabled. Lines in the input can end in ``'\\n'``, " @@ -2656,13 +2863,13 @@ msgstr "" "apenas pela string especificada e a finalização da linha é retornada ao " "chamador sem tradução." -#: ../../library/functions.rst:1448 +#: ../../builtins/functions.rst:1479 msgid "" "When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` " -"characters written are translated to the system default line separator, :" -"data:`os.linesep`. If *newline* is ``''`` or ``'\\n'``, no translation " -"takes place. If *newline* is any of the other legal values, any ``'\\n'`` " -"characters written are translated to the given string." +"characters written are translated to the system default line " +"separator, :data:`os.linesep`. If *newline* is ``''`` or ``'\\n'``, no " +"translation takes place. If *newline* is any of the other legal values, any " +"``'\\n'`` characters written are translated to the given string." msgstr "" "Ao gravar a saída no fluxo, se *newline* for ``None``, quaisquer caracteres " "``'\\n'`` gravados serão traduzidos para o separador de linhas padrão do " @@ -2670,7 +2877,7 @@ msgstr "" "tradução ocorrerá. Se *newline* for um dos outros valores legais, qualquer " "caractere ``'\\n'`` escrito será traduzido para a string especificada." -#: ../../library/functions.rst:1454 +#: ../../builtins/functions.rst:1485 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 " @@ -2682,7 +2889,7 @@ msgstr "" "quando o arquivo for fechado. Se um nome de arquivo for fornecido *closefd* " "deve ser ``True`` (o padrão), caso contrário, um erro será levantado." -#: ../../library/functions.rst:1459 +#: ../../builtins/functions.rst:1490 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 " @@ -2696,56 +2903,79 @@ msgstr "" "arquivo aberto (passando :mod:`os.open` como *opener* resulta em " "funcionalidade semelhante à passagem de ``None``)." -#: ../../library/functions.rst:1465 +#: ../../builtins/functions.rst:1496 msgid "The newly created file is :ref:`non-inheritable `." msgstr "O arquivo recém-criado é :ref:`non-inheritable `." -#: ../../library/functions.rst:1467 +#: ../../builtins/functions.rst:1498 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::" +"The following example uses the :ref:`dir_fd ` parameter of " +"the :func:`os.open` function to open a file relative to a given directory::" msgstr "" -"O exemplo a seguir usa o parâmetro :ref:`dir_fd ` da função :func:" -"`os.open` para abrir um arquivo relativo a um determinado diretório::" +"O exemplo a seguir usa o parâmetro :ref:`dir_fd ` da " +"função :func:`os.open` para abrir um arquivo relativo a um determinado " +"diretório::" -#: ../../library/functions.rst:1480 +#: ../../builtins/functions.rst:1501 +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('algum_dir', 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('Isso será escrito para algum_dir/spamspam.txt', file=f)\n" +"...\n" +">>> os.close(dir_fd) # não deixe vazar um descritor de arquivo" + +#: ../../builtins/functions.rst:1511 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 " -"mode (``'w'``, ``'r'``, ``'wt'``, ``'rt'``, etc.), it returns a subclass of :" -"class:`io.TextIOBase` (specifically :class:`io.TextIOWrapper`). When used " -"to open a file in a binary mode with buffering, the returned class is a " +"mode (``'w'``, ``'r'``, ``'wt'``, ``'rt'``, etc.), it returns a subclass " +"of :class:`io.TextIOBase` (specifically :class:`io.TextIOWrapper`). When " +"used to open a file in a binary mode with buffering, the returned class is a " "subclass of :class:`io.BufferedIOBase`. The exact class varies: in read " "binary mode, it returns an :class:`io.BufferedReader`; in write binary and " "append binary modes, it returns an :class:`io.BufferedWriter`, and in read/" "write mode, it returns an :class:`io.BufferedRandom`. When buffering is " -"disabled, the raw stream, a subclass of :class:`io.RawIOBase`, :class:`io." -"FileIO`, is returned." -msgstr "" -"O tipo de :term:`objeto arquivo ` retornado pela função :func:" -"`open` depende do modo. Quando :func:`open` é usado para abrir um arquivo no " -"modo texto (``'w'``, ``'r'``, ``'wt'``, ``'rt'``, etc.), retorna uma " -"subclasse de :class:`io.TextIOBase` (especificamente :class:`io." -"TextIOWrapper`). Quando usada para abrir um arquivo em modo binário com " -"buffer, a classe retornada é uma subclasse de :class:`io.BufferedIOBase`. A " -"classe exata varia: no modo binário de leitura, ele retorna uma :class:`io." -"BufferedReader`; nos modos binário de gravação e binário anexado, ele " -"retorna um :class:`io.BufferedWriter` e, no modo leitura/gravação, retorna " -"um :class:`io.BufferedRandom`. Quando o buffer está desativado, o fluxo " -"bruto, uma subclasse de :class:`io.RawIOBase`, :class:`io.FileIO`, é " -"retornado." - -#: ../../library/functions.rst:1501 +"disabled, the raw stream, a subclass " +"of :class:`io.RawIOBase`, :class:`io.FileIO`, is returned." +msgstr "" +"O tipo de :term:`objeto arquivo ` retornado pela " +"função :func:`open` depende do modo. Quando :func:`open` é usado para abrir " +"um arquivo no modo texto (``'w'``, ``'r'``, ``'wt'``, ``'rt'``, etc.), " +"retorna uma subclasse de :class:`io.TextIOBase` " +"(especificamente :class:`io.TextIOWrapper`). Quando usada para abrir um " +"arquivo em modo binário com buffer, a classe retornada é uma subclasse " +"de :class:`io.BufferedIOBase`. A classe exata varia: no modo binário de " +"leitura, ele retorna uma :class:`io.BufferedReader`; nos modos binário de " +"gravação e binário anexado, ele retorna um :class:`io.BufferedWriter` e, no " +"modo leitura/gravação, retorna um :class:`io.BufferedRandom`. Quando o " +"buffer está desativado, o fluxo bruto, uma subclasse " +"de :class:`io.RawIOBase`, :class:`io.FileIO`, é retornado." + +#: ../../builtins/functions.rst:1532 msgid "" "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`." +"(where :func:`open` is " +"declared), :mod:`os`, :mod:`os.path`, :mod:`tempfile`, and :mod:`shutil`." msgstr "" -"Veja também os módulos de para lidar com arquivos, tais como :mod:" -"`fileinput`, :mod:`io` (onde :func:`open` é declarado), :mod:`os`, :mod:`os." -"path`, :mod:`tempfile` e :mod:`shutil`." +"Veja também os módulos de para lidar com arquivos, tais " +"como :mod:`fileinput`, :mod:`io` (onde :func:`open` é " +"declarado), :mod:`os`, :mod:`os.path`, :mod:`tempfile` e :mod:`shutil`." -#: ../../library/functions.rst:1505 +#: ../../builtins/functions.rst:1536 msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``path``, " "``mode``, ``flags``." @@ -2753,7 +2983,7 @@ msgstr "" "Levanta um :ref:`evento de auditoria ` ``open`` com os argumentos " "``path``, ``mode``, ``flags``." -#: ../../library/functions.rst:1507 +#: ../../builtins/functions.rst:1538 msgid "" "The ``mode`` and ``flags`` arguments may have been modified or inferred from " "the original call." @@ -2761,21 +2991,21 @@ msgstr "" "Os argumentos ``mode`` e ``flags`` podem ter sido modificados ou inferidos a " "partir da chamada original." -#: ../../library/functions.rst:1512 +#: ../../builtins/functions.rst:1543 msgid "The *opener* parameter was added." msgstr "O parâmetro *opener* foi adicionado." -#: ../../library/functions.rst:1513 +#: ../../builtins/functions.rst:1544 msgid "The ``'x'`` mode was added." msgstr "O modo ``'x'`` foi adicionado." -#: ../../library/functions.rst:1514 +#: ../../builtins/functions.rst:1545 msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." msgstr "" -":exc:`IOError` costumava ser levantado, agora ele é um codinome para :exc:" -"`OSError`." +":exc:`IOError` costumava ser levantada, agora ela é um apelido " +"para :exc:`OSError`." -#: ../../library/functions.rst:1515 +#: ../../builtins/functions.rst:1546 msgid "" ":exc:`FileExistsError` is now raised if the file opened in exclusive " "creation mode (``'x'``) already exists." @@ -2783,55 +3013,69 @@ msgstr "" ":exc:`FileExistsError` agora é levantado se o arquivo aberto no modo de " "criação exclusivo (``'x'``) já existir." -#: ../../library/functions.rst:1520 +#: ../../builtins/functions.rst:1551 msgid "The file is now non-inheritable." msgstr "O arquivo agora é não herdável." -#: ../../library/functions.rst:1524 +#: ../../builtins/functions.rst:1555 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 :" -"exc:`InterruptedError` exception (see :pep:`475` for the rationale)." +"exception, the function now retries the system call instead of raising " +"an :exc:`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" "Se a chamada de sistema é interrompida e o tratador de sinal não levanta uma " "exceção, a função agora tenta novamente a chamada de sistema em vez de " "levantar uma exceção :exc:`InterruptedError` (consulte :pep:`475` para " "entender a justificativa)." -#: ../../library/functions.rst:1527 +#: ../../builtins/functions.rst:1558 msgid "The ``'namereplace'`` error handler was added." msgstr "O tratador de erros ``'namereplace'`` foi adicionado." -#: ../../library/functions.rst:1531 +#: ../../builtins/functions.rst:1562 msgid "Support added to accept objects implementing :class:`os.PathLike`." msgstr "" "Suporte adicionado para aceitar objetos implementados :class:`os.PathLike`." -#: ../../library/functions.rst:1532 +#: ../../builtins/functions.rst:1563 msgid "" -"On Windows, opening a console buffer may return a subclass of :class:`io." -"RawIOBase` other than :class:`io.FileIO`." +"On Windows, opening a console buffer may return a subclass " +"of :class:`io.RawIOBase` other than :class:`io.FileIO`." msgstr "" "No Windows, a abertura de um buffer do console pode retornar uma subclasse " "de :class:`io.RawIOBase` que não seja :class:`io.FileIO`." -#: ../../library/functions.rst:1535 +#: ../../builtins/functions.rst:1566 msgid "The ``'U'`` mode has been removed." msgstr "O modo ``'U'`` foi removido." -#: ../../library/functions.rst:1540 +#: ../../builtins/functions.rst:1571 +msgid "Return the ordinal value of a character." +msgstr "Retorna o valor ordinal de um caractere." + +#: ../../builtins/functions.rst:1573 msgid "" -"Given a string representing one Unicode character, return an integer " -"representing the Unicode code point of that character. For example, " -"``ord('a')`` returns the integer ``97`` and ``ord('€')`` (Euro sign) returns " -"``8364``. This is the inverse of :func:`chr`." +"If the argument is a one-character string, return the Unicode code point of " +"that character. For example, ``ord('a')`` returns the integer ``97`` and " +"``ord('€')`` (Euro sign) returns ``8364``. This is the inverse " +"of :func:`chr`." msgstr "" -"Dada uma string que representa um caractere Unicode, retorna um número " -"inteiro representando o ponto de código Unicode desse caractere. Por " -"exemplo, ``ord('a')`` retorna o número inteiro ``97`` e ``ord('€')`` (sinal " -"do Euro) retorna ``8364``. Este é o inverso de :func:`chr`." +"Se o argumento for uma string de um caractere, retorna o ponto de código " +"Unicode desse caractere.. Por exemplo, ``ord('a')`` retorna o número inteiro " +"``97`` e ``ord('€')`` (sinal do Euro) retorna ``8364``. Este é o inverso " +"de :func:`chr`." -#: ../../library/functions.rst:1548 +#: ../../builtins/functions.rst:1578 +msgid "" +"If the argument is a :class:`bytes` or :class:`bytearray` object of length " +"1, return its single byte value. For example, ``ord(b'a')`` returns the " +"integer ``97``." +msgstr "" +"Se o argumento for um objeto :class:`bytes` ou :class:`bytearray` de " +"comprimento 1, retorna seu valor de byte único. Por exemplo, ``ord(b'a')`` " +"retorna o inteiro ``97``." + +#: ../../builtins/functions.rst:1585 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) % " @@ -2843,9 +3087,9 @@ msgstr "" "``pow(base, exp) % mod``). A forma de dois argumentos ``pow(base, exp)`` é " "equivalente a usar o operador de potência: ``base**exp``." -#: ../../library/functions.rst:1553 +#: ../../builtins/functions.rst:1590 msgid "" -"The arguments must have numeric types. With mixed operand types, the " +"When arguments are builtin 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 " @@ -2853,24 +3097,24 @@ msgid "" "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 "" -"Os argumentos devem ter tipos numéricos. Com tipos de operandos mistos, " -"aplicam-se as regras de coerção para operadores aritméticos binários. Para " -"operandos :class:`int`, o resultado tem o mesmo tipo que os operandos (após " -"coerção), a menos que o segundo argumento seja negativo; nesse caso, todos " -"os argumentos são convertidos em ponto flutuante e um resultado ponto " -"flutuante é entregue. Por exemplo, ``pow(10, 2)`` retorna ``100``, mas " -"``pow(10, -2)`` retorna ``0.01``. Para uma base negativa do tipo :class:" -"`int` ou :class:`float` e um expoente não integral, um resultado complexo é " -"entregue. Por exemplo, ``pow(-9, 0.5)`` retorna um valor próximo a ``3j``. " -"Enquanto isso, para uma base negativa do tipo :class:`int` ou :class:`float` " -"com um expoente integral, um resultado de ponto flutuante é retornado. Por " -"exemplo, ``pow(-9, 2.0)`` retorna ``81.0``." - -#: ../../library/functions.rst:1565 +"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 "" +"Quando argumentos são tipos numéricos embutidos com tipos de operandos " +"mistos, aplicam-se as regras de coerção para operadores aritméticos " +"binários. Para operandos :class:`int`, o resultado tem o mesmo tipo que os " +"operandos (após coerção), a menos que o segundo argumento seja negativo; " +"nesse caso, todos os argumentos são convertidos em ponto flutuante e um " +"resultado ponto flutuante é entregue. Por exemplo, ``pow(10, 2)`` retorna " +"``100``, mas ``pow(10, -2)`` retorna ``0.01``. Para uma base negativa do " +"tipo :class:`int` ou :class:`float` e um expoente não integral, um resultado " +"complexo é entregue. Por exemplo, ``pow(-9, 0.5)`` retorna um valor próximo " +"a ``3j``. Enquanto isso, para uma base negativa do tipo :class:`int` " +"ou :class:`float` com um expoente integral, um resultado de ponto flutuante " +"é retornado. Por exemplo, ``pow(-9, 2.0)`` retorna ``81.0``." + +#: ../../builtins/functions.rst:1602 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 " @@ -2884,12 +3128,24 @@ msgstr "" "para *mod*. Nesse caso, ``pow(inv_base, -exp, mod)`` é retornado, onde " "*inv_base* é um inverso ao *base* módulo *mod*." -#: ../../library/functions.rst:1571 +#: ../../builtins/functions.rst:1608 msgid "Here's an example of computing an inverse for ``38`` modulo ``97``::" msgstr "" "Aqui está um exemplo de computação de um inverso para ``38`` módulo ``97``::" -#: ../../library/functions.rst:1578 +#: ../../builtins/functions.rst:1610 +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" + +#: ../../builtins/functions.rst:1615 msgid "" "For :class:`int` operands, the three-argument form of ``pow`` now allows the " "second argument to be negative, permitting computation of modular inverses." @@ -2898,14 +3154,14 @@ msgstr "" "permite que o segundo argumento seja negativo, permitindo o cálculo de " "inversos modulares." -#: ../../library/functions.rst:1583 +#: ../../builtins/functions.rst:1620 msgid "" "Allow keyword arguments. Formerly, only positional arguments were supported." msgstr "" "Permite argumentos de palavra reservada. Anteriormente, apenas argumentos " "posicionais eram suportados." -#: ../../library/functions.rst:1590 +#: ../../builtins/functions.rst:1627 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 " @@ -2915,7 +3171,7 @@ msgstr "" "por *end*. *sep*, *end*, *file* e *flush*, se houver, devem ser fornecidos " "como argumentos nomeados." -#: ../../library/functions.rst:1594 +#: ../../builtins/functions.rst:1631 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* " @@ -2923,13 +3179,13 @@ msgid "" "default values. If no *objects* are given, :func:`print` will just write " "*end*." msgstr "" -"Todos os argumentos que não são nomeados são convertidos em strings como :" -"func:`str` faz e gravados no fluxo, separados por *sep* e seguidos por " +"Todos os argumentos que não são nomeados são convertidos em strings " +"como :func:`str` faz e gravados no fluxo, separados por *sep* e seguidos por " "*end*. *sep* e *end* devem ser strings; eles também podem ser ``None``, o " -"que significa usar os valores padrão. Se nenhum *object* for fornecido, :" -"func:`print` escreverá apenas *end*." +"que significa usar os valores padrão. Se nenhum *object* for " +"fornecido, :func:`print` escreverá apenas *end*." -#: ../../library/functions.rst:1600 +#: ../../builtins/functions.rst:1637 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 " @@ -2938,11 +3194,11 @@ msgid "" msgstr "" "O argumento *file* deve ser um objeto com um método ``write(string)``; se " "ele não estiver presente ou ``None``, então :data:`sys.stdout` será usado. " -"Como argumentos exibidos no console são convertidos para strings de texto, :" -"func:`print` não pode ser usado com objetos de arquivo em modo binário. Para " -"esses casos, use ``file.write(...)`` ao invés." +"Como argumentos exibidos no console são convertidos para strings de " +"texto, :func:`print` não pode ser usado com objetos arquivo em modo binário. " +"Para esses casos, use ``file.write(...)`` ao invés." -#: ../../library/functions.rst:1605 +#: ../../builtins/functions.rst:1642 msgid "" "Output buffering is usually determined by *file*. However, if *flush* is " "true, the stream is forcibly flushed." @@ -2950,15 +3206,15 @@ msgstr "" "O buffer de saída geralmente é determinado por *arquivo*. No entanto, se " "*flush* for verdadeiro, o fluxo será descarregado à força." -#: ../../library/functions.rst:1609 +#: ../../builtins/functions.rst:1646 msgid "Added the *flush* keyword argument." msgstr "Adicionado o argumento nomeado *flush*." -#: ../../library/functions.rst:1615 +#: ../../builtins/functions.rst:1652 msgid "Return a property attribute." msgstr "Retorna um atributo de propriedade." -#: ../../library/functions.rst:1617 +#: ../../builtins/functions.rst:1654 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 " @@ -2968,31 +3224,83 @@ msgstr "" "para definir um valor para um atributo. *fdel* é uma função para deletar um " "valor de um atributo. E *doc* cria um docstring para um atributo." -#: ../../library/functions.rst:1621 +#: ../../builtins/functions.rst:1658 msgid "A typical use is to define a managed attribute ``x``::" msgstr "Um uso comum é para definir um atributo gerenciável ``x``::" -#: ../../library/functions.rst:1638 +#: ../../builtins/functions.rst:1660 +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, valor):\n" +" self._x = valor\n" +"\n" +" def delx(self):\n" +" del self._x\n" +"\n" +" x = property(getx, setx, delx, \"Eu sou a propriedade de 'x'.\")" + +#: ../../builtins/functions.rst:1675 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." msgstr "" "Se *c* é uma instância de *C*, ``c.x`` irá invocar o método getter, ``c.x = " -"value`` irá invocar o método setter, e ``del c.x`` o método deleter." +"valor`` irá invocar o método setter, e ``del c.x`` o método deleter." -#: ../../library/functions.rst:1641 +#: ../../builtins/functions.rst:1678 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 " -"possible to create read-only properties easily using :func:`property` as a :" -"term:`decorator`::" +"possible to create read-only properties easily using :deco:`property` as " +"a :term:`decorator`::" msgstr "" "Se fornecido, *doc* será a docstring do atributo definido por property. Caso " "contrário, a property copiará a docstring de *fget* (se ela existir). Isso " -"torna possível criar facilmente propriedades apenas para leitura usando :" -"func:`property` como um :term:`decorador`::" - -#: ../../library/functions.rst:1654 +"torna possível criar facilmente propriedades apenas para leitura " +"usando :deco:`property` como um :term:`decorador`::" + +#: ../../builtins/functions.rst:1682 +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._voltagem = 100000\n" +"\n" +" @property\n" +" def voltagem(self):\n" +" \"\"\"Obtém a voltagem atual.\"\"\"\n" +" return self._voltagem" + +#: ../../builtins/functions.rst:1691 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 " @@ -3002,7 +3310,7 @@ msgstr "" "\"getter\" para um atributo somente leitura com o mesmo nome, e define a " "docstring de *voltage* para \"Get the current voltage.\"" -#: ../../library/functions.rst:1662 +#: ../../builtins/functions.rst:1699 msgid "" "A property object has ``getter``, ``setter``, and ``deleter`` methods usable " "as decorators that create a copy of the property with the corresponding " @@ -3014,7 +3322,43 @@ msgstr "" "correspondente a função definida para a função com decorador. Isso é " "explicado melhor com um exemplo::" -#: ../../library/functions.rst:1686 +#: ../../builtins/functions.rst:1704 +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" +" \"\"\"Sou a propriedade de 'x'.\"\"\"\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" + +#: ../../builtins/functions.rst:1723 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 " @@ -3024,7 +3368,7 @@ msgstr "" "nas funções adicionais usar o mesmo nome que a property original (``x`` " "neste caso)." -#: ../../library/functions.rst:1690 +#: ../../builtins/functions.rst:1727 msgid "" "The returned property object also has the attributes ``fget``, ``fset``, and " "``fdel`` corresponding to the constructor arguments." @@ -3032,11 +3376,19 @@ msgstr "" "O objeto property retornado também tem os atributos ``fget``, ``fset``, e " "``fdel`` correspondendo aos argumentos do construtor." -#: ../../library/functions.rst:1693 +#: ../../builtins/functions.rst:1730 msgid "The docstrings of property objects are now writeable." msgstr "Agora é possível escrever nas docstrings de objetos property." -#: ../../library/functions.rst:1702 +#: ../../builtins/functions.rst:1735 +msgid "" +"Attribute holding the name of the property. The name of the property can be " +"changed at runtime." +msgstr "" +"Atributo que contém o nome da propriedade. O nome da propriedade pode ser " +"alterado em tempo de execução." + +#: ../../builtins/functions.rst:1746 msgid "" "Rather than being a function, :class:`range` is actually an immutable " "sequence type, as documented in :ref:`typesseq-range` and :ref:`typesseq`." @@ -3044,7 +3396,7 @@ msgstr "" "Em vez de ser uma função, :class:`range` é realmente um tipo de sequência " "imutável, conforme documentado em :ref:`typesseq-range` e :ref:`typesseq`." -#: ../../library/functions.rst:1708 +#: ../../builtins/functions.rst:1752 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 " @@ -3063,27 +3415,41 @@ msgstr "" "tipo do objeto juntamente com informações adicionais, geralmente incluindo o " "nome e o endereço do objeto. Uma classe pode controlar o que essa função " "retorna para suas instâncias, definindo um método :meth:`~object.__repr__`. " -"Se :func:`sys.displayhook` não estiver acessível, esta função vai levantar :" -"exc:`RuntimeError`." +"Se :func:`sys.displayhook` não estiver acessível, esta função vai " +"levantar :exc:`RuntimeError`." -#: ../../library/functions.rst:1719 +#: ../../builtins/functions.rst:1763 msgid "This class has a custom representation that can be evaluated::" msgstr "" "Esta classe possui uma representação personalizada que pode ser executada::" -#: ../../library/functions.rst:1732 +#: ../../builtins/functions.rst:1765 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``)." +"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 "" -"Retorna um :term:`iterador ` reverso. *seq* deve ser um objeto que " -"possui o método :meth:`~object.__reversed__` ou suporta o protocolo de " -"sequência (o método :meth:`~object.__len__` e o método :meth:`~object." -"__getitem__` com argumentos inteiros começando em ``0``)." +"class Pessoa: def __init__(self, nome, idade): self.nome = nome " +"self.idade = idade def __repr__(self): return " +"f\"Pessoa('{self.nome}', {self.idade})\"" -#: ../../library/functions.rst:1740 +#: ../../builtins/functions.rst:1776 +msgid "" +"Return a reverse :term:`iterator`. The argument 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``)." +msgstr "" +"Retorna um :term:`iterador` reverso. *seq* deve ser um objeto que possui o " +"método :meth:`~object.__reversed__` ou suporta o protocolo de sequência (o " +"método :meth:`~object.__len__` e o método :meth:`~object.__getitem__` com " +"argumentos inteiros começando em ``0``)." + +#: ../../builtins/functions.rst:1784 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 " @@ -3093,7 +3459,7 @@ msgstr "" "Se *ndigits* for omitido ou for ``None``, ele retornará o número inteiro " "mais próximo de sua entrada." -#: ../../library/functions.rst:1744 +#: ../../builtins/functions.rst:1788 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 " @@ -3112,15 +3478,15 @@ msgstr "" "inteiro se *ndigits* for omitido ou ``None``. Caso contrário, o valor de " "retorno tem o mesmo tipo que *number*." -#: ../../library/functions.rst:1753 +#: ../../builtins/functions.rst:1797 msgid "" -"For a general Python object ``number``, ``round`` delegates to ``number." -"__round__``." +"For a general Python object ``number``, ``round`` delegates to " +"``number.__round__``." msgstr "" -"Para um objeto Python geral ``number``, ``round`` delega para ``number." -"__round__``." +"Para um objeto Python geral ``number``, ``round`` delega para " +"``number.__round__``." -#: ../../library/functions.rst:1758 +#: ../../builtins/functions.rst:1802 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 " @@ -3134,27 +3500,27 @@ msgstr "" "das frações decimais não pode ser representada exatamente como um ponto " "flutuante. Veja :ref:`tut-fp-issues` para mais informações." -#: ../../library/functions.rst:1770 +#: ../../builtins/functions.rst:1813 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-" -"set` for documentation about this class." +"*iterable*. :class:`set` is a built-in class. See also :ref:`types-set` " +"for documentation about this class." msgstr "" -"Retorna um novo objeto :class:`set`, opcionalmente com elementos retirados " -"de *iterable*. ``set`` é uma classe embutida. Veja :class:`set` e :ref:" -"`types-set` para documentação sobre esta classe." +"Retorna um novo objeto :class:`set`, opcionalmente com elementos obtidos de " +"*iteráveis*. :class:`set` é uma classe embutida. Veja também :ref:`types-" +"set` para documentação sobre essa classe." -#: ../../library/functions.rst:1774 +#: ../../builtins/functions.rst:1817 msgid "" -"For other containers see the built-in :class:`frozenset`, :class:`list`, :" -"class:`tuple`, and :class:`dict` classes, as well as the :mod:`collections` " -"module." +"For other containers see the built-" +"in :class:`frozenset`, :class:`list`, :class:`tuple`, and :class:`dict` " +"classes, as well as the :mod:`collections` module." msgstr "" -"Para outros contêineres, consulte as classes embutidas :class:`frozenset`, :" -"class:`list`, :class:`tuple` e :class:`dict`, bem como o módulo :mod:" -"`collections`." +"Para outros contêineres, consulte as classes " +"embutidas :class:`frozenset`, :class:`list`, :class:`tuple` e :class:`dict`, " +"bem como o módulo :mod:`collections`." -#: ../../library/functions.rst:1781 +#: ../../builtins/functions.rst:1824 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 " @@ -3165,25 +3531,25 @@ msgstr "" "Esta é a contrapartida de :func:`getattr`. Os argumentos são um objeto, uma " "string e um valor arbitrário. A string pode nomear um atributo existente ou " "um novo atributo. A função atribui o valor ao atributo, desde que o objeto " -"permita. Por exemplo, ``setattr(x, 'foobar', 123)`` é equivalente a ``x." -"foobar = 123``." +"permita. Por exemplo, ``setattr(x, 'foobar', 123)`` é equivalente a " +"``x.foobar = 123``." -#: ../../library/functions.rst:1787 +#: ../../builtins/functions.rst:1830 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.." +"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 "" -"*name* não precisa ser um identificador do Python conforme definido em :ref:" -"`identifiers` a menos que o objeto opte por impor isso, por exemplo, em um :" -"meth:`~object.__getattribute__` personalizado ou via :attr:`~object." -"__slots__`. Um atributo cujo nome não é um identificador não será acessível " -"usando a notação de ponto, mas pode ser acessado através de :func:`getattr` " -"etc." +"*name* não precisa ser um identificador do Python conforme definido " +"em :ref:`identifiers` a menos que o objeto opte por impor isso, por exemplo, " +"em um :meth:`~object.__getattribute__` personalizado ou " +"via :attr:`~object.__slots__`. Um atributo cujo nome não é um identificador " +"não será acessível usando a notação de ponto, mas pode ser acessado através " +"de :func:`getattr` etc." -#: ../../library/functions.rst:1795 +#: ../../builtins/functions.rst:1838 msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " @@ -3194,7 +3560,7 @@ msgstr "" "atributo privado (atributos com dois sublinhados à esquerda) para defini-lo " "com :func:`setattr`." -#: ../../library/functions.rst:1804 +#: ../../builtins/functions.rst:1847 msgid "" "Return a :term:`slice` object representing the set of indices specified by " "``range(start, stop, step)``. The *start* and *step* arguments default to " @@ -3204,7 +3570,7 @@ msgstr "" "especificados por ``range(start, stop, step)``. Os argumentos *start* e " "*step* têm o padrão ``None``." -#: ../../library/functions.rst:1812 +#: ../../builtins/functions.rst:1851 msgid "" "Slice objects have read-only data attributes :attr:`!start`, :attr:`!stop`, " "and :attr:`!step` which merely return the argument values (or their " @@ -3216,47 +3582,51 @@ msgstr "" "(ou seus padrões). Eles não possuem outra funcionalidade explícita; no " "entanto, eles são usados pelo NumPy e outros pacotes de terceiros." -#: ../../library/functions.rst:1817 +#: ../../builtins/functions.rst:1860 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`." +"example: ``a[start:stop:step]`` or ``a[start:stop, i]``. " +"See :func:`itertools.islice` for an alternate version that returns " +"an :term:`iterator`." msgstr "" "Objetos fatia também são gerados quando a sintaxe de indexação estendida é " -"usada. Por exemplo: ``a[start:stop:step]`` ou ``a[start:stop, i]``. Veja :" -"func:`itertools.islice` para uma versão alternativa que retorna um :term:" -"`iterador`." +"usada. Por exemplo: ``a[start:stop:step]`` ou ``a[start:stop, i]``. " +"Veja :func:`itertools.islice` para uma versão alternativa que retorna " +"um :term:`iterador`." -#: ../../library/functions.rst:1822 +#: ../../builtins/functions.rst:1865 msgid "" -"Slice objects are now :term:`hashable` (provided :attr:`~slice.start`, :attr:" -"`~slice.stop`, and :attr:`~slice.step` are hashable)." +"Slice objects are now :term:`hashable` " +"(provided :attr:`~slice.start`, :attr:`~slice.stop`, and :attr:`~slice.step` " +"are hashable)." msgstr "" -"Os objetos slice agora são :term:`hasheáveis ` (desde que :attr:" -"`~slice.start`, :attr:`~slice.stop` e :attr:`~slice.step` sejam hasheáveis)." +"Os objetos slice agora são :term:`hasheáveis ` (desde " +"que :attr:`~slice.start`, :attr:`~slice.stop` e :attr:`~slice.step` sejam " +"hasheáveis)." -#: ../../library/functions.rst:1828 +#: ../../builtins/functions.rst:1871 msgid "Return a new sorted list from the items in *iterable*." msgstr "Retorna uma nova lista classificada dos itens em *iterable*." -#: ../../library/functions.rst:1830 +#: ../../builtins/functions.rst:1873 msgid "" "Has two optional arguments which must be specified as keyword arguments." msgstr "" "Possui dois argumentos opcionais que devem ser especificados como argumentos " "nomeados." -#: ../../library/functions.rst:1832 +#: ../../builtins/functions.rst:1875 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." -"lower``). The default value is ``None`` (compare the elements directly)." +"comparison key from each element in *iterable* (for example, " +"``key=str.lower``). The default value is ``None`` (compare the elements " +"directly)." msgstr "" "*key* especifica a função de um argumento usado para extrair uma chave de " "comparação de cada elemento em *iterable* (por exemplo, ``key=str.lower``). " "O valor padrão é ``None`` (compara os elementos diretamente)." -#: ../../library/functions.rst:1836 +#: ../../builtins/functions.rst:1879 msgid "" "*reverse* is a boolean value. If set to ``True``, then the list elements " "are sorted as if each comparison were reversed." @@ -3265,7 +3635,7 @@ msgstr "" "elementos da lista são classificados como se cada comparação estivesse " "invertida." -#: ../../library/functions.rst:1839 +#: ../../builtins/functions.rst:1882 msgid "" "Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a " "*key* function." @@ -3273,7 +3643,7 @@ msgstr "" "Usa :func:`functools.cmp_to_key` para converter a função das antigas *cmp* " "para uma função *key*." -#: ../../library/functions.rst:1842 +#: ../../builtins/functions.rst:1885 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 " @@ -3285,7 +3655,7 @@ msgstr "" "comparam da mesma forma --- isso é útil para ordenar em várias passagens " "(por exemplo, ordenar por departamento e depois por nível de salário)." -#: ../../library/functions.rst:1847 +#: ../../builtins/functions.rst:1890 msgid "" "The sort algorithm uses only ``<`` comparisons between items. While " "defining an :meth:`~object.__lt__` method will suffice for sorting, :PEP:`8` " @@ -3293,7 +3663,7 @@ msgid "" "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__` " +"mixed type comparisons which can call the reflected :meth:`~object.__gt__` " "method." msgstr "" "O algoritmo de classificação usa apenas comparações ``<`` entre itens. " @@ -3303,20 +3673,20 @@ msgstr "" "mesmos dados com outras ferramentas de ordenação, como :func:`max`, que " "dependem de um método subjacente diferente. Implementar todas as seis " "comparações também ajuda a evitar confusão para comparações de tipo misto " -"que podem chamar refletido o método :meth:`~object.__gt__`." +"que podem chamar o método espelhado :meth:`~object.__gt__`." -#: ../../library/functions.rst:1856 +#: ../../builtins/functions.rst:1899 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -"Para exemplos de classificação e um breve tutorial de classificação, veja :" -"ref:`sortinghowto`." +"Para exemplos de classificação e um breve tutorial de classificação, " +"veja :ref:`sortinghowto`." -#: ../../library/functions.rst:1860 +#: ../../builtins/functions.rst:1903 msgid "Transform a method into a static method." msgstr "Transforma um método em método estático." -#: ../../library/functions.rst:1862 +#: ../../builtins/functions.rst:1905 msgid "" "A static method does not receive an implicit first argument. To declare a " "static method, use this idiom::" @@ -3324,37 +3694,47 @@ msgstr "" "Um método estático não recebe um primeiro argumento implícito. Para declarar " "um método estático, use este idioma::" -#: ../../library/functions.rst:1869 +#: ../../builtins/functions.rst:1908 +msgid "" +"class C:\n" +" @staticmethod\n" +" def f(arg1, arg2, argN): ..." +msgstr "" +"class C:\n" +" @staticmethod\n" +" def f(arg1, arg2, argN): ..." + +#: ../../builtins/functions.rst:1912 msgid "" -"The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:" -"`function` for details." +"The ``@staticmethod`` form is a function :term:`decorator` -- " +"see :ref:`function` for details." msgstr "" -"A forma ``@staticmethod`` é uma função de :term:`decorador` -- veja :ref:" -"`function` para detalhes." +"A forma ``@staticmethod`` é uma função de :term:`decorador` -- " +"veja :ref:`function` para detalhes." -#: ../../library/functions.rst:1872 +#: ../../builtins/functions.rst:1915 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()``). Moreover, the static " +"method :term:`descriptor` is also callable, so it can be used in the class " +"definition (such as ``f()``)." msgstr "" "Um método estático pode ser chamado na classe (tal como ``C.f()``) ou em uma " "instância (tal como ``C().f()``). Além disso, o :term:`descritor` de método " "estático também é um chamável, então ele pode ser usado na definição de " "classe (como ``f()``)." -#: ../../library/functions.rst:1877 +#: ../../builtins/functions.rst:1920 msgid "" "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 " +"see :deco:`classmethod` for a variant that is useful for creating alternate " "class constructors." msgstr "" "Métodos estáticos em Python são similares àqueles encontrados em Java ou C+" -"+. Veja também :func:`classmethod` para uma variante útil na criação de " +"+. Veja também :deco:`classmethod` para uma variante útil na criação de " "construtores de classe alternativos." -#: ../../library/functions.rst:1881 +#: ../../builtins/functions.rst:1924 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 " @@ -3368,28 +3748,44 @@ msgstr "" "corpo de classe e deseja evitar a transformação automática em método de " "instância. Para esses casos, use este idioma::" -#: ../../library/functions.rst:1893 +#: ../../builtins/functions.rst:1930 +msgid "" +"def regular_function():\n" +" ...\n" +"\n" +"class C:\n" +" method = staticmethod(regular_function)" +msgstr "" +"def função_comum():\n" +" ...\n" +"\n" +"class C:\n" +" método = staticmethod(função_comum)" + +#: ../../builtins/functions.rst:1936 msgid "For more information on static methods, see :ref:`types`." msgstr "Para mais informações sobre métodos estáticos, consulte :ref:`types`." -#: ../../library/functions.rst:1895 +#: ../../builtins/functions.rst:1938 msgid "" -"Static methods now inherit the method attributes (``__module__``, " -"``__name__``, ``__qualname__``, ``__doc__`` and ``__annotations__``), have a " -"new ``__wrapped__`` attribute, and are now callable as regular functions." +"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 "" -"Métodos estáticos agora herdam os atributos do método (``__module__``, " -"``__name__``, ``__qualname__``, ``__doc__`` e ``__annotations__``), têm um " -"novo atributo ``__wrapped__`` e agora são chamáveis como funções regulares." +"Métodos estáticos agora herdam os atributos do método " +"(:attr:`~function.__module__`, :attr:`~function.__name__`, :attr:`~function.__qualname__`, :attr:`~function.__doc__` " +"e :attr:`~function.__annotations__`), têm um novo atributo ``__wrapped__`` e " +"são agora chamáveis como funções regulares." -#: ../../library/functions.rst:1910 +#: ../../builtins/functions.rst:1956 msgid "" "Return a :class:`str` version of *object*. See :func:`str` for details." msgstr "" "Retorna uma versão :class:`str` de *object*. Consulte :func:`str` para " "detalhes." -#: ../../library/functions.rst:1912 +#: ../../builtins/functions.rst:1958 msgid "" "``str`` is the built-in string :term:`class`. For general information about " "strings, see :ref:`textseq`." @@ -3397,7 +3793,7 @@ msgstr "" "``str`` é uma :term:`classe` de string embutida. Para informações gerais " "sobre strings, consulte :ref:`textseq`." -#: ../../library/functions.rst:1918 +#: ../../builtins/functions.rst:1964 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 " @@ -3407,13 +3803,13 @@ msgstr "" "retornam o total. Os itens do *iterable* são normalmente números e o valor " "inicial não pode ser uma string." -#: ../../library/functions.rst:1922 +#: ../../builtins/functions.rst:1968 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, " -"see :func:`math.fsum`\\. To concatenate a series of iterables, consider " -"using :func:`itertools.chain`." +"preferred, fast way to concatenate a sequence of strings is by calling " +"``''.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 "" "Para alguns casos de uso, existem boas alternativas para :func:`sum`. A " "maneira rápida e preferida de concatenar uma sequência de strings é chamando " @@ -3421,11 +3817,11 @@ msgstr "" "precisão estendida, consulte :func:`math.fsum`. Para concatenar uma série de " "iteráveis, considere usar :func:`itertools.chain`." -#: ../../library/functions.rst:1928 +#: ../../builtins/functions.rst:1974 msgid "The *start* parameter can be specified as a keyword argument." msgstr "O parâmetro *start* pode ser especificado como um argumento nomeado." -#: ../../library/functions.rst:1931 +#: ../../builtins/functions.rst:1977 msgid "" "Summation of floats switched to an algorithm that gives higher accuracy and " "better commutativity on most builds." @@ -3433,7 +3829,7 @@ msgstr "" "A soma dos pontos flutuantes foi alterada para um algoritmo que oferece " "maior precisão e melhor comutatividade na maioria das compilações." -#: ../../library/functions.rst:1938 +#: ../../builtins/functions.rst:1984 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 " @@ -3443,7 +3839,7 @@ msgstr "" "irmão do *type*. Isso é útil para acessar métodos herdados que foram " "substituídos em uma classe." -#: ../../library/functions.rst:1942 +#: ../../builtins/functions.rst:1988 msgid "" "The *object_or_type* determines the :term:`method resolution order` to be " "searched. The search starts from the class right after the *type*." @@ -3451,29 +3847,29 @@ msgstr "" "O *object_or_type* determina a :term:`ordem de resolução de métodos` a ser " "pesquisada. A pesquisa inicia a partir da classe logo após o *type*." -#: ../../library/functions.rst:1946 +#: ../../builtins/functions.rst:1992 msgid "" -"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` " +"For example, if :attr:`~type.__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 "" -"Por exemplo, se :attr:`~class.__mro__` de *object_or_type* é ``D -> B -> C -" -"> A -> object`` e o valor de *type* é ``B``, então :func:`super` procura por " +"Por exemplo, se :attr:`~type.__mro__` de *object_or_type* é ``D -> B -> C -> " +"A -> object`` e o valor de *type* é ``B``, então :func:`super` procura por " "``C -> A -> object``." -#: ../../library/functions.rst:1950 +#: ../../builtins/functions.rst:1996 msgid "" -"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." +"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." msgstr "" -"O atributo :attr:`~class.__mro__` do *object_or_type* lista a ordem de " -"pesquisa de resolução de método usada por :func:`getattr` e :func:`super`. O " -"atributo é dinâmico e pode mudar sempre que a hierarquia da herança é " -"atualizada." +"O atributo :attr:`~type.__mro__` da classe correspondente ao " +"*object_or_type* lista a ordem de pesquisa de resolução de método usada " +"por :func:`getattr` e :func:`super`. O atributo é dinâmico e pode mudar " +"sempre que a hierarquia da herança é atualizada." -#: ../../library/functions.rst:1955 +#: ../../builtins/functions.rst:2001 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. " @@ -3485,7 +3881,7 @@ msgstr "" "verdadeiro. Se o segundo argumento é um tipo, ``issubclass(type2, type)`` " "deve ser verdadeiro (isto é útil para classmethods)." -#: ../../library/functions.rst:1960 +#: ../../builtins/functions.rst:2006 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 " @@ -3502,7 +3898,7 @@ msgstr "" "esperado em funções aninhadas, incluindo expressões geradoras, que criam " "funções aninhadas implicitamente.)" -#: ../../library/functions.rst:1967 +#: ../../builtins/functions.rst:2013 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 " @@ -3510,11 +3906,11 @@ msgid "" "closely parallels the use of *super* in other programming languages." msgstr "" "Existem dois casos de uso típicos para *super*. Em uma hierarquia de classes " -"com herança única, *super* pode ser usado para se referir a classes-pai sem " +"com herança única, *super* pode ser usado para se referir a classes base sem " "nomeá-las explicitamente, tornando o código mais sustentável. Esse uso é " "paralelo ao uso de *super* em outras linguagens de programação." -#: ../../library/functions.rst:1972 +#: ../../builtins/functions.rst:2018 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 " @@ -3537,12 +3933,24 @@ msgstr "" "e porque essa ordem pode incluir classes de irmãos desconhecidas antes do " "tempo de execução)." -#: ../../library/functions.rst:1982 +#: ../../builtins/functions.rst:2028 msgid "For both use cases, a typical superclass call looks like this::" msgstr "" "Nos dois casos de uso, uma chamada típica de superclasse se parece com isso::" -#: ../../library/functions.rst:1989 +#: ../../builtins/functions.rst:2030 +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 método(self, arg):\n" +" super().método(arg) # Isso faz o mesmo que:\n" +" # super(C, self).método(arg)" + +#: ../../builtins/functions.rst:2035 msgid "" "In addition to method lookups, :func:`super` also works for attribute " "lookups. One possible use case for this is calling :term:`descriptors " @@ -3552,7 +3960,7 @@ msgstr "" "de atributo. Um possível caso de uso para isso é chamar :term:`descritores " "` em uma classe pai ou irmã." -#: ../../library/functions.rst:1993 +#: ../../builtins/functions.rst:2039 msgid "" "Note that :func:`super` is implemented as part of the binding process for " "explicit dotted attribute lookups such as ``super().__getitem__(name)``. It " @@ -3562,14 +3970,14 @@ msgid "" "using statements or operators such as ``super()[name]``." msgstr "" "Observe que :func:`super` é implementada como parte do processo de " -"vinculação para procura explícita de atributos com ponto, tal como ``super()." -"__getitem__(nome)``. Ela faz isso implementando seu próprio método :meth:" -"`~object.__getattribute__` para pesquisar classes em uma ordem predizível " -"que possui suporte a herança múltipla cooperativa. Logo, :func:`super` não é " -"definida para procuras implícitas usando instruções ou operadores como " -"``super()[name]``." +"vinculação para procura explícita de atributos com ponto, tal como " +"``super().__getitem__(nome)``. Ela faz isso implementando seu próprio " +"método :meth:`~object.__getattribute__` para pesquisar classes em uma ordem " +"predizível que possui suporte a herança múltipla cooperativa. " +"Logo, :func:`super` não é definida para procuras implícitas usando " +"instruções ou operadores como ``super()[name]``." -#: ../../library/functions.rst:2001 +#: ../../builtins/functions.rst:2047 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 " @@ -3586,17 +3994,17 @@ msgstr "" "corretamente a classe que está sendo definida, além de acessar a instância " "atual para métodos comuns." -#: ../../library/functions.rst:2008 +#: ../../builtins/functions.rst:2054 msgid "" -"For practical suggestions on how to design cooperative classes using :func:" -"`super`, see `guide to using super() `_." +"For practical suggestions on how to design cooperative classes " +"using :func:`super`, see `guide to using super() `_." msgstr "" -"Para sugestões práticas sobre como projetar classes cooperativas usando :" -"func:`super`, consulte o `guia para uso de super() `_." +"Para sugestões práticas sobre como projetar classes cooperativas " +"usando :func:`super`, consulte o `guia para uso de super() `_." -#: ../../library/functions.rst:2018 +#: ../../builtins/functions.rst:2063 msgid "" "Rather than being a function, :class:`tuple` is actually an immutable " "sequence type, as documented in :ref:`typesseq-tuple` and :ref:`typesseq`." @@ -3604,17 +4012,17 @@ msgstr "" "Ao invés de ser uma função, :class:`tuple` é na verdade um tipo de sequência " "imutável, conforme documentado em :ref:`typesseq-tuple` e :ref:`typesseq`." -#: ../../library/functions.rst:2027 +#: ../../builtins/functions.rst:2072 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__ `." +"type object and generally the same object as returned " +"by :attr:`object.__class__`." msgstr "" "Com um argumento, retorna o tipo de um *object*. O valor de retorno é um " -"tipo de objeto e geralmente o mesmo objeto retornado por :attr:`object." -"__class__ `." +"tipo de objeto e geralmente o mesmo objeto retornado " +"por :attr:`object.__class__`." -#: ../../library/functions.rst:2031 +#: ../../builtins/functions.rst:2076 msgid "" "The :func:`isinstance` built-in function is recommended for testing the type " "of an object, because it takes subclasses into account." @@ -3622,33 +4030,45 @@ msgstr "" "A função embutida :func:`isinstance` é recomendada para testar o tipo de um " "objeto, porque ela leva sub-classes em consideração." -#: ../../library/functions.rst:2035 +#: ../../builtins/functions.rst:2079 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:`~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:" +"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 "" "Com três argumentos, retorna um novo objeto type. Esta é essencialmente a " "forma dinâmica da instrução :keyword:`class`. A string *name* é o nome da " -"classe e se torna o atributo :attr:`~definition.__name__`. A tupla *bases* " -"contém as classes bases e se torna o atributo :attr:`~class.__bases__`; se " +"classe e se torna o atributo :attr:`~type.__name__`. A tupla *bases* contém " +"as classes bases e se torna o atributo :attr:`~type.__bases__`; se " "vazio, :class:`object`, a base final de todas as classes é adicionada. O " "dicionário *dict* contém definições de atributo e método para o corpo da " -"classe; ele pode ser copiado ou envolto antes de se tornar o atributo :attr:" -"`~object.__dict__`. As duas instruções a seguir criam objetos :class:`type` " -"idênticos:" +"classe; ele pode ser copiado ou envolto antes de se tornar o " +"atributo :attr:`~type.__dict__`. As duas instruções a seguir criam " +"objetos :class:`!type` idênticos:" + +#: ../../builtins/functions.rst:2094 +msgid "See also:" +msgstr "Veja também:" -#: ../../library/functions.rst:2050 -msgid "See also :ref:`bltin-type-objects`." -msgstr "Veja também :ref:`bltin-type-objects`." +#: ../../builtins/functions.rst:2096 +msgid "" +":ref:`Documentation on attributes and methods on classes `." +msgstr "" +":ref:`Documentação sobre atributos e métodos em classes `." + +#: ../../builtins/functions.rst:2097 +msgid ":ref:`bltin-type-objects`" +msgstr ":ref:`bltin-type-objects`" -#: ../../library/functions.rst:2052 +#: ../../builtins/functions.rst:2099 msgid "" "Keyword arguments provided to the three argument form are passed to the " "appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) " @@ -3656,48 +4076,61 @@ msgid "" "would." msgstr "" "Argumentos nomeados fornecidos para a forma de três argumentos são passados " -"para a máquina metaclasse apropriada (geralmente :meth:`~object." -"__init_subclass__`) da mesma forma que palavras-chave em uma definição de " -"classe (além de *metaclasse*) fariam." +"para a máquina metaclasse apropriada " +"(geralmente :meth:`~object.__init_subclass__`) da mesma forma que palavras-" +"chave em uma definição de classe (além de *metaclasse*) fariam." + +#: ../../builtins/functions.rst:2104 +msgid "" +"Unlike a :keyword:`class` statement, the three argument form does not call " +"the metaclass ``__prepare__`` method (see :ref:`prepare`). " +"Use :func:`types.new_class` to dynamically create a class using the " +"appropriate metaclass." +msgstr "" +"Diferentemente de uma instrução :keyword:`class`, a forma de três argumento " +"não chama o método metaclasse ``__prepare__`` (veja :ref:`prepare`). " +"Ise :func:`types.new_class` para criar dinamicamente uma classe usando a " +"metaclasse apropriada." -#: ../../library/functions.rst:2057 +#: ../../builtins/functions.rst:2109 msgid "See also :ref:`class-customization`." msgstr "Veja também :ref:`class-customization`." -#: ../../library/functions.rst:2059 +#: ../../builtins/functions.rst:2111 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 "" -"Subclasses de :class:`type` que não fazem sobrecarga de ``type.__new__`` não " -"podem mais usar a forma com apenas um argumento para obter o tipo de um " -"objeto." +"Subclasses de :class:`!type` que não substituem ``type.__new__`` não podem " +"mais usar a forma com apenas um argumento para obter o tipo de um objeto." -#: ../../library/functions.rst:2066 +#: ../../builtins/functions.rst:2118 msgid "" "Return the :attr:`~object.__dict__` attribute for a module, class, instance, " -"or any other object with a :attr:`~object.__dict__` attribute." +"or any other object with a :attr:`!__dict__` attribute." msgstr "" "Retorna o atributo :attr:`~object.__dict__` para um módulo, classe, " -"instância, or qualquer outro objeto com um atributo :attr:`~object.__dict__`." +"instância, or qualquer outro objeto com um atributo :attr:`!__dict__`." -#: ../../library/functions.rst:2069 +#: ../../builtins/functions.rst:2121 msgid "" -"Objects such as modules and instances have an updateable :attr:`~object." -"__dict__` attribute; however, other objects may have write restrictions on " -"their :attr:`~object.__dict__` attributes (for example, classes use a :class:" -"`types.MappingProxyType` to prevent direct dictionary updates)." +"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)." msgstr "" -"Objetos como modelos e instâncias têm um atributo atualizável :attr:`~object." -"__dict__`; porém, outros projetos podem ter restrições de escrita em seus " -"atributos :attr:`~object.__dict__` (por exemplo, classes usam um :class:" -"`types.MappingProxyType` para prevenir atualizações diretas a dicionário)." +"Objetos como modelos e instâncias têm um atributo " +"atualizável :attr:`~object.__dict__`; porém, outros projetos podem ter " +"restrições de escrita em seus atributos :attr:`!__dict__` (por exemplo, " +"classes usam um :class:`types.MappingProxyType` para prevenir atualizações " +"diretas a dicionário)." -#: ../../library/functions.rst:2074 +#: ../../builtins/functions.rst:2126 msgid "Without an argument, :func:`vars` acts like :func:`locals`." msgstr "Sem nenhum argumento, :func:`vars` age como :func:`locals`." -#: ../../library/functions.rst:2076 +#: ../../builtins/functions.rst:2128 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 " @@ -3707,7 +4140,7 @@ msgstr "" "ela não tem um atributo :attr:`~object.__dict__` (por exemplo, se sua classe " "define o atributo :attr:`~object.__slots__`)." -#: ../../library/functions.rst:2082 +#: ../../builtins/functions.rst:2134 msgid "" "The result of calling this function without an argument has been updated as " "described for the :func:`locals` builtin." @@ -3715,7 +4148,7 @@ msgstr "" "O resultado de chamar esta função sem um argumento foi atualizado conforme " "descrito na embutida :func:`locals`." -#: ../../library/functions.rst:2088 +#: ../../builtins/functions.rst:2140 msgid "" "Iterate over several iterables in parallel, producing tuples with an item " "from each one." @@ -3723,11 +4156,28 @@ msgstr "" "Itera sobre vários iteráveis em paralelo, produzindo tuplas com um item de " "cada um." -#: ../../library/functions.rst:2091 +#: ../../builtins/functions.rst:2143 msgid "Example::" msgstr "Exemplo::" -#: ../../library/functions.rst:2100 +#: ../../builtins/functions.rst:2145 +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], ['açúcar', 'tempero', 'tudo que há de " +"bom']):\n" +"... print(item)\n" +"...\n" +"(1, 'açúcar')\n" +"(2, 'tempero')\n" +"(3, 'tudo que há de bom')" + +#: ../../builtins/functions.rst:2152 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." @@ -3736,27 +4186,27 @@ msgstr "" "ésima tupla contém o *i*-ésimo elemento de cada um dos iteráveis do " "argumento." -#: ../../library/functions.rst:2103 +#: ../../builtins/functions.rst:2155 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 `_." +"columns into rows. This is similar to `transposing a matrix `_." msgstr "" "Outra maneira de pensar em :func:`zip` é que ela transforma linhas em " "colunas e colunas em linhas. Isso é semelhante a `transpor uma matriz " "`_." -#: ../../library/functions.rst:2107 +#: ../../builtins/functions.rst:2159 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`." +"iterated on, e.g. by a :keyword:`!for` loop or by wrapping in " +"a :class:`list`." msgstr "" ":func:`zip` é preguiçoso: Os elementos não serão processados até que o " -"iterável seja iterado. Por exemplo, por um loop :keyword:`!for` ou por um :" -"class:`list`." +"iterável seja iterado. Por exemplo, por um loop :keyword:`!for` ou por " +"um :class:`list`." -#: ../../library/functions.rst:2111 +#: ../../builtins/functions.rst:2163 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 " @@ -3768,7 +4218,7 @@ msgstr "" "bug no código que preparou esses iteráveis. Python oferece três abordagens " "diferentes para lidar com esse problema:" -#: ../../library/functions.rst:2116 +#: ../../builtins/functions.rst:2168 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 " @@ -3778,7 +4228,15 @@ msgstr "" "ignorar os itens restantes nos iteráveis mais longos, cortando o resultado " "para o comprimento do iterável mais curto::" -#: ../../library/functions.rst:2123 +#: ../../builtins/functions.rst:2172 +msgid "" +">>> list(zip(range(3), ['fee', 'fi', 'fo', 'fum']))\n" +"[(0, 'fee'), (1, 'fi'), (2, 'fo')]" +msgstr "" +">>> list(zip(range(3), ['fi', 'fa', 'fo', 'fum']))\n" +"[(0, 'fi'), (1, 'fa'), (2, 'fo')]" + +#: ../../builtins/functions.rst:2175 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`` " @@ -3788,15 +4246,23 @@ msgstr "" "considerados de tamanho igual. Nesses casos, é recomendado usar a opção " "``strict=True``. Sua saída é a mesma do :func:`zip`:: normal" -#: ../../library/functions.rst:2130 +#: ../../builtins/functions.rst:2179 +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)]" + +#: ../../builtins/functions.rst:2182 msgid "" "Unlike the default behavior, it raises a :exc:`ValueError` if one iterable " "is exhausted before the others:" msgstr "" -"Ao contrário do comportamento padrão, ele levanta uma exceção :exc:" -"`ValueError` se um iterável for esgotado antes dos outros:" +"Ao contrário do comportamento padrão, ele levanta uma " +"exceção :exc:`ValueError` se um iterável for esgotado antes dos outros:" -#: ../../library/functions.rst:2148 +#: ../../builtins/functions.rst:2200 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 " @@ -3806,17 +4272,17 @@ msgstr "" "diferentes comprimentos será silenciado, possivelmente se manifestando como " "um bug difícil de encontrar em outra parte do programa." -#: ../../library/functions.rst:2152 +#: ../../builtins/functions.rst:2204 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`." +"iterables have the same length. This is done " +"by :func:`itertools.zip_longest`." msgstr "" "Iteráveis mais curtos podem ser preenchidos com um valor constante para " "fazer com que todos os iteráveis tenham o mesmo comprimento. Isso é feito " "por :func:`itertools.zip_longest`." -#: ../../library/functions.rst:2156 +#: ../../builtins/functions.rst:2208 msgid "" "Edge cases: With a single iterable argument, :func:`zip` returns an iterator " "of 1-tuples. With no arguments, it returns an empty iterator." @@ -3824,11 +4290,11 @@ msgstr "" "Casos extremos: Com um único argumento iterável, :func:`zip` retorna um " "iterador de tuplas de um elemento. Sem argumentos, retorna um iterador vazio." -#: ../../library/functions.rst:2159 +#: ../../builtins/functions.rst:2211 msgid "Tips and tricks:" msgstr "Dicas e truques:" -#: ../../library/functions.rst:2161 +#: ../../builtins/functions.rst:2213 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 " @@ -3843,7 +4309,7 @@ msgstr "" "de chamadas ``n`` para o iterador. Isso tem o efeito de dividir a entrada em " "pedaços de n comprimentos." -#: ../../library/functions.rst:2167 +#: ../../builtins/functions.rst:2219 msgid "" ":func:`zip` in conjunction with the ``*`` operator can be used to unzip a " "list::" @@ -3851,11 +4317,29 @@ msgstr "" ":func:`zip` em conjunto com o operador ``*`` pode ser usado para " "descompactar uma lista::" -#: ../../library/functions.rst:2178 +#: ../../builtins/functions.rst:2222 +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" +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" + +#: ../../builtins/functions.rst:2230 msgid "Added the ``strict`` argument." msgstr "Adicionado o argumento ``strict``." -#: ../../library/functions.rst:2190 +#: ../../builtins/functions.rst:2242 msgid "" "This is an advanced function that is not needed in everyday Python " "programming, unlike :func:`importlib.import_module`." @@ -3863,7 +4347,7 @@ msgstr "" "Esta é uma função avançada que não é necessária na programação diária do " "Python, ao contrário de :func:`importlib.import_module`." -#: ../../library/functions.rst:2193 +#: ../../builtins/functions.rst:2245 msgid "" "This function is invoked by the :keyword:`import` statement. It can be " "replaced (by importing the :mod:`builtins` module and assigning to " @@ -3875,15 +4359,16 @@ msgid "" "discouraged in favor of :func:`importlib.import_module`." msgstr "" "Esta função é chamada pela instrução :keyword:`import`. Ela pode ser " -"substituída (importando o módulo :mod:`builtins` e atribuindo a ``builtins." -"__import__``) para alterar a semântica da instrução :keyword:`!import`, mas " -"isso é **fortemente** desencorajado, pois geralmente é mais simples usar " -"ganchos de importação (consulte :pep:`302`) para atingir os mesmos objetivos " -"e não causa problemas com o código que pressupõe que a implementação de " -"importação padrão esteja em uso. O uso direto de :func:`__import__` também é " -"desencorajado em favor de :func:`importlib.import_module`." +"substituída (importando o módulo :mod:`builtins` e atribuindo a " +"``builtins.__import__``) para alterar a semântica da instrução :keyword:`!" +"import`, mas isso é **fortemente** desencorajado, pois geralmente é mais " +"simples usar ganchos de importação (consulte :pep:`302`) para atingir os " +"mesmos objetivos e não causa problemas com o código que pressupõe que a " +"implementação de importação padrão esteja em uso. O uso direto " +"de :func:`__import__` também é desencorajado em favor " +"de :func:`importlib.import_module`." -#: ../../library/functions.rst:2202 +#: ../../builtins/functions.rst:2254 msgid "" "The function imports the module *name*, potentially using the given " "*globals* and *locals* to determine how to interpret the name in a package " @@ -3899,7 +4384,7 @@ msgstr "" "seu argumento *locals* e usa seus *globals* apenas para determinar o " "contexto do pacote da instrução :keyword:`import`." -#: ../../library/functions.rst:2209 +#: ../../builtins/functions.rst:2261 msgid "" "*level* specifies whether to use absolute or relative imports. ``0`` (the " "default) means only perform absolute imports. Positive values for *level* " @@ -3913,31 +4398,39 @@ msgstr "" "pesquisados em relação ao diretório do módulo que chama :func:`__import__` " "(consulte :pep:`328` para obter detalhes)." -#: ../../library/functions.rst:2215 +#: ../../builtins/functions.rst:2267 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 " "module named by *name*. However, when a non-empty *fromlist* argument is " "given, the module named by *name* is returned." msgstr "" -"Quando a variável *name* está no formato ``package.module``, normalmente, o " +"Quando a variável *name* está no formato ``pacote.módulo``, normalmente, o " "pacote de nível superior (o nome até o primeiro ponto) é retornado, *não* o " "módulo nomeado por *name*. No entanto, quando um argumento *fromlist* não " "vazio é fornecido, o módulo nomeado por *name* é retornado." -#: ../../library/functions.rst:2220 +#: ../../builtins/functions.rst:2272 msgid "" "For example, the statement ``import spam`` results in bytecode resembling " "the following code::" msgstr "" -"Por exemplo, a instrução ``importar spam`` resulta em bytecode semelhante ao " +"Por exemplo, a instrução ``import spam`` resulta em bytecode semelhante ao " "seguinte código::" -#: ../../library/functions.rst:2225 +#: ../../builtins/functions.rst:2275 +msgid "spam = __import__('spam', globals(), locals(), [], 0)" +msgstr "spam = __import__('spam', globals(), locals(), [], 0)" + +#: ../../builtins/functions.rst:2277 msgid "The statement ``import spam.ham`` results in this call::" -msgstr "A instrução ``import spam.ham`` resulta nesta chamada::" +msgstr "A instrução ``import spam.presunto`` resulta nesta chamada::" + +#: ../../builtins/functions.rst:2279 +msgid "spam = __import__('spam.ham', globals(), locals(), [], 0)" +msgstr "spam = __import__('spam.presunto', globals(), locals(), [], 0)" -#: ../../library/functions.rst:2229 +#: ../../builtins/functions.rst:2281 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." @@ -3945,15 +4438,26 @@ msgstr "" "Observe como :func:`__import__` retorna o módulo de nível superior aqui, " "porque este é o objeto vinculado a um nome pela instrução :keyword:`import`." -#: ../../library/functions.rst:2232 +#: ../../builtins/functions.rst:2284 msgid "" "On the other hand, the statement ``from spam.ham import eggs, sausage as " "saus`` results in ::" msgstr "" -"Por outro lado, a instrução ``from spam.ham import eggs, sausage as saus`` " -"resulta em ::" +"Por outro lado, a instrução ``from spam.presunto import ovos, salsicha as " +"sals`` resulta em ::" + +#: ../../builtins/functions.rst:2287 +msgid "" +"_temp = __import__('spam.ham', globals(), locals(), ['eggs', 'sausage'], 0)\n" +"eggs = _temp.eggs\n" +"saus = _temp.sausage" +msgstr "" +"_temp = __import__('spam.presunto', globals(), locals(), ['ovos', " +"'salsicha'], 0)\n" +"ovos = _temp.ovos\n" +"sals = _temp.salsicha" -#: ../../library/functions.rst:2239 +#: ../../builtins/functions.rst:2291 msgid "" "Here, the ``spam.ham`` module is returned from :func:`__import__`. From " "this object, the names to import are retrieved and assigned to their " @@ -3963,7 +4467,7 @@ msgstr "" "desse objeto, os nomes a serem importados são recuperados e atribuídos aos " "seus respectivos nomes." -#: ../../library/functions.rst:2243 +#: ../../builtins/functions.rst:2295 msgid "" "If you simply want to import a module (potentially within a package) by " "name, use :func:`importlib.import_module`." @@ -3971,7 +4475,7 @@ msgstr "" "Se você simplesmente deseja importar um módulo (potencialmente dentro de um " "pacote) pelo nome, use :func:`importlib.import_module`." -#: ../../library/functions.rst:2246 +#: ../../builtins/functions.rst:2298 msgid "" "Negative values for *level* are no longer supported (which also changes the " "default value to 0)." @@ -3979,7 +4483,7 @@ msgstr "" "Valores negativos para *level* não são mais suportados (o que também altera " "o valor padrão para 0)." -#: ../../library/functions.rst:2250 +#: ../../builtins/functions.rst:2302 msgid "" "When the command line options :option:`-E` or :option:`-I` are being used, " "the environment variable :envvar:`PYTHONCASEOK` is now ignored." @@ -3987,11 +4491,11 @@ msgstr "" "Quando as opções de linha de comando :option:`-E` ou :option:`-I` estão " "sendo usadas, a variável de ambiente :envvar:`PYTHONCASEOK` é agora ignorada." -#: ../../library/functions.rst:2255 +#: ../../builtins/functions.rst:2307 msgid "Footnotes" msgstr "Notas de rodapé" -#: ../../library/functions.rst:2256 +#: ../../builtins/functions.rst:2308 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 " @@ -4001,110 +4505,110 @@ msgstr "" "no estilo Unix. Se você estiver lendo o código de um arquivo, use o modo de " "conversão de nova linha para converter novas linhas no estilo Windows ou Mac." -#: ../../library/functions.rst:154 +#: ../../builtins/functions.rst:156 msgid "Boolean" msgstr "Booleano" -#: ../../library/functions.rst:154 ../../library/functions.rst:2025 +#: ../../builtins/functions.rst:156 ../../builtins/functions.rst:2070 msgid "type" msgstr "tipo" -#: ../../library/functions.rst:641 +#: ../../builtins/functions.rst:663 msgid "built-in function" msgstr "função embutida" -#: ../../library/functions.rst:641 +#: ../../builtins/functions.rst:663 msgid "exec" msgstr "exec" -#: ../../library/functions.rst:733 +#: ../../builtins/functions.rst:762 msgid "NaN" msgstr "NaN" -#: ../../library/functions.rst:733 +#: ../../builtins/functions.rst:762 msgid "Infinity" -msgstr "Infinito" +msgstr "Infinity" -#: ../../library/functions.rst:801 +#: ../../builtins/functions.rst:830 msgid "__format__" msgstr "__format__" -#: ../../library/functions.rst:801 ../../library/functions.rst:1902 +#: ../../builtins/functions.rst:830 ../../builtins/functions.rst:1946 msgid "string" msgstr "string" -#: ../../library/functions.rst:801 +#: ../../builtins/functions.rst:830 msgid "format() (built-in function)" msgstr "format() (função embutida)" -#: ../../library/functions.rst:1310 +#: ../../builtins/functions.rst:1341 msgid "file object" msgstr "objeto arquivo" -#: ../../library/functions.rst:1310 ../../library/functions.rst:1431 +#: ../../builtins/functions.rst:1341 ../../builtins/functions.rst:1462 msgid "open() built-in function" msgstr "função embutida open()" -#: ../../library/functions.rst:1338 +#: ../../builtins/functions.rst:1369 msgid "file" msgstr "arquivo" -#: ../../library/functions.rst:1338 +#: ../../builtins/functions.rst:1369 msgid "modes" msgstr "modos" -#: ../../library/functions.rst:1431 +#: ../../builtins/functions.rst:1462 msgid "universal newlines" msgstr "novas linhas universais" -#: ../../library/functions.rst:1492 +#: ../../builtins/functions.rst:1523 msgid "line-buffered I/O" msgstr "E/S com buffer de linha" -#: ../../library/functions.rst:1492 +#: ../../builtins/functions.rst:1523 msgid "unbuffered I/O" msgstr "E/S sem buffer" -#: ../../library/functions.rst:1492 +#: ../../builtins/functions.rst:1523 msgid "buffer size, I/O" msgstr "buffer, tamanho, E/S" -#: ../../library/functions.rst:1492 +#: ../../builtins/functions.rst:1523 msgid "I/O control" msgstr "controle de E/S" -#: ../../library/functions.rst:1492 +#: ../../builtins/functions.rst:1523 msgid "buffering" msgstr "buffering" -#: ../../library/functions.rst:1492 +#: ../../builtins/functions.rst:1523 msgid "text mode" msgstr "texto, modo" -#: ../../library/functions.rst:1492 ../../library/functions.rst:2184 +#: ../../builtins/functions.rst:1523 ../../builtins/functions.rst:2236 msgid "module" msgstr "módulo" -#: ../../library/functions.rst:1492 +#: ../../builtins/functions.rst:1523 msgid "sys" msgstr "sys" -#: ../../library/functions.rst:1902 +#: ../../builtins/functions.rst:1946 msgid "str() (built-in function)" msgstr "str() (função embutida)" -#: ../../library/functions.rst:2025 +#: ../../builtins/functions.rst:2070 msgid "object" msgstr "objeto" -#: ../../library/functions.rst:2184 +#: ../../builtins/functions.rst:2236 msgid "statement" msgstr "instrução" -#: ../../library/functions.rst:2184 +#: ../../builtins/functions.rst:2236 msgid "import" -msgstr "importação" +msgstr "import" -#: ../../library/functions.rst:2184 +#: ../../builtins/functions.rst:2236 msgid "builtins" msgstr "builtins" diff --git a/builtins/index.po b/builtins/index.po new file mode 100644 index 000000000..6a6dae9bf --- /dev/null +++ b/builtins/index.po @@ -0,0 +1,66 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2026, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Rafael Fontenelle , 2026 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2026-09-13 19:06+0000\n" +"Last-Translator: Rafael Fontenelle , 2026\n" +"Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" +"teams/5390/pt_BR/)\n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " +"1000000 == 0 ? 1 : 2;\n" + +#: ../../builtins/index.rst:5 +msgid "Python built-ins reference" +msgstr "Referência da bibliotecas embutidas do Python" + +#: ../../builtins/index.rst:7 +msgid "Python comes with a number of built-in functions and classes." +msgstr "Python vem com diversas funções e classes embutidas." + +#: ../../builtins/index.rst:9 +msgid "" +"The built-in classes include data types that would normally be considered " +"part of the \"core\" of a language, such as numbers and lists. For these " +"types, the Python language core defines the form of literals and places some " +"constraints on their semantics, but does not fully define the semantics." +msgstr "" +"As classes embutidas incluem tipos de dados que seriam normalmente " +"considerados como parte \"central\" de uma linguagem, tais como números e " +"listas. Para esses tipos, o núcleo da linguagem Python define a forma de " +"literais e coloca algumas restrições em suas semânticas, mas não define " +"completamente as semânticas." + +#: ../../builtins/index.rst:14 +msgid "" +"The built-ins also include functions and exceptions --- objects that can be " +"used by all Python code without the need of an :keyword:`import` statement. " +"Some of these are defined by the core language, but many are not essential " +"for the core semantics and are only described here." +msgstr "" +"Os *built-ins* também incluem funções e exceções --- objetos que podem ser " +"usados por todo o código Python sem a necessidade de uma " +"instrução :keyword:`import`. Alguns desses são definidos pelo núcleo da " +"linguagem, mas muitos não são essenciais para as semânticas principais e são " +"apenas descritos aqui." + +#: ../../builtins/index.rst:21 +msgid "" +"In addition to the built-ins, Python provides an extensive importable " +"standard library, see :ref:`library-index`." +msgstr "" +"Além das funções embutidas, o Python fornece uma extensa biblioteca padrão " +"importável, veja :ref:`library-index`." diff --git a/library/stdtypes.po b/builtins/stdtypes.po similarity index 57% rename from library/stdtypes.po rename to builtins/stdtypes.po index 0edfe37cb..7283693bf 100644 --- a/library/stdtypes.po +++ b/builtins/stdtypes.po @@ -1,51 +1,36 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# i17obot , 2021 -# Welington Carlos , 2021 -# Tiago Henrique , 2021 -# (Douglas da Silva) , 2021 -# Misael borges , 2021 -# Danilo Lima , 2021 -# Italo Penaforte , 2022 -# Julia Rizza , 2023 -# Vinicius Gubiani Ferreira , 2023 -# Claudio Rogerio Carvalho Filho , 2023 -# Marco Rougeth , 2023 -# felipe caridade fernandes , 2023 -# Ricardo Cappellano , 2023 -# Patricia Mortada, 2023 -# Lucas Gonçalves Cordeiro , 2023 -# Leandro Cavalcante Damascena , 2024 -# Rafael Fontenelle , 2024 -# Adorilson Bezerra , 2024 +# Adorilson Bezerra , 2026 +# zanarelli, 2026 +# python-doc bot, 2026 +# Rafael Fontenelle , 2026 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-08-09 16:36+0000\n" -"PO-Revision-Date: 2021-06-28 01:13+0000\n" -"Last-Translator: Adorilson Bezerra , 2024\n" +"POT-Creation-Date: 2026-10-25 19:05+0000\n" +"PO-Revision-Date: 2026-09-13 19:06+0000\n" +"Last-Translator: Rafael Fontenelle , 2026\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" -#: ../../library/stdtypes.rst:8 +#: ../../builtins/stdtypes.rst:8 msgid "Built-in Types" msgstr "Tipos embutidos" -#: ../../library/stdtypes.rst:10 +#: ../../builtins/stdtypes.rst:10 msgid "" "The following sections describe the standard types that are built into the " "interpreter." @@ -53,7 +38,7 @@ msgstr "" "As seções a seguir descrevem os tipos padrão que são embutidos ao " "interpretador." -#: ../../library/stdtypes.rst:15 +#: ../../builtins/stdtypes.rst:15 msgid "" "The principal built-in types are numerics, sequences, mappings, classes, " "instances and exceptions." @@ -61,7 +46,7 @@ msgstr "" "Os principais tipos embutidos são numéricos, sequências, mapeamentos, " "classes, instâncias e exceções." -#: ../../library/stdtypes.rst:18 +#: ../../builtins/stdtypes.rst:18 msgid "" "Some collection classes are mutable. The methods that add, subtract, or " "rearrange their members in place, and don't return a specific item, never " @@ -71,7 +56,7 @@ msgstr "" "ou reorganizam seus membros no lugar, e não retornam um item específico, " "nunca retornam a instância da coleção propriamente dita, mas um ``None``." -#: ../../library/stdtypes.rst:22 +#: ../../builtins/stdtypes.rst:22 msgid "" "Some operations are supported by several object types; in particular, " "practically all objects can be compared for equality, tested for truth " @@ -81,40 +66,41 @@ msgid "" msgstr "" "Algumas operações são suportadas por vários tipos de objetos; em particular, " "praticamente todos os objetos podem ser comparados em termos de igualdade, " -"testados quanto ao valor verdade e convertidos em uma string (com a função :" -"func:`repr` ou a função ligeiramente diferente :func:`str`). A última função " -"é implicitamente usada quando um objeto é escrito pela função :func:`print`." +"testados quanto ao valor verdade e convertidos em uma string (com a " +"função :func:`repr` ou a função ligeiramente diferente :func:`str`). A " +"última função é implicitamente usada quando um objeto é escrito pela " +"função :func:`print`." -#: ../../library/stdtypes.rst:32 +#: ../../builtins/stdtypes.rst:32 msgid "Truth Value Testing" msgstr "Teste do valor verdade" -#: ../../library/stdtypes.rst:41 +#: ../../builtins/stdtypes.rst:41 msgid "" -"Any object can be tested for truth value, for use in an :keyword:`if` or :" -"keyword:`while` condition or as operand of the Boolean operations below." +"Any object can be tested for truth value, for use in an :keyword:`if` " +"or :keyword:`while` condition or as operand of the Boolean operations below." msgstr "" "Qualquer objeto pode ser testado quanto ao valor verdade, para uso em uma " "condição :keyword:`if` ou :keyword:`while` ou como operando das operações " "booleanas abaixo." -#: ../../library/stdtypes.rst:46 +#: ../../builtins/stdtypes.rst:46 msgid "" -"By default, an object is considered true unless its class defines either a :" -"meth:`~object.__bool__` method that returns ``False`` or a :meth:`~object." -"__len__` method that returns zero, when called with the object. [1]_ Here " -"are most of the built-in objects considered false:" +"By default, an object is considered true unless its class defines either " +"a :meth:`~object.__bool__` method that returns ``False`` or " +"a :meth:`~object.__len__` method that returns zero, when called with the " +"object. [1]_ Here are most of the built-in objects considered false:" msgstr "" "Por padrão, um objeto é considerado verdadeiro, a menos que sua a classe " "defina um método :meth:`~object.__bool__` que retorne ``False`` ou um " "método :meth:`~object.__len__` que retorna zero, quando chamado com o " "objeto. [1]_ Aqui estão a maioria dos objetos embutidos considerados falsos:" -#: ../../library/stdtypes.rst:56 +#: ../../builtins/stdtypes.rst:56 msgid "constants defined to be false: ``None`` and ``False``" msgstr "constantes definidas para serem falsas: ``None`` e ``False``" -#: ../../library/stdtypes.rst:58 +#: ../../builtins/stdtypes.rst:58 msgid "" "zero of any numeric type: ``0``, ``0.0``, ``0j``, ``Decimal(0)``, " "``Fraction(0, 1)``" @@ -122,7 +108,7 @@ msgstr "" "zero de qualquer tipo numérico: ``0``, ``0.0``, ``0j``, ``Decimal(0)``, " "``Fraction(0, 1)``" -#: ../../library/stdtypes.rst:61 +#: ../../builtins/stdtypes.rst:61 msgid "" "empty sequences and collections: ``''``, ``()``, ``[]``, ``{}``, ``set()``, " "``range(0)``" @@ -130,7 +116,7 @@ msgstr "" "sequências e coleções vazias: ``''``, ``()``, ``[]``, ``{}``, ``set()``, " "``range(0)``" -#: ../../library/stdtypes.rst:70 +#: ../../builtins/stdtypes.rst:70 msgid "" "Operations and built-in functions that have a Boolean result always return " "``0`` or ``False`` for false and ``1`` or ``True`` for true, unless " @@ -142,89 +128,88 @@ msgstr "" "indicações ao contrário. (Exceção importante: as operações Booleanas ``or`` " "e ``and`` sempre retornam um de seus operandos.)" -#: ../../library/stdtypes.rst:79 +#: ../../builtins/stdtypes.rst:79 msgid "Boolean Operations --- :keyword:`!and`, :keyword:`!or`, :keyword:`!not`" msgstr "" "Operações booleanas --- :keyword:`!and`, :keyword:`!or`, :keyword:`!not`" -#: ../../library/stdtypes.rst:83 +#: ../../builtins/stdtypes.rst:83 msgid "These are the Boolean operations, ordered by ascending priority:" msgstr "Esses são as operações booleanas, ordenados por prioridade ascendente:" -#: ../../library/stdtypes.rst:86 ../../library/stdtypes.rst:144 -#: ../../library/stdtypes.rst:276 ../../library/stdtypes.rst:366 -#: ../../library/stdtypes.rst:416 ../../library/stdtypes.rst:965 -#: ../../library/stdtypes.rst:1170 +#: ../../builtins/stdtypes.rst:86 ../../builtins/stdtypes.rst:144 +#: ../../builtins/stdtypes.rst:276 ../../builtins/stdtypes.rst:366 +#: ../../builtins/stdtypes.rst:416 ../../builtins/stdtypes.rst:963 +#: ../../builtins/stdtypes.rst:1185 msgid "Operation" msgstr "Operação" -#: ../../library/stdtypes.rst:86 ../../library/stdtypes.rst:276 -#: ../../library/stdtypes.rst:366 ../../library/stdtypes.rst:416 -#: ../../library/stdtypes.rst:965 ../../library/stdtypes.rst:1170 +#: ../../builtins/stdtypes.rst:86 ../../builtins/stdtypes.rst:276 +#: ../../builtins/stdtypes.rst:366 ../../builtins/stdtypes.rst:416 +#: ../../builtins/stdtypes.rst:963 ../../builtins/stdtypes.rst:1185 msgid "Result" msgstr "Resultado" -#: ../../library/stdtypes.rst:86 ../../library/stdtypes.rst:276 -#: ../../library/stdtypes.rst:416 ../../library/stdtypes.rst:965 -#: ../../library/stdtypes.rst:1170 ../../library/stdtypes.rst:2432 -#: ../../library/stdtypes.rst:3651 +#: ../../builtins/stdtypes.rst:86 ../../builtins/stdtypes.rst:276 +#: ../../builtins/stdtypes.rst:416 ../../builtins/stdtypes.rst:963 +#: ../../builtins/stdtypes.rst:1185 ../../builtins/stdtypes.rst:3014 +#: ../../builtins/stdtypes.rst:4243 msgid "Notes" msgstr "Notas" -#: ../../library/stdtypes.rst:88 +#: ../../builtins/stdtypes.rst:88 msgid "``x or y``" msgstr "``x or y``" -#: ../../library/stdtypes.rst:88 +#: ../../builtins/stdtypes.rst:88 msgid "if *x* is true, then *x*, else *y*" msgstr "se *x* é true, então *x*, do contrário *y*" -#: ../../library/stdtypes.rst:88 ../../library/stdtypes.rst:967 -#: ../../library/stdtypes.rst:970 ../../library/stdtypes.rst:1181 -#: ../../library/stdtypes.rst:2438 ../../library/stdtypes.rst:3657 +#: ../../builtins/stdtypes.rst:88 ../../builtins/stdtypes.rst:965 +#: ../../builtins/stdtypes.rst:968 ../../builtins/stdtypes.rst:1200 +#: ../../builtins/stdtypes.rst:3020 ../../builtins/stdtypes.rst:4249 msgid "\\(1)" msgstr "\\(1)" -#: ../../library/stdtypes.rst:91 +#: ../../builtins/stdtypes.rst:91 msgid "``x and y``" msgstr "``x and y``" -#: ../../library/stdtypes.rst:91 +#: ../../builtins/stdtypes.rst:91 msgid "if *x* is false, then *x*, else *y*" msgstr "se *x* é falso, então *x*, do contrário *y*" -#: ../../library/stdtypes.rst:91 ../../library/stdtypes.rst:289 -#: ../../library/stdtypes.rst:309 ../../library/stdtypes.rst:1209 -#: ../../library/stdtypes.rst:2442 ../../library/stdtypes.rst:2444 -#: ../../library/stdtypes.rst:3661 ../../library/stdtypes.rst:3663 +#: ../../builtins/stdtypes.rst:91 ../../builtins/stdtypes.rst:289 +#: ../../builtins/stdtypes.rst:309 ../../builtins/stdtypes.rst:1211 +#: ../../builtins/stdtypes.rst:3024 ../../builtins/stdtypes.rst:3026 +#: ../../builtins/stdtypes.rst:4253 ../../builtins/stdtypes.rst:4255 msgid "\\(2)" msgstr "\\(2)" -#: ../../library/stdtypes.rst:94 +#: ../../builtins/stdtypes.rst:94 msgid "``not x``" msgstr "``not x``" -#: ../../library/stdtypes.rst:94 +#: ../../builtins/stdtypes.rst:94 msgid "if *x* is false, then ``True``, else ``False``" msgstr "se *x* é falso, então ``True``, caso contrário ``False``" -#: ../../library/stdtypes.rst:94 ../../library/stdtypes.rst:979 -#: ../../library/stdtypes.rst:1212 ../../library/stdtypes.rst:2446 -#: ../../library/stdtypes.rst:2448 ../../library/stdtypes.rst:2450 -#: ../../library/stdtypes.rst:2452 ../../library/stdtypes.rst:3665 -#: ../../library/stdtypes.rst:3667 ../../library/stdtypes.rst:3669 -#: ../../library/stdtypes.rst:3671 +#: ../../builtins/stdtypes.rst:94 ../../builtins/stdtypes.rst:3028 +#: ../../builtins/stdtypes.rst:3030 ../../builtins/stdtypes.rst:3032 +#: ../../builtins/stdtypes.rst:3034 ../../builtins/stdtypes.rst:4257 +#: ../../builtins/stdtypes.rst:4259 ../../builtins/stdtypes.rst:4261 +#: ../../builtins/stdtypes.rst:4263 msgid "\\(3)" msgstr "\\(3)" -#: ../../library/stdtypes.rst:103 ../../library/stdtypes.rst:320 -#: ../../library/stdtypes.rst:434 ../../library/stdtypes.rst:1016 -#: ../../library/stdtypes.rst:1221 ../../library/stdtypes.rst:2478 -#: ../../library/stdtypes.rst:3701 +#: ../../builtins/stdtypes.rst:103 ../../builtins/stdtypes.rst:320 +#: ../../builtins/stdtypes.rst:434 ../../builtins/stdtypes.rst:1007 +#: ../../builtins/stdtypes.rst:1215 ../../builtins/stdtypes.rst:3064 +#: ../../builtins/stdtypes.rst:4293 msgid "Notes:" msgstr "Notas:" -#: ../../library/stdtypes.rst:106 +#: ../../builtins/stdtypes.rst:106 msgid "" "This is a short-circuit operator, so it only evaluates the second argument " "if the first one is false." @@ -232,7 +217,7 @@ msgstr "" "Esse é um operador de curto-circuito, por isso só avalia o segundo argumento " "se o primeiro é falso." -#: ../../library/stdtypes.rst:110 +#: ../../builtins/stdtypes.rst:110 msgid "" "This is a short-circuit operator, so it only evaluates the second argument " "if the first one is true." @@ -240,7 +225,7 @@ msgstr "" "Este é um operador de curto-circuito, por isso só avalia o segundo argumento " "se o primeiro é verdadeiro." -#: ../../library/stdtypes.rst:114 +#: ../../builtins/stdtypes.rst:114 msgid "" "``not`` has a lower priority than non-Boolean operators, so ``not a == b`` " "is interpreted as ``not (a == b)``, and ``a == not b`` is a syntax error." @@ -249,11 +234,11 @@ msgstr "" "``not a == b`` é interpretado como ``not (a == b)`` e ``a == not b`` é um " "erro de sintaxe." -#: ../../library/stdtypes.rst:121 +#: ../../builtins/stdtypes.rst:121 msgid "Comparisons" msgstr "Comparações" -#: ../../library/stdtypes.rst:135 +#: ../../builtins/stdtypes.rst:135 msgid "" "There are eight comparison operations in Python. They all have the same " "priority (which is higher than that of the Boolean operations). Comparisons " @@ -268,97 +253,97 @@ msgstr "" "(porém em ambos os casos *z* não é avaliado de todo quando ``x < y`` é " "sabido ser falso)." -#: ../../library/stdtypes.rst:141 +#: ../../builtins/stdtypes.rst:141 msgid "This table summarizes the comparison operations:" msgstr "Esta tabela resume as operações de comparação:" -#: ../../library/stdtypes.rst:144 ../../library/stdtypes.rst:2409 -#: ../../library/stdtypes.rst:2432 ../../library/stdtypes.rst:3628 -#: ../../library/stdtypes.rst:3651 +#: ../../builtins/stdtypes.rst:144 ../../builtins/stdtypes.rst:2846 +#: ../../builtins/stdtypes.rst:2991 ../../builtins/stdtypes.rst:3014 +#: ../../builtins/stdtypes.rst:4220 ../../builtins/stdtypes.rst:4243 msgid "Meaning" msgstr "Significado" -#: ../../library/stdtypes.rst:146 +#: ../../builtins/stdtypes.rst:146 msgid "``<``" msgstr "``<``" -#: ../../library/stdtypes.rst:146 +#: ../../builtins/stdtypes.rst:146 msgid "strictly less than" msgstr "estritamente menor que" -#: ../../library/stdtypes.rst:148 +#: ../../builtins/stdtypes.rst:148 msgid "``<=``" msgstr "``<=``" -#: ../../library/stdtypes.rst:148 +#: ../../builtins/stdtypes.rst:148 msgid "less than or equal" msgstr "menor que ou igual" -#: ../../library/stdtypes.rst:150 +#: ../../builtins/stdtypes.rst:150 msgid "``>``" msgstr "``>``" -#: ../../library/stdtypes.rst:150 +#: ../../builtins/stdtypes.rst:150 msgid "strictly greater than" msgstr "estritamente maior que" -#: ../../library/stdtypes.rst:152 +#: ../../builtins/stdtypes.rst:152 msgid "``>=``" msgstr "``>=``" -#: ../../library/stdtypes.rst:152 +#: ../../builtins/stdtypes.rst:152 msgid "greater than or equal" msgstr "maior que ou igual" -#: ../../library/stdtypes.rst:154 +#: ../../builtins/stdtypes.rst:154 msgid "``==``" msgstr "``==``" -#: ../../library/stdtypes.rst:154 +#: ../../builtins/stdtypes.rst:154 msgid "equal" msgstr "igual" -#: ../../library/stdtypes.rst:156 +#: ../../builtins/stdtypes.rst:156 msgid "``!=``" msgstr "``!=``" -#: ../../library/stdtypes.rst:156 +#: ../../builtins/stdtypes.rst:156 msgid "not equal" msgstr "não é igual" -#: ../../library/stdtypes.rst:158 +#: ../../builtins/stdtypes.rst:158 msgid "``is``" msgstr "``is``" -#: ../../library/stdtypes.rst:158 +#: ../../builtins/stdtypes.rst:158 msgid "object identity" msgstr "identidade do objeto" -#: ../../library/stdtypes.rst:160 +#: ../../builtins/stdtypes.rst:160 msgid "``is not``" msgstr "``is not``" -#: ../../library/stdtypes.rst:160 +#: ../../builtins/stdtypes.rst:160 msgid "negated object identity" msgstr "identidade de objeto negada" -#: ../../library/stdtypes.rst:167 +#: ../../builtins/stdtypes.rst:167 msgid "" -"Objects of different types, except different numeric types, never compare " -"equal. The ``==`` operator is always defined but for some object types (for " -"example, class objects) is equivalent to :keyword:`is`. The ``<``, ``<=``, " -"``>`` and ``>=`` operators are only defined where they make sense; for " -"example, they raise a :exc:`TypeError` exception when one of the arguments " -"is a complex number." +"Unless stated otherwise, objects of different types never compare equal. The " +"``==`` operator is always defined but for some object types (for example, " +"class objects) is equivalent to :keyword:`is`. The ``<``, ``<=``, ``>`` and " +"``>=`` operators are only defined where they make sense; for example, they " +"raise a :exc:`TypeError` exception when one of the arguments is a complex " +"number." msgstr "" -"Objetos de tipos diferentes, exceto tipos numéricos diferentes, nunca " -"comparam iguais. O operador ``==`` é sempre definido, mas para alguns tipos " -"de objetos (por exemplo, objetos de classe) é equivalente a :keyword:`is`. " -"Os operadores ``<``, ``<=``, ``>`` e ``>=`` são definidos apenas onde fazem " -"sentido; por exemplo, eles levantam uma exceção :exc:`TypeError` quando um " -"dos argumentos é um número complexo." +"Salvo indicação em contrário, objetos de tipos diferentes nunca são " +"comparados como iguais. O operador ``==`` é sempre definido, mas para alguns " +"tipos de objetos (por exemplo, objetos de classe) é equivalente " +"a :keyword:`is`. Os operadores ``<``, ``<=``, ``>`` e ``>=`` só são " +"definidos onde fazem sentido; por exemplo, eles levantam uma " +"exceção :exc:`TypeError` quando um dos argumentos é um número complexo." -#: ../../library/stdtypes.rst:181 +#: ../../builtins/stdtypes.rst:181 msgid "" "Non-identical instances of a class normally compare as non-equal unless the " "class defines the :meth:`~object.__eq__` method." @@ -366,23 +351,25 @@ msgstr "" "Instâncias não idênticas de uma classe normalmente comparam-se como " "desiguais ao menos que a classe defina o método :meth:`~object.__eq__`." -#: ../../library/stdtypes.rst:184 +#: ../../builtins/stdtypes.rst:184 msgid "" "Instances of a class cannot be ordered with respect to other instances of " "the same class, or other types of object, unless the class defines enough of " -"the methods :meth:`~object.__lt__`, :meth:`~object.__le__`, :meth:`~object." -"__gt__`, and :meth:`~object.__ge__` (in general, :meth:`~object.__lt__` and :" -"meth:`~object.__eq__` are sufficient, if you want the conventional meanings " -"of the comparison operators)." +"the " +"methods :meth:`~object.__lt__`, :meth:`~object.__le__`, :meth:`~object.__gt__`, " +"and :meth:`~object.__ge__` (in general, :meth:`~object.__lt__` " +"and :meth:`~object.__eq__` are sufficient, if you want the conventional " +"meanings of the comparison operators)." msgstr "" "Instâncias de uma classe não podem ser ordenadas com respeito a outras " "instâncias da mesma classe, ou outros tipos de objeto, ao menos que a classe " -"defina o suficiente dos métodos :meth:`~object.__lt__`, :meth:`~object." -"__le__`, :meth:`~object.__gt__` e :meth:`~object.__ge__` (no geral, :meth:" -"`~object.__lt__` e :meth:`~object.__eq__` são suficientes, se você quiser o " -"significado convencional dos operadores de comparação)." +"defina o suficiente dos " +"métodos :meth:`~object.__lt__`, :meth:`~object.__le__`, :meth:`~object.__gt__` " +"e :meth:`~object.__ge__` (no geral, :meth:`~object.__lt__` " +"e :meth:`~object.__eq__` são suficientes, se você quiser o significado " +"convencional dos operadores de comparação)." -#: ../../library/stdtypes.rst:191 +#: ../../builtins/stdtypes.rst:191 msgid "" "The behavior of the :keyword:`is` and :keyword:`is not` operators cannot be " "customized; also they can be applied to any two objects and never raise an " @@ -392,33 +379,34 @@ msgstr "" "ser personalizado; além disso eles podem ser aplicados a quaisquer dois " "objetos e nunca levantam uma exceção." -#: ../../library/stdtypes.rst:199 +#: ../../builtins/stdtypes.rst:199 msgid "" -"Two more operations with the same syntactic priority, :keyword:`in` and :" -"keyword:`not in`, are supported by types that are :term:`iterable` or " +"Two more operations with the same syntactic priority, :keyword:`in` " +"and :keyword:`not in`, are supported by types that are :term:`iterable` or " "implement the :meth:`~object.__contains__` method." msgstr "" -"Mais duas operações com a mesma prioridade sintática, :keyword:`in` e :" -"keyword:`not in`, são suportadas por tipos que são :term:`iteráveis " +"Mais duas operações com a mesma prioridade sintática, :keyword:`in` " +"e :keyword:`not in`, são suportadas por tipos que são :term:`iteráveis " "` ou implementam o método :meth:`~object.__contains__`." -#: ../../library/stdtypes.rst:206 +#: ../../builtins/stdtypes.rst:206 msgid "Numeric Types --- :class:`int`, :class:`float`, :class:`complex`" msgstr "Tipos numéricos --- :class:`int`, :class:`float`, :class:`complex`" -#: ../../library/stdtypes.rst:216 +#: ../../builtins/stdtypes.rst:216 msgid "" "There are three distinct numeric types: :dfn:`integers`, :dfn:`floating-" "point numbers`, and :dfn:`complex numbers`. In addition, Booleans are a " "subtype of integers. Integers have unlimited precision. Floating-point " "numbers are usually implemented using :c:expr:`double` in C; information " "about the precision and internal representation of floating-point numbers " -"for the machine on which your program is running is available in :data:`sys." -"float_info`. Complex numbers have a real and imaginary part, which are each " -"a floating-point number. To extract these parts from a complex number *z*, " -"use ``z.real`` and ``z.imag``. (The standard library includes the additional " -"numeric types :mod:`fractions.Fraction`, for rationals, and :mod:`decimal." -"Decimal`, for floating-point numbers with user-definable precision.)" +"for the machine on which your program is running is available " +"in :data:`sys.float_info`. Complex numbers have a real and imaginary part, " +"which are each a floating-point number. To extract these parts from a " +"complex number *z*, use ``z.real`` and ``z.imag``. (The standard library " +"includes the additional numeric types :mod:`fractions.Fraction`, for " +"rationals, and :mod:`decimal.Decimal`, for floating-point numbers with user-" +"definable precision.)" msgstr "" "Existem três tipos numéricos distintos: :dfn:`inteiros`, :dfn:`números de " "ponto flutuante` e :dfn:`números complexos`. Além disso, os booleanos são um " @@ -433,7 +421,7 @@ msgstr "" "racionais, e :mod:`decimal.Decimal`, para números de ponto flutuante com " "precisão definida pelo usuário.)" -#: ../../library/stdtypes.rst:238 +#: ../../builtins/stdtypes.rst:238 msgid "" "Numbers are created by numeric literals or as the result of built-in " "functions and operators. Unadorned integer literals (including hex, octal " @@ -452,7 +440,7 @@ msgstr "" "com a qual você pode adicionar a um integral ou flutuante para receber um " "número complexo com partes reais e imaginárias." -#: ../../library/stdtypes.rst:263 +#: ../../builtins/stdtypes.rst:263 msgid "" "Python fully supports mixed arithmetic: when a binary arithmetic operator " "has operands of different numeric types, the operand with the \"narrower\" " @@ -469,7 +457,7 @@ msgstr "" "tipos se comporta como se os valores exatos desses números estivessem sendo " "comparados. [2]_" -#: ../../library/stdtypes.rst:269 +#: ../../builtins/stdtypes.rst:269 msgid "" "The constructors :func:`int`, :func:`float`, and :func:`complex` can be used " "to produce numbers of a specific type." @@ -477,7 +465,7 @@ msgstr "" "Os construtores :func:`int`, :func:`float`, e :func:`complex` podem ser " "usados para produzir números de um tipo específico." -#: ../../library/stdtypes.rst:272 +#: ../../builtins/stdtypes.rst:272 msgid "" "All numeric types (except complex) support the following operations (for " "priorities of the operations, see :ref:`operator-summary`):" @@ -485,127 +473,127 @@ msgstr "" "Todos os tipos numéricos (exceto complexos) suportam as seguintes operações " "(para prioridades das operações, consulte :ref:`operator-summary`):" -#: ../../library/stdtypes.rst:276 +#: ../../builtins/stdtypes.rst:276 msgid "Full documentation" msgstr "Documentação completa" -#: ../../library/stdtypes.rst:278 +#: ../../builtins/stdtypes.rst:278 msgid "``x + y``" msgstr "``x + y``" -#: ../../library/stdtypes.rst:278 +#: ../../builtins/stdtypes.rst:278 msgid "sum of *x* and *y*" msgstr "soma de *x* e *y*" -#: ../../library/stdtypes.rst:280 +#: ../../builtins/stdtypes.rst:280 msgid "``x - y``" msgstr "``x - y``" -#: ../../library/stdtypes.rst:280 +#: ../../builtins/stdtypes.rst:280 msgid "difference of *x* and *y*" msgstr "diferença de *x* e *y*" -#: ../../library/stdtypes.rst:282 +#: ../../builtins/stdtypes.rst:282 msgid "``x * y``" msgstr "``x * y``" -#: ../../library/stdtypes.rst:282 +#: ../../builtins/stdtypes.rst:282 msgid "product of *x* and *y*" msgstr "produto de *x* e *y*" -#: ../../library/stdtypes.rst:284 +#: ../../builtins/stdtypes.rst:284 msgid "``x / y``" msgstr "``x / y``" -#: ../../library/stdtypes.rst:284 +#: ../../builtins/stdtypes.rst:284 msgid "quotient of *x* and *y*" msgstr "quociente de *x* e *y*" -#: ../../library/stdtypes.rst:286 +#: ../../builtins/stdtypes.rst:286 msgid "``x // y``" msgstr "``x // y``" -#: ../../library/stdtypes.rst:286 +#: ../../builtins/stdtypes.rst:286 msgid "floored quotient of *x* and *y*" msgstr "piso do quociente de *x* e *y*" -#: ../../library/stdtypes.rst:286 +#: ../../builtins/stdtypes.rst:286 msgid "\\(1)\\(2)" msgstr "\\(1)\\(2)" -#: ../../library/stdtypes.rst:289 +#: ../../builtins/stdtypes.rst:289 msgid "``x % y``" msgstr "``x % y``" -#: ../../library/stdtypes.rst:289 +#: ../../builtins/stdtypes.rst:289 msgid "remainder of ``x / y``" msgstr "restante de ``x / y``" -#: ../../library/stdtypes.rst:291 +#: ../../builtins/stdtypes.rst:291 msgid "``-x``" msgstr "``-x``" -#: ../../library/stdtypes.rst:291 +#: ../../builtins/stdtypes.rst:291 msgid "*x* negated" msgstr "*x* negado" -#: ../../library/stdtypes.rst:293 +#: ../../builtins/stdtypes.rst:293 msgid "``+x``" msgstr "``+x``" -#: ../../library/stdtypes.rst:293 +#: ../../builtins/stdtypes.rst:293 msgid "*x* unchanged" msgstr "*x* inalterado" -#: ../../library/stdtypes.rst:295 +#: ../../builtins/stdtypes.rst:295 msgid "``abs(x)``" msgstr "``abs(x)``" -#: ../../library/stdtypes.rst:295 +#: ../../builtins/stdtypes.rst:295 msgid "absolute value or magnitude of *x*" msgstr "valor absoluto ou magnitude de *x*" -#: ../../library/stdtypes.rst:295 +#: ../../builtins/stdtypes.rst:295 msgid ":func:`abs`" msgstr ":func:`abs`" -#: ../../library/stdtypes.rst:298 +#: ../../builtins/stdtypes.rst:298 msgid "``int(x)``" msgstr "``int(x)``" -#: ../../library/stdtypes.rst:298 +#: ../../builtins/stdtypes.rst:298 msgid "*x* converted to integer" msgstr "*x* convertido em inteiro" -#: ../../library/stdtypes.rst:298 +#: ../../builtins/stdtypes.rst:298 msgid "\\(3)\\(6)" msgstr "\\(3)\\(6)" -#: ../../library/stdtypes.rst:298 +#: ../../builtins/stdtypes.rst:298 msgid ":func:`int`" msgstr ":func:`int`" -#: ../../library/stdtypes.rst:300 +#: ../../builtins/stdtypes.rst:300 msgid "``float(x)``" msgstr "``float(x)``" -#: ../../library/stdtypes.rst:300 +#: ../../builtins/stdtypes.rst:300 msgid "*x* converted to floating point" msgstr "*x* convertido em ponto flutuante" -#: ../../library/stdtypes.rst:300 +#: ../../builtins/stdtypes.rst:300 msgid "\\(4)\\(6)" msgstr "\\(4)\\(6)" -#: ../../library/stdtypes.rst:300 +#: ../../builtins/stdtypes.rst:300 msgid ":func:`float`" msgstr ":func:`float`" -#: ../../library/stdtypes.rst:302 +#: ../../builtins/stdtypes.rst:302 msgid "``complex(re, im)``" msgstr "``complex(re, im)``" -#: ../../library/stdtypes.rst:302 +#: ../../builtins/stdtypes.rst:302 msgid "" "a complex number with real part *re*, imaginary part *im*. *im* defaults to " "zero." @@ -613,60 +601,59 @@ msgstr "" "um número complexo com parte real *re*, parte imaginária *im*. *im* tem como " "padrão zero." -#: ../../library/stdtypes.rst:302 ../../library/stdtypes.rst:1202 -#: ../../library/stdtypes.rst:2440 ../../library/stdtypes.rst:3688 +#: ../../builtins/stdtypes.rst:302 ../../builtins/stdtypes.rst:3022 +#: ../../builtins/stdtypes.rst:4280 msgid "\\(6)" msgstr "\\(6)" -#: ../../library/stdtypes.rst:302 +#: ../../builtins/stdtypes.rst:302 msgid ":func:`complex`" msgstr ":func:`complex`" -#: ../../library/stdtypes.rst:306 +#: ../../builtins/stdtypes.rst:306 msgid "``c.conjugate()``" msgstr "``c.conjugate()``" -#: ../../library/stdtypes.rst:306 +#: ../../builtins/stdtypes.rst:306 msgid "conjugate of the complex number *c*" msgstr "conjugado do número complexo *c*" -#: ../../library/stdtypes.rst:309 +#: ../../builtins/stdtypes.rst:309 msgid "``divmod(x, y)``" msgstr "``divmod(x, y)``" -#: ../../library/stdtypes.rst:309 +#: ../../builtins/stdtypes.rst:309 msgid "the pair ``(x // y, x % y)``" msgstr "o par ``(x // y, x % y)``" -#: ../../library/stdtypes.rst:309 +#: ../../builtins/stdtypes.rst:309 msgid ":func:`divmod`" msgstr ":func:`divmod`" -#: ../../library/stdtypes.rst:311 +#: ../../builtins/stdtypes.rst:311 msgid "``pow(x, y)``" msgstr "``pow(x, y)``" -#: ../../library/stdtypes.rst:311 ../../library/stdtypes.rst:313 +#: ../../builtins/stdtypes.rst:311 ../../builtins/stdtypes.rst:313 msgid "*x* to the power *y*" msgstr "*x* elevado a *y*" -#: ../../library/stdtypes.rst:311 ../../library/stdtypes.rst:313 -#: ../../library/stdtypes.rst:1191 ../../library/stdtypes.rst:1194 -#: ../../library/stdtypes.rst:2465 ../../library/stdtypes.rst:2468 -#: ../../library/stdtypes.rst:2471 ../../library/stdtypes.rst:3684 -#: ../../library/stdtypes.rst:3691 +#: ../../builtins/stdtypes.rst:311 ../../builtins/stdtypes.rst:313 +#: ../../builtins/stdtypes.rst:3047 ../../builtins/stdtypes.rst:3050 +#: ../../builtins/stdtypes.rst:3053 ../../builtins/stdtypes.rst:4276 +#: ../../builtins/stdtypes.rst:4283 msgid "\\(5)" msgstr "\\(5)" -#: ../../library/stdtypes.rst:311 +#: ../../builtins/stdtypes.rst:311 msgid ":func:`pow`" msgstr ":func:`pow`" -#: ../../library/stdtypes.rst:313 +#: ../../builtins/stdtypes.rst:313 msgid "``x ** y``" msgstr "``x ** y``" -#: ../../library/stdtypes.rst:323 +#: ../../builtins/stdtypes.rst:323 msgid "" "Also referred to as integer division. For operands of type :class:`int`, " "the result has type :class:`int`. For operands of type :class:`float`, the " @@ -675,14 +662,15 @@ msgid "" "always rounded towards minus infinity: ``1//2`` is ``0``, ``(-1)//2`` is " "``-1``, ``1//(-2)`` is ``-1``, and ``(-1)//(-2)`` is ``0``." msgstr "" -"Também referido como uma divisão inteira. Para operandos do tipo :class:" -"`int`, o resultado tem o tipo :class:`int`; Para operandos do tipo :class:" -"`float`, o resultado tem o tipo :class:`float`. Em geral o resultado é " -"inteiro como todo, apesar do tipo do resultado não necessariamente ser :" -"class:`int`. O resultado é sempre arredondado para menos infinito: ``1//2`` " -"é ``0``, ``(-1)//2`` é ``-1``, ``1//(-2)`` é ``-1`` e ``(-1)//(-2)`` é ``0``." +"Também referido como uma divisão inteira. Para operandos do " +"tipo :class:`int`, o resultado tem o tipo :class:`int`; Para operandos do " +"tipo :class:`float`, o resultado tem o tipo :class:`float`. Em geral o " +"resultado é inteiro como todo, apesar do tipo do resultado não " +"necessariamente ser :class:`int`. O resultado é sempre arredondado para " +"menos infinito: ``1//2`` é ``0``, ``(-1)//2`` é ``-1``, ``1//(-2)`` é ``-1`` " +"e ``(-1)//(-2)`` é ``0``." -#: ../../library/stdtypes.rst:331 +#: ../../builtins/stdtypes.rst:331 msgid "" "Not for complex numbers. Instead convert to floats using :func:`abs` if " "appropriate." @@ -690,7 +678,7 @@ msgstr "" "Não para números complexos. Ao invés disso, converte para pontos flutuantes " "usando :func:`abs` se for apropriado." -#: ../../library/stdtypes.rst:342 +#: ../../builtins/stdtypes.rst:342 msgid "" "Conversion from :class:`float` to :class:`int` truncates, discarding the " "fractional part. See functions :func:`math.floor` and :func:`math.ceil` for " @@ -700,7 +688,7 @@ msgstr "" "fracionária. Veja as funções :func:`math.floor` e :func:`math.ceil` para " "conversões alternativas." -#: ../../library/stdtypes.rst:347 +#: ../../builtins/stdtypes.rst:347 msgid "" "float also accepts the strings \"nan\" and \"inf\" with an optional prefix " "\"+\" or \"-\" for Not a Number (NaN) and positive or negative infinity." @@ -709,7 +697,7 @@ msgstr "" "opcional \"+\" ou \"-\" a Não é um Número (NaN) e infinidade positiva ou " "negativa." -#: ../../library/stdtypes.rst:351 +#: ../../builtins/stdtypes.rst:351 msgid "" "Python defines ``pow(0, 0)`` and ``0 ** 0`` to be ``1``, as is common for " "programming languages." @@ -717,7 +705,7 @@ msgstr "" "Python define ``pow(0, 0)`` e ``0 ** 0`` sendo ``1``, como é comum para " "linguagens de programação." -#: ../../library/stdtypes.rst:355 +#: ../../builtins/stdtypes.rst:355 msgid "" "The numeric literals accepted include the digits ``0`` to ``9`` or any " "Unicode equivalent (code points with the ``Nd`` property)." @@ -725,7 +713,7 @@ msgstr "" "Os literais numéricos aceitos incluem os dígitos de ``0`` a ``9`` ou " "qualquer equivalente Unicode (pontos de código com a propriedade ``Nd``)." -#: ../../library/stdtypes.rst:358 +#: ../../builtins/stdtypes.rst:358 msgid "" "See `the Unicode Standard `_ for a complete list of code points with the ``Nd`` " @@ -735,7 +723,7 @@ msgstr "" "DerivedNumericType.txt>`_ para obter uma lista completa de pontos de código " "com a propriedade ``Nd``." -#: ../../library/stdtypes.rst:362 +#: ../../builtins/stdtypes.rst:362 msgid "" "All :class:`numbers.Real` types (:class:`int` and :class:`float`) also " "include the following operations:" @@ -743,19 +731,19 @@ msgstr "" "Todos os tipos :class:`numbers.Real` (:class:`int` e :class:`float`) também " "incluem as seguintes operações." -#: ../../library/stdtypes.rst:368 +#: ../../builtins/stdtypes.rst:368 msgid ":func:`math.trunc(\\ x) `" msgstr ":func:`math.trunc(\\ x) `" -#: ../../library/stdtypes.rst:368 +#: ../../builtins/stdtypes.rst:368 msgid "*x* truncated to :class:`~numbers.Integral`" msgstr "*x* truncado para :class:`~numbers.Integral`" -#: ../../library/stdtypes.rst:371 +#: ../../builtins/stdtypes.rst:371 msgid ":func:`round(x[, n]) `" msgstr ":func:`round(x[, n]) `" -#: ../../library/stdtypes.rst:371 +#: ../../builtins/stdtypes.rst:371 msgid "" "*x* rounded to *n* digits, rounding half to even. If *n* is omitted, it " "defaults to 0." @@ -763,35 +751,35 @@ msgstr "" "*x* arredondado para *n* dígitos, arredondando metade para igualar. Se *n* é " "omitido, ele toma o padrão de 0." -#: ../../library/stdtypes.rst:375 +#: ../../builtins/stdtypes.rst:375 msgid ":func:`math.floor(\\ x) `" msgstr ":func:`math.floor(\\ x) `" -#: ../../library/stdtypes.rst:375 +#: ../../builtins/stdtypes.rst:375 msgid "the greatest :class:`~numbers.Integral` <= *x*" msgstr "o maior :class:`~numbers.Integral` <= *x*" -#: ../../library/stdtypes.rst:378 +#: ../../builtins/stdtypes.rst:378 msgid ":func:`math.ceil(x) `" msgstr ":func:`math.ceil(x) `" -#: ../../library/stdtypes.rst:378 +#: ../../builtins/stdtypes.rst:378 msgid "the least :class:`~numbers.Integral` >= *x*" msgstr "pelo menos :class:`~numbers.Integral` >= *x*" -#: ../../library/stdtypes.rst:382 +#: ../../builtins/stdtypes.rst:382 msgid "" "For additional numeric operations see the :mod:`math` and :mod:`cmath` " "modules." msgstr "" -"Para operações numéricas adicionais, consulte os módulos :mod:`math` e :mod:" -"`cmath`." +"Para operações numéricas adicionais, consulte os módulos :mod:`math` " +"e :mod:`cmath`." -#: ../../library/stdtypes.rst:391 +#: ../../builtins/stdtypes.rst:391 msgid "Bitwise Operations on Integer Types" msgstr "Operações de bits em tipos inteiros" -#: ../../library/stdtypes.rst:405 +#: ../../builtins/stdtypes.rst:405 msgid "" "Bitwise operations only make sense for integers. The result of bitwise " "operations is calculated as though carried out in two's complement with an " @@ -801,7 +789,7 @@ msgstr "" "operações bit a bit é calculado como se fosse realizado no complemento de " "dois com um número infinito de bits de sinal." -#: ../../library/stdtypes.rst:409 +#: ../../builtins/stdtypes.rst:409 msgid "" "The priorities of the binary bitwise operations are all lower than the " "numeric operations and higher than the comparisons; the unary operation " @@ -813,101 +801,101 @@ msgstr "" "tem a mesma prioridade que as outras operações numéricas unárias (``+`` e ``-" "``)." -#: ../../library/stdtypes.rst:413 +#: ../../builtins/stdtypes.rst:413 msgid "This table lists the bitwise operations sorted in ascending priority:" msgstr "" "Esta tabela lista as operações de bits classificadas em prioridade " "ascendente:" -#: ../../library/stdtypes.rst:418 +#: ../../builtins/stdtypes.rst:418 msgid "``x | y``" msgstr "``x | y``" -#: ../../library/stdtypes.rst:418 +#: ../../builtins/stdtypes.rst:418 msgid "bitwise :dfn:`or` of *x* and *y*" msgstr ":dfn:`ou` bit a bit de *x* e *y*" -#: ../../library/stdtypes.rst:418 ../../library/stdtypes.rst:421 -#: ../../library/stdtypes.rst:424 ../../library/stdtypes.rst:1216 -#: ../../library/stdtypes.rst:2454 ../../library/stdtypes.rst:2458 -#: ../../library/stdtypes.rst:3673 ../../library/stdtypes.rst:3677 +#: ../../builtins/stdtypes.rst:418 ../../builtins/stdtypes.rst:421 +#: ../../builtins/stdtypes.rst:424 ../../builtins/stdtypes.rst:3036 +#: ../../builtins/stdtypes.rst:3040 ../../builtins/stdtypes.rst:4265 +#: ../../builtins/stdtypes.rst:4269 msgid "\\(4)" msgstr "\\(4)" -#: ../../library/stdtypes.rst:421 +#: ../../builtins/stdtypes.rst:421 msgid "``x ^ y``" msgstr "``x ^ y``" -#: ../../library/stdtypes.rst:421 +#: ../../builtins/stdtypes.rst:421 msgid "bitwise :dfn:`exclusive or` of *x* and *y*" msgstr ":dfn:`ou exclusivo` bit a bit de *x* e *y*" -#: ../../library/stdtypes.rst:424 +#: ../../builtins/stdtypes.rst:424 msgid "``x & y``" msgstr "``x & y``" -#: ../../library/stdtypes.rst:424 +#: ../../builtins/stdtypes.rst:424 msgid "bitwise :dfn:`and` of *x* and *y*" msgstr ":dfn:`e` bit a bit de *x* e *y*" -#: ../../library/stdtypes.rst:427 +#: ../../builtins/stdtypes.rst:427 msgid "``x << n``" msgstr "``x << n``" -#: ../../library/stdtypes.rst:427 +#: ../../builtins/stdtypes.rst:427 msgid "*x* shifted left by *n* bits" msgstr "*x* deslocado para a esquerda por *n* bits" -#: ../../library/stdtypes.rst:427 +#: ../../builtins/stdtypes.rst:427 msgid "(1)(2)" msgstr "(1)(2)" -#: ../../library/stdtypes.rst:429 +#: ../../builtins/stdtypes.rst:429 msgid "``x >> n``" msgstr "``x >> n``" -#: ../../library/stdtypes.rst:429 +#: ../../builtins/stdtypes.rst:429 msgid "*x* shifted right by *n* bits" msgstr "*x* deslocado para a direita por *n* bits" -#: ../../library/stdtypes.rst:429 +#: ../../builtins/stdtypes.rst:429 msgid "(1)(3)" msgstr "(1)(3)" -#: ../../library/stdtypes.rst:431 +#: ../../builtins/stdtypes.rst:431 msgid "``~x``" msgstr "``~x``" -#: ../../library/stdtypes.rst:431 +#: ../../builtins/stdtypes.rst:431 msgid "the bits of *x* inverted" msgstr "os bits de *x* invertidos" -#: ../../library/stdtypes.rst:437 +#: ../../builtins/stdtypes.rst:437 msgid "" "Negative shift counts are illegal and cause a :exc:`ValueError` to be raised." msgstr "" -"Contagens de deslocamento negativo são ilegais e levantam uma :exc:" -"`ValueError` ." +"Contagens de deslocamento negativo são ilegais e levantam " +"uma :exc:`ValueError` ." -#: ../../library/stdtypes.rst:440 +#: ../../builtins/stdtypes.rst:440 msgid "" "A left shift by *n* bits is equivalent to multiplication by ``pow(2, n)``." msgstr "" "Um deslocamento à esquerda por *n* bits é equivalente à multiplicação por " "``pow(2, n)``." -#: ../../library/stdtypes.rst:443 +#: ../../builtins/stdtypes.rst:443 msgid "" "A right shift by *n* bits is equivalent to floor division by ``pow(2, n)``." msgstr "" "Um deslocamento à direita por *n* bits é equivalente à divisão pelo piso por " "``pow(2, n)``." -#: ../../library/stdtypes.rst:446 +#: ../../builtins/stdtypes.rst:446 msgid "" "Performing these calculations with at least one extra sign extension bit in " -"a finite two's complement representation (a working bit-width of ``1 + max(x." -"bit_length(), y.bit_length())`` or more) is sufficient to get the same " +"a finite two's complement representation (a working bit-width of ``1 + " +"max(x.bit_length(), y.bit_length())`` or more) is sufficient to get the same " "result as if there were an infinite number of sign bits." msgstr "" "Executar esses cálculos com pelo menos um bit extra de extensão de sinal na " @@ -915,19 +903,20 @@ msgstr "" "``1 + max(x.bit_length(), y.bit_length())`` ou mais) é suficiente para obter " "o mesmo resultado como se houvesse um número infinito de bits de sinal." -#: ../../library/stdtypes.rst:453 +#: ../../builtins/stdtypes.rst:453 msgid "Additional Methods on Integer Types" msgstr "Métodos adicionais em tipos inteiros" -#: ../../library/stdtypes.rst:455 +#: ../../builtins/stdtypes.rst:455 msgid "" "The int type implements the :class:`numbers.Integral` :term:`abstract base " "class`. In addition, it provides a few more methods:" msgstr "" -"O tipo int implementa a :term:`classe base abstrata` :class:`numbers." -"Integral`. Além disso, ele provê mais alguns métodos:" +"O tipo int implementa a :term:`classe base " +"abstrata` :class:`numbers.Integral`. Além disso, ele provê mais alguns " +"métodos:" -#: ../../library/stdtypes.rst:460 +#: ../../builtins/stdtypes.rst:460 msgid "" "Return the number of bits necessary to represent an integer in binary, " "excluding the sign and leading zeros::" @@ -935,13 +924,27 @@ msgstr "" "Retorna o número de bits necessários para representar um inteiro em binário, " "excluindo o sinal e entrelinha zeros::" -#: ../../library/stdtypes.rst:469 +#: ../../builtins/stdtypes.rst:463 +msgid "" +">>> n = -37\n" +">>> bin(n)\n" +"'-0b100101'\n" +">>> n.bit_length()\n" +"6" +msgstr "" +">>> n = -37\n" +">>> bin(n)\n" +"'-0b100101'\n" +">>> n.bit_length()\n" +"6" + +#: ../../builtins/stdtypes.rst:469 msgid "" "More precisely, if ``x`` is nonzero, then ``x.bit_length()`` is the unique " "positive integer ``k`` such that ``2**(k-1) <= abs(x) < 2**k``. " "Equivalently, when ``abs(x)`` is small enough to have a correctly rounded " -"logarithm, then ``k = 1 + int(log(abs(x), 2))``. If ``x`` is zero, then ``x." -"bit_length()`` returns ``0``." +"logarithm, then ``k = 1 + int(log(abs(x), 2))``. If ``x`` is zero, then " +"``x.bit_length()`` returns ``0``." msgstr "" "Mais precisamente, se ``x`` for diferente de zero, então ``x.bit_length()`` " "é o único positivo inteiro ``k`` tal que ``2**(k-1) <= abs(x) < 2**k``. " @@ -949,12 +952,24 @@ msgstr "" "logaritmo corretamente arrendondado, então ``k = 1 + int(log(abs(x), 2))``. " "Se ``x`` é zero, então ``x.bit_length()`` retorna ``0``." -#: ../../library/stdtypes.rst:475 ../../library/stdtypes.rst:498 -#: ../../library/stdtypes.rst:543 ../../library/stdtypes.rst:587 +#: ../../builtins/stdtypes.rst:475 ../../builtins/stdtypes.rst:498 +#: ../../builtins/stdtypes.rst:543 ../../builtins/stdtypes.rst:587 msgid "Equivalent to::" msgstr "Equivalente a::" -#: ../../library/stdtypes.rst:486 +#: ../../builtins/stdtypes.rst:477 +msgid "" +"def bit_length(self):\n" +" s = bin(self) # binary representation: bin(-37) --> '-0b100101'\n" +" s = s.lstrip('-0b') # remove leading zeros and minus sign\n" +" return len(s) # len('100101') --> 6" +msgstr "" +"def bit_length(self):\n" +" s = bin(self) # representação binária: bin(-37) --> '-0b100101'\n" +" s = s.lstrip('-0b') # remove zeros no início e sinal negativo\n" +" return len(s) # len('100101') --> 6" + +#: ../../builtins/stdtypes.rst:486 msgid "" "Return the number of ones in the binary representation of the absolute value " "of the integer. This is also known as the population count. Example::" @@ -962,21 +977,47 @@ msgstr "" "Retorna o número de unidades na representação binária do valor absoluto do " "inteiro. Isso também é conhecido como contagem da população. Exemplo::" -#: ../../library/stdtypes.rst:507 +#: ../../builtins/stdtypes.rst:490 +msgid "" +">>> n = 19\n" +">>> bin(n)\n" +"'0b10011'\n" +">>> n.bit_count()\n" +"3\n" +">>> (-n).bit_count()\n" +"3" +msgstr "" +">>> n = 19\n" +">>> bin(n)\n" +"'0b10011'\n" +">>> n.bit_count()\n" +"3\n" +">>> (-n).bit_count()\n" +"3" + +#: ../../builtins/stdtypes.rst:500 +msgid "" +"def bit_count(self):\n" +" return bin(self).count(\"1\")" +msgstr "" +"def bit_count(self):\n" +" return bin(self).count(\"1\")" + +#: ../../builtins/stdtypes.rst:507 msgid "Return an array of bytes representing an integer." msgstr "Retorna um vetor de bytes representando um inteiro." -#: ../../library/stdtypes.rst:519 +#: ../../builtins/stdtypes.rst:519 msgid "" -"The integer is represented using *length* bytes, and defaults to 1. An :exc:" -"`OverflowError` is raised if the integer is not representable with the given " -"number of bytes." +"The integer is represented using *length* bytes, and defaults to 1. " +"An :exc:`OverflowError` is raised if the integer is not representable with " +"the given number of bytes." msgstr "" -"O inteiro é representado usando *length* bytes, e o padrão é 1. Uma :exc:" -"`OverflowError` é levantada se um inteiro não é representável com o dado " -"número de bytes." +"O inteiro é representado usando *length* bytes, e o padrão é 1. " +"Uma :exc:`OverflowError` é levantada se um inteiro não é representável com o " +"dado número de bytes." -#: ../../library/stdtypes.rst:523 +#: ../../builtins/stdtypes.rst:523 msgid "" "The *byteorder* argument determines the byte order used to represent the " "integer, and defaults to ``\"big\"``. If *byteorder* is ``\"big\"``, the " @@ -988,7 +1029,7 @@ msgstr "" "mais significativo está no início do vetor de byte. Se *byteorder* é " "``\"little\"``, o byte mais significativo está no final do vetor de byte." -#: ../../library/stdtypes.rst:529 +#: ../../builtins/stdtypes.rst:529 msgid "" "The *signed* argument determines whether two's complement is used to " "represent the integer. If *signed* is ``False`` and a negative integer is " @@ -1000,7 +1041,7 @@ msgstr "" "dado, uma :exc:`OverflowError` é levantada. O valor padrão para *signed* é " "``False``." -#: ../../library/stdtypes.rst:534 +#: ../../builtins/stdtypes.rst:534 msgid "" "The default values can be used to conveniently turn an integer into a single " "byte object::" @@ -1008,7 +1049,15 @@ msgstr "" "Os valores padrão podem ser usados para transformar convenientemente um " "inteiro em um objeto de byte único::" -#: ../../library/stdtypes.rst:540 +#: ../../builtins/stdtypes.rst:537 +msgid "" +">>> (65).to_bytes()\n" +"b'A'" +msgstr "" +">>> (65).to_bytes()\n" +"b'A'" + +#: ../../builtins/stdtypes.rst:540 msgid "" "However, when using the default arguments, don't try to convert a value " "greater than 255 or you'll get an :exc:`OverflowError`." @@ -1016,40 +1065,62 @@ msgstr "" "No entanto, ao usar os argumentos padrão, não tente converter um valor maior " "que 255 ou você obterá um :exc:`OverflowError`." -#: ../../library/stdtypes.rst:556 +#: ../../builtins/stdtypes.rst:545 +msgid "" +"def to_bytes(n, length=1, byteorder='big', signed=False):\n" +" if byteorder == 'little':\n" +" order = range(length)\n" +" elif byteorder == 'big':\n" +" order = reversed(range(length))\n" +" else:\n" +" raise ValueError(\"byteorder must be either 'little' or 'big'\")\n" +"\n" +" return bytes((n >> i*8) & 0xff for i in order)" +msgstr "" +"def to_bytes(n, length=1, byteorder='big', signed=False):\n" +" if byteorder == 'little':\n" +" order = range(length)\n" +" elif byteorder == 'big':\n" +" order = reversed(range(length))\n" +" else:\n" +" raise ValueError(\"byteorder must be either 'little' or 'big'\")\n" +"\n" +" return bytes((n >> i*8) & 0xff for i in order)" + +#: ../../builtins/stdtypes.rst:556 msgid "Added default argument values for ``length`` and ``byteorder``." msgstr "" "Adicionados valores de argumento padrão para ``length`` e ``byteorder``." -#: ../../library/stdtypes.rst:561 +#: ../../builtins/stdtypes.rst:561 msgid "Return the integer represented by the given array of bytes." msgstr "Retorna o inteiro representado pelo vetor de bytes dado." -#: ../../library/stdtypes.rst:574 +#: ../../builtins/stdtypes.rst:574 msgid "" "The argument *bytes* must either be a :term:`bytes-like object` or an " "iterable producing bytes." msgstr "" -"O argumento *bytes* precisa ou ser um :term:`objeto byte ou similar ` ou um iterador produzindo bytes." -#: ../../library/stdtypes.rst:577 +#: ../../builtins/stdtypes.rst:577 msgid "" "The *byteorder* argument determines the byte order used to represent the " "integer, and defaults to ``\"big\"``. If *byteorder* is ``\"big\"``, the " "most significant byte is at the beginning of the byte array. If *byteorder* " "is ``\"little\"``, the most significant byte is at the end of the byte " -"array. To request the native byte order of the host system, use :data:`sys." -"byteorder` as the byte order value." +"array. To request the native byte order of the host system, " +"use :data:`sys.byteorder` as the byte order value." msgstr "" "O argumento *byteorder* determina a ordem de bytes usada para representar um " "inteiro, e o padrão é ``\"big\"``. Se o *byteorder* é ``\"big\"``, o byte " "mais significativo está no início do vetor de byte. Se *byteorder* é " "``\"little\"``, o byte mais significativo está no final do vetor de byte. " -"Para requisitar a ordem nativa de byte do sistema hospedeiro, use :data:`sys." -"byteorder` como o valor da ordem de byte." +"Para requisitar a ordem nativa de byte do sistema hospedeiro, " +"use :data:`sys.byteorder` como o valor da ordem de byte." -#: ../../library/stdtypes.rst:584 +#: ../../builtins/stdtypes.rst:584 msgid "" "The *signed* argument indicates whether two's complement is used to " "represent the integer." @@ -1057,11 +1128,41 @@ msgstr "" "O argumento *signed* indica quando o complemento de dois é usado para " "representar o inteiro." -#: ../../library/stdtypes.rst:604 +#: ../../builtins/stdtypes.rst:589 +msgid "" +"def from_bytes(bytes, byteorder='big', signed=False):\n" +" if byteorder == 'little':\n" +" little_ordered = list(bytes)\n" +" elif byteorder == 'big':\n" +" little_ordered = list(reversed(bytes))\n" +" else:\n" +" raise ValueError(\"byteorder must be either 'little' or 'big'\")\n" +"\n" +" n = sum(b << i*8 for i, b in enumerate(little_ordered))\n" +" if signed and little_ordered and (little_ordered[-1] & 0x80):\n" +" n -= 1 << 8*len(little_ordered)\n" +"\n" +" return n" +msgstr "" +"def from_bytes(bytes, byteorder='big', signed=False):\n" +" if byteorder == 'little':\n" +" little_ordered = list(bytes)\n" +" elif byteorder == 'big':\n" +" little_ordered = list(reversed(bytes))\n" +" else:\n" +" raise ValueError(\"byteorder must be either 'little' or 'big'\")\n" +"\n" +" n = sum(b << i*8 for i, b in enumerate(little_ordered))\n" +" if signed and little_ordered and (little_ordered[-1] & 0x80):\n" +" n -= 1 << 8*len(little_ordered)\n" +"\n" +" return n" + +#: ../../builtins/stdtypes.rst:604 msgid "Added default argument value for ``byteorder``." -msgstr "Adicionados valor de argumento padrão para ``byteorder``." +msgstr "Adicionado valor de argumento padrão para ``byteorder``." -#: ../../library/stdtypes.rst:609 +#: ../../builtins/stdtypes.rst:609 msgid "" "Return a pair of integers whose ratio is equal to the original integer and " "has a positive denominator. The integer ratio of integers (whole numbers) " @@ -1072,38 +1173,39 @@ msgstr "" "inteiros (números inteiros) é sempre o número inteiro como numerador e ``1`` " "como denominador." -#: ../../library/stdtypes.rst:618 +#: ../../builtins/stdtypes.rst:618 msgid "" -"Returns ``True``. Exists for duck type compatibility with :meth:`float." -"is_integer`." +"Returns ``True``. Exists for duck type compatibility " +"with :meth:`float.is_integer`." msgstr "" -"Retorna ``True``. Existe para compatibilidade com tipo pato com :meth:`float." -"is_integer`." +"Retorna ``True``. Existe para compatibilidade com tipo pato " +"com :meth:`float.is_integer`." -#: ../../library/stdtypes.rst:623 +#: ../../builtins/stdtypes.rst:623 msgid "Additional Methods on Float" msgstr "Métodos adicionais em ponto flutuante" -#: ../../library/stdtypes.rst:625 +#: ../../builtins/stdtypes.rst:625 msgid "" "The float type implements the :class:`numbers.Real` :term:`abstract base " "class`. float also has the following additional methods." msgstr "" -"O tipo float implementa a :term:`classe base abstrata` :class:`numbers." -"Real`. float também possui os seguintes métodos adicionais." +"O tipo float implementa a :term:`classe base " +"abstrata` :class:`numbers.Real`. float também possui os seguintes métodos " +"adicionais." -#: ../../library/stdtypes.rst:630 +#: ../../builtins/stdtypes.rst:630 msgid "" "Return a pair of integers whose ratio is exactly equal to the original " -"float. The ratio is in lowest terms and has a positive denominator. Raises :" -"exc:`OverflowError` on infinities and a :exc:`ValueError` on NaNs." +"float. The ratio is in lowest terms and has a positive denominator. " +"Raises :exc:`OverflowError` on infinities and a :exc:`ValueError` on NaNs." msgstr "" "Retorna um par de inteiros dos quais a proporção é exatamente igual ao float " "original. A proporção está em seus termos mais baixos e tem um denominador " -"positivo. Levanta um :exc:`OverflowError` em infinidades e um :exc:" -"`ValueError` em NaNs." +"positivo. Levanta um :exc:`OverflowError` em infinidades e " +"um :exc:`ValueError` em NaNs." -#: ../../library/stdtypes.rst:637 +#: ../../builtins/stdtypes.rst:637 msgid "" "Return ``True`` if the float instance is finite with integral value, and " "``False`` otherwise::" @@ -1111,7 +1213,19 @@ msgstr "" "Retorna ``True`` se a instância do float for finita com o valor integral e " "``False``, caso contrário::" -#: ../../library/stdtypes.rst:645 +#: ../../builtins/stdtypes.rst:640 +msgid "" +">>> (-2.0).is_integer()\n" +"True\n" +">>> (3.2).is_integer()\n" +"False" +msgstr "" +">>> (-2.0).is_integer()\n" +"True\n" +">>> (3.2).is_integer()\n" +"False" + +#: ../../builtins/stdtypes.rst:645 msgid "" "Two methods support conversion to and from hexadecimal strings. Since " "Python's floats are stored internally as binary numbers, converting a float " @@ -1128,7 +1242,7 @@ msgstr "" "números de ponto flutuante. Isso pode ser útil na depuração e no trabalho " "numérico." -#: ../../library/stdtypes.rst:656 +#: ../../builtins/stdtypes.rst:656 msgid "" "Return a representation of a floating-point number as a hexadecimal string. " "For finite floating-point numbers, this representation will always include a " @@ -1138,7 +1252,7 @@ msgstr "" "hexadecimal. Para números de ponto flutuante finitos, essa representação vai " "sempre incluir um ``0x`` inicial e um ``p`` final e expoente." -#: ../../library/stdtypes.rst:664 +#: ../../builtins/stdtypes.rst:664 msgid "" "Class method to return the float represented by a hexadecimal string *s*. " "The string *s* may have leading and trailing whitespace." @@ -1147,21 +1261,25 @@ msgstr "" "string hexadecimal *s*. A string *s* pode ter espaços em branco iniciais e " "finais." -#: ../../library/stdtypes.rst:669 +#: ../../builtins/stdtypes.rst:669 msgid "" -"Note that :meth:`float.hex` is an instance method, while :meth:`float." -"fromhex` is a class method." +"Note that :meth:`float.hex` is an instance method, " +"while :meth:`float.fromhex` is a class method." msgstr "" -"Note que :meth:`float.hex` é um método de instância, enquanto :meth:`float." -"fromhex` é um método de classe." +"Note que :meth:`float.hex` é um método de instância, " +"enquanto :meth:`float.fromhex` é um método de classe." -#: ../../library/stdtypes.rst:672 +#: ../../builtins/stdtypes.rst:672 msgid "A hexadecimal string takes the form::" msgstr "Uma string hexadecimal toma a forma::" -#: ../../library/stdtypes.rst:676 +#: ../../builtins/stdtypes.rst:674 +msgid "[sign] ['0x'] integer ['.' fraction] ['p' exponent]" +msgstr "[sign] ['0x'] integer ['.' fraction] ['p' exponent]" + +#: ../../builtins/stdtypes.rst:676 msgid "" -"where the optional ``sign`` may by either ``+`` or ``-``, ``integer`` and " +"where the optional ``sign`` may be either ``+`` or ``-``, ``integer`` and " "``fraction`` are strings of hexadecimal digits, and ``exponent`` is a " "decimal integer with an optional leading sign. Case is not significant, and " "there must be at least one hexadecimal digit in either the integer or the " @@ -1183,7 +1301,7 @@ msgstr "" "produzidas pelo formato do caractere ``%a`` do C ou ``Double.toHexString`` " "do Java são aceitos pelo :meth:`float.fromhex`." -#: ../../library/stdtypes.rst:689 +#: ../../builtins/stdtypes.rst:689 msgid "" "Note that the exponent is written in decimal rather than hexadecimal, and " "that it gives the power of 2 by which to multiply the coefficient. For " @@ -1195,7 +1313,15 @@ msgstr "" "string hexadecimal ``0x3.a7p10`` representa o número de ponto flutuante ``(3 " "+ 10./16 + 7./16**2) * 2.0**10`` ou ``3740.0``::" -#: ../../library/stdtypes.rst:699 +#: ../../builtins/stdtypes.rst:695 +msgid "" +">>> float.fromhex('0x3.a7p10')\n" +"3740.0" +msgstr "" +">>> float.fromhex('0x3.a7p10')\n" +"3740.0" + +#: ../../builtins/stdtypes.rst:699 msgid "" "Applying the reverse conversion to ``3740.0`` gives a different hexadecimal " "string representing the same number::" @@ -1203,24 +1329,33 @@ msgstr "" "Aplicando a conversão inversa a ``3740.0`` retorna uma string hexadecimal " "diferente representada pelo mesmo número::" -#: ../../library/stdtypes.rst:709 +#: ../../builtins/stdtypes.rst:702 +msgid "" +">>> float.hex(3740.0)\n" +"'0x1.d380000000000p+11'" +msgstr "" +">>> float.hex(3740.0)\n" +"'0x1.d380000000000p+11'" + +#: ../../builtins/stdtypes.rst:709 msgid "Hashing of numeric types" msgstr "Hashing de tipos numéricos" -#: ../../library/stdtypes.rst:711 +#: ../../builtins/stdtypes.rst:711 msgid "" "For numbers ``x`` and ``y``, possibly of different types, it's a requirement " -"that ``hash(x) == hash(y)`` whenever ``x == y`` (see the :meth:`~object." -"__hash__` method documentation for more details). For ease of " -"implementation and efficiency across a variety of numeric types (including :" -"class:`int`, :class:`float`, :class:`decimal.Decimal` and :class:`fractions." -"Fraction`) Python's hash for numeric types is based on a single mathematical " -"function that's defined for any rational number, and hence applies to all " -"instances of :class:`int` and :class:`fractions.Fraction`, and all finite " -"instances of :class:`float` and :class:`decimal.Decimal`. Essentially, this " -"function is given by reduction modulo ``P`` for a fixed prime ``P``. The " -"value of ``P`` is made available to Python as the :attr:`~sys.hash_info." -"modulus` attribute of :data:`sys.hash_info`." +"that ``hash(x) == hash(y)`` whenever ``x == y`` (see " +"the :meth:`~object.__hash__` method documentation for more details). For " +"ease of implementation and efficiency across a variety of numeric types " +"(including :class:`int`, :class:`float`, :class:`decimal.Decimal` " +"and :class:`fractions.Fraction`) Python's hash for numeric types is based on " +"a single mathematical function that's defined for any rational number, and " +"hence applies to all instances of :class:`int` " +"and :class:`fractions.Fraction`, and all finite instances of :class:`float` " +"and :class:`decimal.Decimal`. Essentially, this function is given by " +"reduction modulo ``P`` for a fixed prime ``P``. The value of ``P`` is made " +"available to Python as the :attr:`~sys.hash_info.modulus` attribute " +"of :data:`sys.hash_info`." msgstr "" "Para números ``x`` e ``y``, possivelmente de diferentes tipos, é um " "requisito que ``hash(x) == hash(y)`` sempre que ``x == y`` (veja a " @@ -1229,14 +1364,14 @@ msgstr "" "numéricos (incluindo :class:`int`, :class:`float`, :class:`decimal.Decimal` " "e :class:`fractions.Fraction`), o hash do Python para tipos numéricos é " "baseado em uma única função matemática que é definida para qualquer número " -"racional e, portanto, se aplica para todas as instâncias de :class:`int` e :" -"class:`fractions.Fraction`, e todas as instâncias finitas das classes :class:" -"`float` e :class:`decimal.Decimal`. Essencialmente, essa função é dada pelo " -"módulo de redução ``P`` para um primo fixado ``P``. O valor de ``P`` é " -"disponibilizado ao Python como um atributo :attr:`~sys.hash_info.modulus` " -"do :data:`sys.hash_info`." +"racional e, portanto, se aplica para todas as instâncias de :class:`int` " +"e :class:`fractions.Fraction`, e todas as instâncias finitas das " +"classes :class:`float` e :class:`decimal.Decimal`. Essencialmente, essa " +"função é dada pelo módulo de redução ``P`` para um primo fixado ``P``. O " +"valor de ``P`` é disponibilizado ao Python como um " +"atributo :attr:`~sys.hash_info.modulus` do :data:`sys.hash_info`." -#: ../../library/stdtypes.rst:726 +#: ../../builtins/stdtypes.rst:726 msgid "" "Currently, the prime used is ``P = 2**31 - 1`` on machines with 32-bit C " "longs and ``P = 2**61 - 1`` on machines with 64-bit C longs." @@ -1244,11 +1379,11 @@ msgstr "" "Atualmente, o primo usado é ``P = 2**31 - 1`` em máquinas com longos de 32 " "bits do C e ``P = 2**61 - 1`` em máquinas com longos de 64 bits do C." -#: ../../library/stdtypes.rst:729 +#: ../../builtins/stdtypes.rst:729 msgid "Here are the rules in detail:" msgstr "Aqui estão as regras em detalhe:" -#: ../../library/stdtypes.rst:731 +#: ../../builtins/stdtypes.rst:731 msgid "" "If ``x = m / n`` is a nonnegative rational number and ``n`` is not divisible " "by ``P``, define ``hash(x)`` as ``m * invmod(n, P) % P``, where ``invmod(n, " @@ -1258,7 +1393,7 @@ msgstr "" "por ``P``, define ``hash(x)`` como ``m * invmod(n, P) % P``, onde " "``invmod(n, P)`` retorna o inverso do módulo de ``n`` com ``P``." -#: ../../library/stdtypes.rst:735 +#: ../../builtins/stdtypes.rst:735 msgid "" "If ``x = m / n`` is a nonnegative rational number and ``n`` is divisible by " "``P`` (but ``m`` is not) then ``n`` has no inverse modulo ``P`` and the rule " @@ -1270,7 +1405,7 @@ msgstr "" "regra acima não se aplica; nesse caso defina ``hash(x)`` para ser o valor " "constante ``sys.hash_info.inf``." -#: ../../library/stdtypes.rst:740 +#: ../../builtins/stdtypes.rst:740 msgid "" "If ``x = m / n`` is a negative rational number define ``hash(x)`` as ``-" "hash(-x)``. If the resulting hash is ``-1``, replace it with ``-2``." @@ -1278,7 +1413,7 @@ msgstr "" "Se ``x = m / n`` é um número racional negativo, defina ``hash(x)`` como ``-" "hash(-x)``. Se a hash resultante é ``-1``, a substituo com ``-2``." -#: ../../library/stdtypes.rst:744 +#: ../../builtins/stdtypes.rst:744 msgid "" "The particular values ``sys.hash_info.inf`` and ``-sys.hash_info.inf`` are " "used as hash values for positive infinity or negative infinity " @@ -1288,13 +1423,14 @@ msgstr "" "usados como valores de hash para infinidade positiva ou infinidade negativa " "(respectivamente)." -#: ../../library/stdtypes.rst:748 +#: ../../builtins/stdtypes.rst:748 msgid "" "For a :class:`complex` number ``z``, the hash values of the real and " -"imaginary parts are combined by computing ``hash(z.real) + sys.hash_info." -"imag * hash(z.imag)``, reduced modulo ``2**sys.hash_info.width`` so that it " -"lies in ``range(-2**(sys.hash_info.width - 1), 2**(sys.hash_info.width - " -"1))``. Again, if the result is ``-1``, it's replaced with ``-2``." +"imaginary parts are combined by computing ``hash(z.real) + " +"sys.hash_info.imag * hash(z.imag)``, reduced modulo " +"``2**sys.hash_info.width`` so that it lies in " +"``range(-2**(sys.hash_info.width - 1), 2**(sys.hash_info.width - 1))``. " +"Again, if the result is ``-1``, it's replaced with ``-2``." msgstr "" "Para número :class:`complex` ``z``, o valor da hash do número real partes " "imaginárias são combinados calculando ``hash(z.real) + sys.hash_info.imag * " @@ -1302,21 +1438,121 @@ msgstr "" "permaneça em ``range(-2**(sys.hash_info.width - 1), 2**(sys.hash_info.width " "- 1))``. Novamente, se o resultado é ``-1``, ele é substituído por ``-2``." -#: ../../library/stdtypes.rst:756 +#: ../../builtins/stdtypes.rst:756 msgid "" "To clarify the above rules, here's some example Python code, equivalent to " -"the built-in hash, for computing the hash of a rational number, :class:" -"`float`, or :class:`complex`::" +"the built-in hash, for computing the hash of a rational " +"number, :class:`float`, or :class:`complex`::" msgstr "" "Para esclarecer as regras acima, aqui estão alguns exemplos de código em " "Python, equivalentes ao hash embutido, para calcular o hash de números " "racionais, :class:`float` ou :class:`complex`::" -#: ../../library/stdtypes.rst:812 +#: ../../builtins/stdtypes.rst:761 +msgid "" +"import sys, math\n" +"\n" +"def hash_fraction(m, n):\n" +" \"\"\"Compute the hash of a rational number m / n.\n" +"\n" +" Assumes m and n are integers, with n positive.\n" +" Equivalent to hash(fractions.Fraction(m, n)).\n" +"\n" +" \"\"\"\n" +" P = sys.hash_info.modulus\n" +" # Remove common factors of P. (Unnecessary if m and n already " +"coprime.)\n" +" while m % P == n % P == 0:\n" +" m, n = m // P, n // P\n" +"\n" +" if n % P == 0:\n" +" hash_value = sys.hash_info.inf\n" +" else:\n" +" # Fermat's Little Theorem: pow(n, P-1, P) is 1, so\n" +" # pow(n, P-2, P) gives the inverse of n modulo P.\n" +" hash_value = (abs(m) % P) * pow(n, P - 2, P) % P\n" +" if m < 0:\n" +" hash_value = -hash_value\n" +" if hash_value == -1:\n" +" hash_value = -2\n" +" return hash_value\n" +"\n" +"def hash_float(x):\n" +" \"\"\"Compute the hash of a float x.\"\"\"\n" +"\n" +" if math.isnan(x):\n" +" return object.__hash__(x)\n" +" elif math.isinf(x):\n" +" return sys.hash_info.inf if x > 0 else -sys.hash_info.inf\n" +" else:\n" +" return hash_fraction(*x.as_integer_ratio())\n" +"\n" +"def hash_complex(z):\n" +" \"\"\"Compute the hash of a complex number z.\"\"\"\n" +"\n" +" hash_value = hash_float(z.real) + sys.hash_info.imag * " +"hash_float(z.imag)\n" +" # do a signed reduction modulo 2**sys.hash_info.width\n" +" M = 2**(sys.hash_info.width - 1)\n" +" hash_value = (hash_value & (M - 1)) - (hash_value & M)\n" +" if hash_value == -1:\n" +" hash_value = -2\n" +" return hash_value" +msgstr "" +"import sys, math\n" +"\n" +"def hash_fraction(m, n):\n" +" \"\"\"Calcula o hash de um número racional m / n.\n" +"\n" +" Presume que m e n são inteiros, com n positivo.\n" +" Equivalente a hash(fractions.Fraction(m, n)).\n" +"\n" +" \"\"\"\n" +" P = sys.hash_info.modulus\n" +" # Remove fatores comuns de P. (Desnecessário se m e n são primos entre " +"si.)\n" +" while m % P == n % P == 0:\n" +" m, n = m // P, n // P\n" +"\n" +" if n % P == 0:\n" +" hash_value = sys.hash_info.inf\n" +" else:\n" +" # Pequeno teorema de Fermat: pow(n, P-1, P) é 1, então\n" +" # pow(n, P-2, P) dá o inverso de n módulo P.\n" +" hash_value = (abs(m) % P) * pow(n, P - 2, P) % P\n" +" if m < 0:\n" +" hash_value = -hash_value\n" +" if hash_value == -1:\n" +" hash_value = -2\n" +" return hash_value\n" +"\n" +"def hash_float(x):\n" +" \"\"\"Calcula o hash de um ponto flutuante x.\"\"\"\n" +"\n" +" if math.isnan(x):\n" +" return object.__hash__(x)\n" +" elif math.isinf(x):\n" +" return sys.hash_info.inf if x > 0 else -sys.hash_info.inf\n" +" else:\n" +" return hash_fraction(*x.as_integer_ratio())\n" +"\n" +"def hash_complex(z):\n" +" \"\"\"Calcula o hash de um número complexo z.\"\"\"\n" +"\n" +" hash_value = hash_float(z.real) + sys.hash_info.imag * " +"hash_float(z.imag)\n" +" # faz um módulo para redução de sinal 2**sys.hash_info.width\n" +" M = 2**(sys.hash_info.width - 1)\n" +" hash_value = (hash_value & (M - 1)) - (hash_value & M)\n" +" if hash_value == -1:\n" +" hash_value = -2\n" +" return hash_value" + +#: ../../builtins/stdtypes.rst:812 msgid "Boolean Type - :class:`bool`" msgstr "Tipo booleano - :class:`bool`" -#: ../../library/stdtypes.rst:814 +#: ../../builtins/stdtypes.rst:814 msgid "" "Booleans represent truth values. The :class:`bool` type has exactly two " "constant instances: ``True`` and ``False``." @@ -1324,16 +1560,16 @@ msgstr "" "Booleanos representam valores verdade. O tipo :class:`bool` tem exatamente " "duas instâncias constantes: ``True`` e ``False``." -#: ../../library/stdtypes.rst:822 +#: ../../builtins/stdtypes.rst:822 msgid "" "The built-in function :func:`bool` converts any value to a boolean, if the " "value can be interpreted as a truth value (see section :ref:`truth` above)." msgstr "" "A função embutida :func:`bool` converte qualquer valor em um booleano, se o " -"valor puder ser interpretado como um valor verdade (consultar seção :ref:" -"`truth` acima)." +"valor puder ser interpretado como um valor verdade (consultar " +"seção :ref:`truth` acima)." -#: ../../library/stdtypes.rst:825 +#: ../../builtins/stdtypes.rst:825 msgid "" "For logical operations, use the :ref:`boolean operators ` ``and``, " "``or`` and ``not``. When applying the bitwise operators ``&``, ``|``, ``^`` " @@ -1347,15 +1583,15 @@ msgstr "" "\"ou\", \"xor\". Entretanto, é preferível usar os operadores lógicos " "``and``, ``or`` e ``!=`` em relação aos ``&``, ``|`` e ``^``." -#: ../../library/stdtypes.rst:834 +#: ../../builtins/stdtypes.rst:834 msgid "" "The use of the bitwise inversion operator ``~`` is deprecated and will raise " -"an error in Python 3.14." +"an error in Python 3.16." msgstr "" "O uso do operador de inversão bit a bit ``~`` foi descontinuado e levantará " -"um erro no Python 3.14." +"um erro no Python 3.16." -#: ../../library/stdtypes.rst:837 +#: ../../builtins/stdtypes.rst:837 msgid "" ":class:`bool` is a subclass of :class:`int` (see :ref:`typesnumeric`). In " "many numeric contexts, ``False`` and ``True`` behave like the integers 0 and " @@ -1367,11 +1603,11 @@ msgstr "" "respectivamente. Entretanto, basear-se somente nisso, é desencorajado; ao " "invés disso, a conversão deve ser feita explicitamente usando :func:`int`." -#: ../../library/stdtypes.rst:845 +#: ../../builtins/stdtypes.rst:845 msgid "Iterator Types" msgstr "Tipos iteradores" -#: ../../library/stdtypes.rst:853 +#: ../../builtins/stdtypes.rst:853 msgid "" "Python supports a concept of iteration over containers. This is implemented " "using two distinct methods; these are used to allow user-defined classes to " @@ -1383,24 +1619,24 @@ msgstr "" "definidas pelo usuário suportem iteração. Sequências, descritas abaixo em " "mais detalhes, sempre suportam os métodos de iteração." -#: ../../library/stdtypes.rst:858 +#: ../../builtins/stdtypes.rst:858 msgid "" -"One method needs to be defined for container objects to provide :term:" -"`iterable` support:" +"One method needs to be defined for container objects to " +"provide :term:`iterable` support:" msgstr "" "Um método necessita ser definido para objetos contêineres afim destes " "proverem suporte a :term:`iterável`:" -#: ../../library/stdtypes.rst:865 +#: ../../builtins/stdtypes.rst:865 msgid "" "Return an :term:`iterator` object. The object is required to support the " "iterator protocol described below. If a container supports different types " "of iteration, additional methods can be provided to specifically request " "iterators for those iteration types. (An example of an object supporting " "multiple forms of iteration would be a tree structure which supports both " -"breadth-first and depth-first traversal.) This method corresponds to the :c:" -"member:`~PyTypeObject.tp_iter` slot of the type structure for Python objects " -"in the Python/C API." +"breadth-first and depth-first traversal.) This method corresponds to " +"the :c:member:`~PyTypeObject.tp_iter` slot of the type structure for Python " +"objects in the Python/C API." msgstr "" "Retorna um objeto :term:`iterador`. O objeto deve suportar o protocolo " "iterador descrito abaixo. Se um contêiner suporta diferentes tipos de " @@ -1408,10 +1644,11 @@ msgstr "" "especificamente iteradores para aqueles tipos de iterações. (Um exemplo de " "um objeto suportando múltiplas formas de iteração seria uma estrutura em " "árvore a qual suporta ambas travessias de travessia em largura e em " -"profundidade.) Esse método corresponde ao slot :c:member:`~PyTypeObject." -"tp_iter` da estrutura de tipos para objetos Python na API Python/C." +"profundidade.) Esse método corresponde ao " +"slot :c:member:`~PyTypeObject.tp_iter` da estrutura de tipos para objetos " +"Python na API Python/C." -#: ../../library/stdtypes.rst:874 +#: ../../builtins/stdtypes.rst:874 msgid "" "The iterator objects themselves are required to support the following two " "methods, which together form the :dfn:`iterator protocol`:" @@ -1419,20 +1656,21 @@ msgstr "" "Os próprios objetos iteradores são obrigados a suportarem os dois métodos a " "seguir, que juntos formam o :dfn:`protocolo iterador`:" -#: ../../library/stdtypes.rst:880 +#: ../../builtins/stdtypes.rst:880 msgid "" "Return the :term:`iterator` object itself. This is required to allow both " -"containers and iterators to be used with the :keyword:`for` and :keyword:" -"`in` statements. This method corresponds to the :c:member:`~PyTypeObject." -"tp_iter` slot of the type structure for Python objects in the Python/C API." +"containers and iterators to be used with the :keyword:`for` " +"and :keyword:`in` statements. This method corresponds to " +"the :c:member:`~PyTypeObject.tp_iter` slot of the type structure for Python " +"objects in the Python/C API." msgstr "" "Retorna o próprio objeto :term:`iterador` em si. Isso é necessário para " "permitir que ambos os contêineres e iteradores sejam usados com as " -"instruções :keyword:`for` e :keyword:`in`. Este método corresponde ao slot :" -"c:member:`~PyTypeObject.tp_iter` da estrutura de tipos para objetos Python " -"na API Python/C." +"instruções :keyword:`for` e :keyword:`in`. Este método corresponde ao " +"slot :c:member:`~PyTypeObject.tp_iter` da estrutura de tipos para objetos " +"Python na API Python/C." -#: ../../library/stdtypes.rst:889 +#: ../../builtins/stdtypes.rst:889 msgid "" "Return the next item from the :term:`iterator`. If there are no further " "items, raise the :exc:`StopIteration` exception. This method corresponds to " @@ -1440,11 +1678,11 @@ msgid "" "Python objects in the Python/C API." msgstr "" "Retorna o próximo item do :term:`iterador`. Se não houver itens além, a " -"exceção :exc:`StopIteration` é levantada. Esse método corresponde ao slot :c:" -"member:`~PyTypeObject.tp_iternext` da estrutura de tipos para objetos Python " -"na API Python/C." +"exceção :exc:`StopIteration` é levantada. Esse método corresponde ao " +"slot :c:member:`~PyTypeObject.tp_iternext` da estrutura de tipos para " +"objetos Python na API Python/C." -#: ../../library/stdtypes.rst:894 +#: ../../builtins/stdtypes.rst:894 msgid "" "Python defines several iterator objects to support iteration over general " "and specific sequence types, dictionaries, and other more specialized " @@ -1456,43 +1694,44 @@ msgstr "" "especializadas. Os tipos específicos não são importantes além de sua " "implementação do protocolo iterador." -#: ../../library/stdtypes.rst:899 +#: ../../builtins/stdtypes.rst:899 msgid "" -"Once an iterator's :meth:`~iterator.__next__` method raises :exc:" -"`StopIteration`, it must continue to do so on subsequent calls. " +"Once an iterator's :meth:`~iterator.__next__` method " +"raises :exc:`StopIteration`, it must continue to do so on subsequent calls. " "Implementations that do not obey this property are deemed broken." msgstr "" -"Uma vez que o método :meth:`~iterator.__next__` do iterador levantou :exc:" -"`StopIteration`, ele deve continuar fazendo isso em chamadas subsequentes. " -"Implementações que não obedecem essa propriedade são consideradas quebradas." +"Uma vez que o método :meth:`~iterator.__next__` do iterador " +"levantou :exc:`StopIteration`, ele deve continuar fazendo isso em chamadas " +"subsequentes. Implementações que não obedecem essa propriedade são " +"consideradas quebradas." -#: ../../library/stdtypes.rst:907 +#: ../../builtins/stdtypes.rst:907 msgid "Generator Types" msgstr "Tipos geradores" -#: ../../library/stdtypes.rst:909 +#: ../../builtins/stdtypes.rst:909 msgid "" "Python's :term:`generator`\\s provide a convenient way to implement the " -"iterator protocol. If a container object's :meth:`~iterator.__iter__` " -"method is implemented as a generator, it will automatically return an " -"iterator object (technically, a generator object) supplying the :meth:`!" -"__iter__` and :meth:`~generator.__next__` methods. More information about " -"generators can be found in :ref:`the documentation for the yield expression " -"`." +"iterator protocol. If a container object's :meth:`~object.__iter__` method " +"is implemented as a generator, it will automatically return an iterator " +"object (technically, a generator object) supplying " +"the :meth:`~iterator.__iter__` and :meth:`~generator.__next__` methods. More " +"information about generators can be found in :ref:`the documentation for the " +"yield expression `." msgstr "" "Os :term:`geradores ` do Python proveem uma maneira conveniente " -"para implementar o protocolo iterador. Se o método :meth:`~iterator." -"__iter__` de um objeto contêiner é implementado como um gerador, ele irá " +"para implementar o protocolo iterador. Se o método :meth:`~object.__iter__` " +"de um objeto contêiner é implementado como um gerador, ele irá " "automaticamente retornar um objeto iterador (tecnicamente, um objeto " -"gerador) fornecendo os métodos :meth:`!__iter__` e :meth:`~generator." -"__next__` . Mais informações sobre geradores podem ser encontradas na :ref:" -"`documentação para a expressão yield `." +"gerador) fornecendo os métodos :meth:`~iterator.__iter__` " +"e :meth:`~generator.__next__`. Mais informações sobre geradores podem ser " +"encontradas na :ref:`documentação para a expressão yield `." -#: ../../library/stdtypes.rst:921 +#: ../../builtins/stdtypes.rst:921 msgid "Sequence Types --- :class:`list`, :class:`tuple`, :class:`range`" msgstr "Tipos sequências --- :class:`list`, :class:`tuple`, :class:`range`" -#: ../../library/stdtypes.rst:923 +#: ../../builtins/stdtypes.rst:923 msgid "" "There are three basic sequence types: lists, tuples, and range objects. " "Additional sequence types tailored for processing of :ref:`binary data " @@ -1504,11 +1743,11 @@ msgstr "" "binários ` e :ref:`strings de texto ` são descritos em " "seções dedicadas." -#: ../../library/stdtypes.rst:932 +#: ../../builtins/stdtypes.rst:932 msgid "Common Sequence Operations" msgstr "Operações comuns de sequências" -#: ../../library/stdtypes.rst:936 +#: ../../builtins/stdtypes.rst:936 msgid "" "The operations in the following table are supported by most sequence types, " "both mutable and immutable. The :class:`collections.abc.Sequence` ABC is " @@ -1516,11 +1755,11 @@ msgid "" "sequence types." msgstr "" "As operações nas seguintes tabelas são suportadas pela maioria dos tipos " -"sequências, ambos mutáveis e imutáveis. A classe ABC :class:`collections.abc." -"Sequence` é fornecida para tornar fácil a correta implementação desses " -"operadores em tipos sequências personalizados." +"sequências, ambos mutáveis e imutáveis. A classe " +"ABC :class:`collections.abc.Sequence` é fornecida para tornar fácil a " +"correta implementação desses operadores em tipos sequências personalizados." -#: ../../library/stdtypes.rst:941 +#: ../../builtins/stdtypes.rst:941 msgid "" "This table lists the sequence operations sorted in ascending priority. In " "the table, *s* and *t* are sequences of the same type, *n*, *i*, *j* and *k* " @@ -1532,7 +1771,7 @@ msgstr "" "e *k* são inteiros e *x* é um objeto arbitrário que atende a qualquer " "restrição de valor e tipo imposta por *s*." -#: ../../library/stdtypes.rst:946 +#: ../../builtins/stdtypes.rst:946 msgid "" "The ``in`` and ``not in`` operations have the same priorities as the " "comparison operations. The ``+`` (concatenation) and ``*`` (repetition) " @@ -1543,128 +1782,108 @@ msgstr "" "de comparação. As operações ``+`` (concatenação) e ``*`` (repetição) têm a " "mesma prioridade que as operações numéricas correspondentes. [3]_" -#: ../../library/stdtypes.rst:967 +#: ../../builtins/stdtypes.rst:965 msgid "``x in s``" msgstr "``x in s``" -#: ../../library/stdtypes.rst:967 +#: ../../builtins/stdtypes.rst:965 msgid "``True`` if an item of *s* is equal to *x*, else ``False``" msgstr "" "``True`` caso um item de *s* seja igual a *x*, caso contrário ``False``" -#: ../../library/stdtypes.rst:970 +#: ../../builtins/stdtypes.rst:968 msgid "``x not in s``" msgstr "``x not in s``" -#: ../../library/stdtypes.rst:970 +#: ../../builtins/stdtypes.rst:968 msgid "``False`` if an item of *s* is equal to *x*, else ``True``" msgstr "``False`` caso um item de *s* for igual a *x*, caso contrário ``True``" -#: ../../library/stdtypes.rst:973 +#: ../../builtins/stdtypes.rst:971 msgid "``s + t``" msgstr "``s + t``" -#: ../../library/stdtypes.rst:973 +#: ../../builtins/stdtypes.rst:971 msgid "the concatenation of *s* and *t*" msgstr "a concatenação de *s* e *t*" -#: ../../library/stdtypes.rst:973 +#: ../../builtins/stdtypes.rst:971 msgid "(6)(7)" msgstr "(6)(7)" -#: ../../library/stdtypes.rst:976 +#: ../../builtins/stdtypes.rst:974 msgid "``s * n`` or ``n * s``" msgstr "``s * n`` ou ``n * s``" -#: ../../library/stdtypes.rst:976 +#: ../../builtins/stdtypes.rst:974 msgid "equivalent to adding *s* to itself *n* times" msgstr "equivalente a adicionar *s* a si mesmo *n* vezes" -#: ../../library/stdtypes.rst:976 +#: ../../builtins/stdtypes.rst:974 msgid "(2)(7)" msgstr "(2)(7)" -#: ../../library/stdtypes.rst:979 +#: ../../builtins/stdtypes.rst:977 msgid "``s[i]``" msgstr "``s[i]``" -#: ../../library/stdtypes.rst:979 +#: ../../builtins/stdtypes.rst:977 msgid "*i*\\ th item of *s*, origin 0" msgstr "*i*\\ -ésimo item de *s*, origem 0" -#: ../../library/stdtypes.rst:981 +#: ../../builtins/stdtypes.rst:977 +msgid "(3)(8)" +msgstr "(3)(8)" + +#: ../../builtins/stdtypes.rst:979 msgid "``s[i:j]``" msgstr "``s[i:j]``" -#: ../../library/stdtypes.rst:981 +#: ../../builtins/stdtypes.rst:979 msgid "slice of *s* from *i* to *j*" msgstr "fatia de *s* de *i* até *j*" -#: ../../library/stdtypes.rst:981 +#: ../../builtins/stdtypes.rst:979 msgid "(3)(4)" msgstr "(3)(4)" -#: ../../library/stdtypes.rst:983 +#: ../../builtins/stdtypes.rst:981 msgid "``s[i:j:k]``" msgstr "``s[i:j:k]``" -#: ../../library/stdtypes.rst:983 +#: ../../builtins/stdtypes.rst:981 msgid "slice of *s* from *i* to *j* with step *k*" msgstr "fatia de *s* de *i* até *j* com passo *k*" -#: ../../library/stdtypes.rst:983 +#: ../../builtins/stdtypes.rst:981 msgid "(3)(5)" msgstr "(3)(5)" -#: ../../library/stdtypes.rst:986 +#: ../../builtins/stdtypes.rst:984 msgid "``len(s)``" msgstr "``len(s)``" -#: ../../library/stdtypes.rst:986 +#: ../../builtins/stdtypes.rst:984 msgid "length of *s*" msgstr "comprimento de *s*" -#: ../../library/stdtypes.rst:988 +#: ../../builtins/stdtypes.rst:986 msgid "``min(s)``" msgstr "``min(s)``" -#: ../../library/stdtypes.rst:988 +#: ../../builtins/stdtypes.rst:986 msgid "smallest item of *s*" msgstr "menor item de *s*" -#: ../../library/stdtypes.rst:990 +#: ../../builtins/stdtypes.rst:988 msgid "``max(s)``" msgstr "``max(s)``" -#: ../../library/stdtypes.rst:990 +#: ../../builtins/stdtypes.rst:988 msgid "largest item of *s*" msgstr "maior item de *s*" -#: ../../library/stdtypes.rst:992 -msgid "``s.index(x[, i[, j]])``" -msgstr "``s.index(x[, i[, j]])``" - -#: ../../library/stdtypes.rst:992 -msgid "" -"index of the first occurrence of *x* in *s* (at or after index *i* and " -"before index *j*)" -msgstr "" -"índice da primeira ocorrência de *x* em *s* (no ou após o índice *i*, e " -"antes do índice *j*)" - -#: ../../library/stdtypes.rst:992 ../../library/stdtypes.rst:3659 -msgid "\\(8)" -msgstr "\\(8)" - -#: ../../library/stdtypes.rst:996 -msgid "``s.count(x)``" -msgstr "``s.count(x)``" - -#: ../../library/stdtypes.rst:996 -msgid "total number of occurrences of *x* in *s*" -msgstr "numero total de ocorrência de *x* em *s*" - -#: ../../library/stdtypes.rst:1000 +#: ../../builtins/stdtypes.rst:991 msgid "" "Sequences of the same type also support comparisons. In particular, tuples " "and lists are compared lexicographically by comparing corresponding " @@ -1672,20 +1891,20 @@ msgid "" "and the two sequences must be of the same type and have the same length. " "(For full details see :ref:`comparisons` in the language reference.)" msgstr "" -"Sequências do mesmo tipo também suportam comparações. Em particular, tuplas " -"e listas são comparadas lexicograficamente pela comparação de elementos " -"correspondentes. Isso significa que para comparar igualmente, cada elemento " -"deve comparar igual e as duas sequências devem ser do mesmo tipo e possuírem " -"o mesmo comprimento. (Para detalhes completos, veja :ref:`comparisons` na " -"referência da linguagem.)" +"Sequências do mesmo tipo também admitem comparações. Em particular, tuplas e " +"listas são comparadas lexicograficamente por meio da comparação de elementos " +"correspondentes. Isso significa que, para comparar igualmente, cada elemento " +"deve ser comparado igual e as duas sequências devem ser do mesmo tipo e " +"possuir o mesmo comprimento. (Para detalhes completos, " +"veja :ref:`comparisons` na referência da linguagem.)" -#: ../../library/stdtypes.rst:1010 +#: ../../builtins/stdtypes.rst:1001 msgid "" "Forward and reversed iterators over mutable sequences access values using an " "index. That index will continue to march forward (or backward) even if the " -"underlying sequence is mutated. The iterator terminates only when an :exc:" -"`IndexError` or a :exc:`StopIteration` is encountered (or when the index " -"drops below zero)." +"underlying sequence is mutated. The iterator terminates only when " +"an :exc:`IndexError` or a :exc:`StopIteration` is encountered (or when the " +"index drops below zero)." msgstr "" "Iteradores para frente e reversos sobre sequências mutáveis acessam valores " "usando um índice. Esse índice continuará avançando (ou retrocedendo) mesmo " @@ -1693,7 +1912,7 @@ msgstr "" "um :exc:`IndexError` ou um :exc:`StopIteration` é encontrado (ou quando o " "índice cai abaixo de zero)." -#: ../../library/stdtypes.rst:1019 +#: ../../builtins/stdtypes.rst:1010 msgid "" "While the ``in`` and ``not in`` operations are used only for simple " "containment testing in the general case, some specialised sequences (such " @@ -1705,7 +1924,15 @@ msgstr "" "como :class:`str`, :class:`bytes` e :class:`bytearray`) também usam-nas para " "testes de subsequências::" -#: ../../library/stdtypes.rst:1028 +#: ../../builtins/stdtypes.rst:1015 +msgid "" +">>> \"gg\" in \"eggs\"\n" +"True" +msgstr "" +">>> \"gg\" in \"eggs\"\n" +"True" + +#: ../../builtins/stdtypes.rst:1019 msgid "" "Values of *n* less than ``0`` are treated as ``0`` (which yields an empty " "sequence of the same type as *s*). Note that items in the sequence *s* are " @@ -1717,7 +1944,23 @@ msgstr "" "*s* não são copiados; eles são referenciados várias vezes. Isso " "frequentemente assombra novos programadores Python; considere então que::" -#: ../../library/stdtypes.rst:1040 +#: ../../builtins/stdtypes.rst:1024 +msgid "" +">>> lists = [[]] * 3\n" +">>> lists\n" +"[[], [], []]\n" +">>> lists[0].append(3)\n" +">>> lists\n" +"[[3], [3], [3]]" +msgstr "" +">>> lists = [[]] * 3\n" +">>> lists\n" +"[[], [], []]\n" +">>> lists[0].append(3)\n" +">>> lists\n" +"[[3], [3], [3]]" + +#: ../../builtins/stdtypes.rst:1031 msgid "" "What has happened is that ``[[]]`` is a one-element list containing an empty " "list, so all three elements of ``[[]] * 3`` are references to this single " @@ -1729,14 +1972,30 @@ msgstr "" "única lista vazia. Modificar qualquer um dos elementos de ``lists`` modifica " "a lista vazia. Podemos criar uma lista de listas diferentes dessa maneira::" -#: ../../library/stdtypes.rst:1052 +#: ../../builtins/stdtypes.rst:1036 +msgid "" +">>> lists = [[] for i in range(3)]\n" +">>> lists[0].append(3)\n" +">>> lists[1].append(5)\n" +">>> lists[2].append(7)\n" +">>> lists\n" +"[[3], [5], [7]]" +msgstr "" +">>> lists = [[] for i in range(3)]\n" +">>> lists[0].append(3)\n" +">>> lists[1].append(5)\n" +">>> lists[2].append(7)\n" +">>> lists\n" +"[[3], [5], [7]]" + +#: ../../builtins/stdtypes.rst:1043 msgid "" "Further explanation is available in the FAQ entry :ref:`faq-multidimensional-" "list`." msgstr "" -"Outra explicação está disponível no FAQ :ref:`faq-multidimensional-list`." +"Mais explicação está disponível no FAQ :ref:`faq-multidimensional-list`." -#: ../../library/stdtypes.rst:1056 +#: ../../builtins/stdtypes.rst:1047 msgid "" "If *i* or *j* is negative, the index is relative to the end of sequence *s*: " "``len(s) + i`` or ``len(s) + j`` is substituted. But note that ``-0`` is " @@ -1746,20 +2005,35 @@ msgstr "" "``len(s) + i`` ou ``len(s) + j`` será substituído. Mas note que ``-0`` ainda " "será ``0``." -#: ../../library/stdtypes.rst:1061 +#: ../../builtins/stdtypes.rst:1052 msgid "" "The slice of *s* from *i* to *j* is defined as the sequence of items with " -"index *k* such that ``i <= k < j``. If *i* or *j* is greater than " -"``len(s)``, use ``len(s)``. If *i* is omitted or ``None``, use ``0``. If " -"*j* is omitted or ``None``, use ``len(s)``. If *i* is greater than or equal " -"to *j*, the slice is empty." +"index *k* such that ``i <= k < j``." msgstr "" -"A fatia *s* de *i* até *j* é definida como a sequência de itens com índice " -"*k* tal que ``i <= k < j``. Se *i* ou *j* foi maior do que ``len(s)``, usa " -"``len(s)``. Se *i* for omitido ou ``None``, use ``0``. Se *j* for omitido ou " -"``None``, usa ``len(s)``. Se *i* for maior ou igual a *j*, a fatia é vazia." +"A fatia de *s* de *i* a *j* é definida como a sequência de itens com índice " +"*k* tal que ``i <= k < j``." + +#: ../../builtins/stdtypes.rst:1055 +msgid "If *i* is omitted or ``None``, use ``0``." +msgstr "Se *i* for omitido ou ``None``, usa ``0``." -#: ../../library/stdtypes.rst:1068 +#: ../../builtins/stdtypes.rst:1056 +msgid "If *j* is omitted or ``None``, use ``len(s)``." +msgstr "Se *j* for omitido ou ``None``, usa ``len(s)``." + +#: ../../builtins/stdtypes.rst:1057 +msgid "If *i* or *j* is less than ``-len(s)``, use ``0``." +msgstr "Se *i* ou *j* for menor que ``-len(s)``, usa ``0``." + +#: ../../builtins/stdtypes.rst:1058 +msgid "If *i* or *j* is greater than ``len(s)``, use ``len(s)``." +msgstr "Se *i* ou *j* for maior que ``len(s)``, usa ``len(s)``." + +#: ../../builtins/stdtypes.rst:1059 +msgid "If *i* is greater than or equal to *j*, the slice is empty." +msgstr "Se *i* for maior ou igual a *j*, a fatia está vazia." + +#: ../../builtins/stdtypes.rst:1062 msgid "" "The slice of *s* from *i* to *j* with step *k* is defined as the sequence of " "items with index ``x = i + n*k`` such that ``0 <= n < (j-i)/k``. In other " @@ -1781,7 +2055,7 @@ msgstr "" "valores \"finais\" (cujo final depende de *k*). Nota: *k* não pode ser zero. " "Se *k* for ``None``, o mesmo será tratado como sendo igual a ``1``." -#: ../../library/stdtypes.rst:1079 +#: ../../builtins/stdtypes.rst:1073 msgid "" "Concatenating immutable sequences always results in a new object. This " "means that building up a sequence by repeated concatenation will have a " @@ -1794,90 +2068,119 @@ msgstr "" "Para obter um custo de tempo de execução linear, devemos alternar para uma " "das alternativas abaixo:" -#: ../../library/stdtypes.rst:1084 +#: ../../builtins/stdtypes.rst:1078 msgid "" -"if concatenating :class:`str` objects, you can build a list and use :meth:" -"`str.join` at the end or else write to an :class:`io.StringIO` instance and " -"retrieve its value when complete" +"if concatenating :class:`str` objects, you can build a list and " +"use :meth:`str.join` at the end or else write to an :class:`io.StringIO` " +"instance and retrieve its value when complete" msgstr "" "Se estiver concatenando objetos :class:`str`, você pode criar uma lista e " -"usar :meth:`str.join` no final ou então escrever numa instância de :class:" -"`io.StringIO` e recuperar o seu valor ao final" +"usar :meth:`str.join` no final ou então escrever numa instância " +"de :class:`io.StringIO` e recuperar o seu valor ao final" -#: ../../library/stdtypes.rst:1088 +#: ../../builtins/stdtypes.rst:1082 msgid "" -"if concatenating :class:`bytes` objects, you can similarly use :meth:`bytes." -"join` or :class:`io.BytesIO`, or you can do in-place concatenation with a :" -"class:`bytearray` object. :class:`bytearray` objects are mutable and have " -"an efficient overallocation mechanism" +"if concatenating :class:`bytes` objects, you can similarly " +"use :meth:`bytes.join` or :class:`io.BytesIO`, or you can do in-place " +"concatenation with a :class:`bytearray` object. :class:`bytearray` objects " +"are mutable and have an efficient overallocation mechanism" msgstr "" "Se estiver concatenando objetos :class:`bytes`, você também pode usar o " "método :meth:`bytes.join` ou :class:`io.BytesIO`, ou você pode fazer " -"concatenação interna com um objeto :class:`bytearray`. A classe :class:" -"`bytearray` são objetos mutáveis e possuem um eficiente mecanismo de " -"superalocação" +"concatenação interna com um objeto :class:`bytearray`. A " +"classe :class:`bytearray` são objetos mutáveis e possuem um eficiente " +"mecanismo de superalocação" -#: ../../library/stdtypes.rst:1093 +#: ../../builtins/stdtypes.rst:1087 msgid "if concatenating :class:`tuple` objects, extend a :class:`list` instead" msgstr "" -"Se estiver concatenando objetos :class:`tuple`, estenda a classe :class:" -"`list` em vez disso" +"Se estiver concatenando objetos :class:`tuple`, estenda a " +"classe :class:`list` em vez disso" -#: ../../library/stdtypes.rst:1095 +#: ../../builtins/stdtypes.rst:1089 msgid "for other types, investigate the relevant class documentation" msgstr "para outros tipos, busque na documentação relevante da classe" -#: ../../library/stdtypes.rst:1099 +#: ../../builtins/stdtypes.rst:1093 msgid "" "Some sequence types (such as :class:`range`) only support item sequences " "that follow specific patterns, and hence don't support sequence " "concatenation or repetition." msgstr "" -"Alguns tipos sequências (como :class:`range`) apenas suportam sequências de " -"itens que seguem padrões específicos e, portanto, não suportam concatenação " -"ou repetição de sequência." +"Alguns tipos de sequências (como :class:`range`) apenas aceitam sequências " +"de itens que seguem padrões específicos e, portanto, não implementam " +"concatenação nem repetição de sequências." + +#: ../../builtins/stdtypes.rst:1098 +msgid "An :exc:`IndexError` is raised if *i* is outside the sequence range." +msgstr "" +"Uma :exc:`IndexError` é levantada se *i* estiver fora do intervalo da " +"sequência." + +#: ../../builtins/stdtypes.rst:1101 +msgid "Sequence Methods" +msgstr "Métodos de sequência" + +#: ../../builtins/stdtypes.rst:1102 +msgid "Sequence types also support the following methods:" +msgstr "Tipos de sequência também oferecem suporte aos seguintes métodos:" + +#: ../../builtins/stdtypes.rst:1112 +msgid "Return the total number of occurrences of *value* in *sequence*." +msgstr "Retorna o número total de ocorrências de *value* em *sequence*." + +#: ../../builtins/stdtypes.rst:1122 +msgid "Return the index of the first occurrence of *value* in *sequence*." +msgstr "Retorna o índice da primeira ocorrência de *value* em *sequence*." + +#: ../../builtins/stdtypes.rst:1124 ../../builtins/stdtypes.rst:1308 +msgid "Raises :exc:`ValueError` if *value* is not found in *sequence*." +msgstr "Levanta :exc:`ValueError` se *value* não for encontrado em *sequence*." -#: ../../library/stdtypes.rst:1104 +#: ../../builtins/stdtypes.rst:1126 msgid "" -"``index`` raises :exc:`ValueError` when *x* is not found in *s*. Not all " -"implementations support passing the additional arguments *i* and *j*. These " -"arguments allow efficient searching of subsections of the sequence. Passing " -"the extra arguments is roughly equivalent to using ``s[i:j].index(x)``, only " -"without copying any data and with the returned index being relative to the " -"start of the sequence rather than the start of the slice." +"The *start* or *stop* arguments allow for efficient searching of subsections " +"of the sequence, beginning at *start* and ending at *stop*. This is roughly " +"equivalent to ``start + sequence[start:stop].index(value)``, only without " +"copying any data." msgstr "" -"``index`` levanta :exc:`ValueError` quando *x* não é encontrado em *s*. Nem " -"todas as implementações suportam a passagem dos argumentos adicionais *i* e " -"*j*. Esses argumentos permitem a pesquisa eficiente de subseções da " -"sequência. Passar os argumentos extras é aproximadamente equivalente a usar " -"``s[i:j].index(x)``, apenas sem copiar nenhum dado e com o índice retornado " -"sendo relativo ao início da sequência e não ao início da fatia." +"Os argumentos *start* ou *stop* permitem uma busca eficiente de subseções da " +"sequência, começando em *start* e terminando em *stop*. Isso é " +"aproximadamente equivalente a ``start + sequence[start:stop].index(value)``, " +"só que sem copiar nenhum dado." -#: ../../library/stdtypes.rst:1115 +#: ../../builtins/stdtypes.rst:1132 +msgid "" +"Not all sequence types support passing the *start* and *stop* arguments." +msgstr "" +"Nem todos os tipos de sequência oferecem suporte a passagem dos argumentos " +"*start* e *stop*." + +#: ../../builtins/stdtypes.rst:1138 msgid "Immutable Sequence Types" msgstr "Tipos sequência imutáveis" -#: ../../library/stdtypes.rst:1122 +#: ../../builtins/stdtypes.rst:1145 msgid "" "The only operation that immutable sequence types generally implement that is " -"not also implemented by mutable sequence types is support for the :func:" -"`hash` built-in." +"not also implemented by mutable sequence types is support for " +"the :func:`hash` built-in." msgstr "" "A única operação que os tipos sequências imutáveis geralmente implementam " "que também não é implementada pelos tipos sequências mutáveis é suporte para " "a função embutida :func:`hash`." -#: ../../library/stdtypes.rst:1126 +#: ../../builtins/stdtypes.rst:1149 msgid "" "This support allows immutable sequences, such as :class:`tuple` instances, " -"to be used as :class:`dict` keys and stored in :class:`set` and :class:" -"`frozenset` instances." +"to be used as :class:`dict` keys and stored in :class:`set` " +"and :class:`frozenset` instances." msgstr "" -"Esse suporte permite sequências imutáveis, tais como instâncias da classe :" -"class:`tuple`, serem usadas como chaves de dicionários :class:`dict` e " -"armazenados em instâncias de :class:`set` e de :class:`frozenset`." +"Esse suporte permite sequências imutáveis, tais como instâncias da " +"classe :class:`tuple`, serem usadas como chaves de dicionários :class:`dict` " +"e armazenados em instâncias de :class:`set` e de :class:`frozenset`." -#: ../../library/stdtypes.rst:1130 +#: ../../builtins/stdtypes.rst:1153 msgid "" "Attempting to hash an immutable sequence that contains unhashable values " "will result in :exc:`TypeError`." @@ -1885,11 +2188,11 @@ msgstr "" "A tentativa de obter um hash de uma sequência imutável que contém valores " "desnecessários resultará em um erro :exc:`TypeError`." -#: ../../library/stdtypes.rst:1137 +#: ../../builtins/stdtypes.rst:1160 msgid "Mutable Sequence Types" msgstr "Tipos sequências mutáveis" -#: ../../library/stdtypes.rst:1144 +#: ../../builtins/stdtypes.rst:1167 msgid "" "The operations in the following table are defined on mutable sequence types. " "The :class:`collections.abc.MutableSequence` ABC is provided to make it " @@ -1900,7 +2203,7 @@ msgstr "" "fácil a implementação correta dessas operações em tipos sequências " "personalizados." -#: ../../library/stdtypes.rst:1148 +#: ../../builtins/stdtypes.rst:1171 msgid "" "In the table *s* is an instance of a mutable sequence type, *t* is any " "iterable object and *x* is an arbitrary object that meets any type and value " @@ -1912,195 +2215,184 @@ msgstr "" "restrição de tipo e valor imposto por *s* (por exemplo :class:`bytearray` só " "aceita inteiros que atendam a restrição de valor ``0 <= x <= 255``)." -#: ../../library/stdtypes.rst:1172 +#: ../../builtins/stdtypes.rst:1187 msgid "``s[i] = x``" msgstr "``s[i] = x``" -#: ../../library/stdtypes.rst:1172 +#: ../../builtins/stdtypes.rst:1187 msgid "item *i* of *s* is replaced by *x*" msgstr "item *i* de *s* é substituído por *x*" -#: ../../library/stdtypes.rst:1175 +#: ../../builtins/stdtypes.rst:1190 +msgid "``del s[i]``" +msgstr "``del s[i]``" + +#: ../../builtins/stdtypes.rst:1190 +msgid "removes item *i* of *s*" +msgstr "remove o item *i* de *s*" + +#: ../../builtins/stdtypes.rst:1192 msgid "``s[i:j] = t``" msgstr "``s[i:j] = t``" -#: ../../library/stdtypes.rst:1175 +#: ../../builtins/stdtypes.rst:1192 msgid "" "slice of *s* from *i* to *j* is replaced by the contents of the iterable *t*" msgstr "" "fatias de *s* de *i* até *j* são substituídas pelo conteúdo do iterável *t*" -#: ../../library/stdtypes.rst:1179 +#: ../../builtins/stdtypes.rst:1196 msgid "``del s[i:j]``" msgstr "``del s[i:j]``" -#: ../../library/stdtypes.rst:1179 -msgid "same as ``s[i:j] = []``" -msgstr "o mesmo que ``s[i:j] = []``" +#: ../../builtins/stdtypes.rst:1196 +msgid "" +"removes the elements of ``s[i:j]`` from the list (same as ``s[i:j] = []``)" +msgstr "remove os elementos de ``s[i:j]`` da lista (mesmo que ``s[i:j] = []``)" -#: ../../library/stdtypes.rst:1181 +#: ../../builtins/stdtypes.rst:1200 msgid "``s[i:j:k] = t``" msgstr "``s[i:j:k] = t``" -#: ../../library/stdtypes.rst:1181 +#: ../../builtins/stdtypes.rst:1200 msgid "the elements of ``s[i:j:k]`` are replaced by those of *t*" msgstr "os elementos de ``s[i:j:k]`` são substituídos por aqueles de *t*" -#: ../../library/stdtypes.rst:1184 +#: ../../builtins/stdtypes.rst:1203 msgid "``del s[i:j:k]``" msgstr "``del s[i:j:k]``" -#: ../../library/stdtypes.rst:1184 +#: ../../builtins/stdtypes.rst:1203 msgid "removes the elements of ``s[i:j:k]`` from the list" msgstr "remove os elementos de ``s[i:j:k]`` desde a listas" -#: ../../library/stdtypes.rst:1187 -msgid "``s.append(x)``" -msgstr "``s.append(x)``" - -#: ../../library/stdtypes.rst:1187 -msgid "" -"appends *x* to the end of the sequence (same as ``s[len(s):len(s)] = [x]``)" -msgstr "" -"adiciona *x* no final da sequência (igual a ``s[len(s):len(s)] = [x]``)" - -#: ../../library/stdtypes.rst:1191 -msgid "``s.clear()``" -msgstr "``s.clear()``" - -#: ../../library/stdtypes.rst:1191 -msgid "removes all items from *s* (same as ``del s[:]``)" -msgstr "remove todos os itens de *s* (mesmo que ``del s[:]``)" +#: ../../builtins/stdtypes.rst:1206 +msgid "``s += t``" +msgstr "``s += t``" -#: ../../library/stdtypes.rst:1194 -msgid "``s.copy()``" -msgstr "``s.copy()``" - -#: ../../library/stdtypes.rst:1194 -msgid "creates a shallow copy of *s* (same as ``s[:]``)" -msgstr "cria uma cópia rasa de *s* (mesmo que ``s[:]``)" - -#: ../../library/stdtypes.rst:1197 -msgid "``s.extend(t)`` or ``s += t``" -msgstr "``s.extend(t)`` ou ``s += t``" - -#: ../../library/stdtypes.rst:1197 +#: ../../builtins/stdtypes.rst:1206 msgid "" "extends *s* with the contents of *t* (for the most part the same as " "``s[len(s):len(s)] = t``)" msgstr "" -"estende *s* com o conteúdo de *t* (na maior parte do mesmo ``s[len(s):" -"len(s)] = t``)" +"estende *s* com o conteúdo de *t* (na maior parte do mesmo " +"``s[len(s):len(s)] = t``)" -#: ../../library/stdtypes.rst:1202 +#: ../../builtins/stdtypes.rst:1211 msgid "``s *= n``" msgstr "``s *= n``" -#: ../../library/stdtypes.rst:1202 +#: ../../builtins/stdtypes.rst:1211 msgid "updates *s* with its contents repeated *n* times" msgstr "atualiza *s* com o seu conteúdo por *n* vezes" -#: ../../library/stdtypes.rst:1205 -msgid "``s.insert(i, x)``" -msgstr "``s.insert(i, x)``" - -#: ../../library/stdtypes.rst:1205 +#: ../../builtins/stdtypes.rst:1218 msgid "" -"inserts *x* into *s* at the index given by *i* (same as ``s[i:i] = [x]``)" +"If *k* is not equal to ``1``, *t* must have the same length as the slice it " +"is replacing." msgstr "" -"insere *x* dentro de *s* no índice dado por *i* (igual a ``s[i:i] = [x]``)" - -#: ../../library/stdtypes.rst:1209 -msgid "``s.pop()`` or ``s.pop(i)``" -msgstr "``s.pop()`` ou ``s.pop(i)``" +"se *k* não for igual a ``1``, *t* deve ter o mesmo comprimento que a fatia a " +"qual ele está substituindo." -#: ../../library/stdtypes.rst:1209 -msgid "retrieves the item at *i* and also removes it from *s*" -msgstr "retorna o item em *i* e também remove-o de *s*" +#: ../../builtins/stdtypes.rst:1221 +msgid "" +"The value *n* is an integer, or an object " +"implementing :meth:`~object.__index__`. Zero and negative values of *n* " +"clear the sequence. Items in the sequence are not copied; they are " +"referenced multiple times, as explained for ``s * n`` under :ref:`typesseq-" +"common`." +msgstr "" +"O valor *n* é um inteiro, ou um objeto " +"implementando :meth:`~object.__index__`. Valores zero e negativos de *n* " +"limparão a sequência. Os itens na sequência não são copiados; eles são " +"referenciados várias vezes, como explicado para ``s * n`` em :ref:`typesseq-" +"common`." -#: ../../library/stdtypes.rst:1212 -msgid "``s.remove(x)``" -msgstr "``s.remove(x)``" +#: ../../builtins/stdtypes.rst:1227 +msgid "Mutable Sequence Methods" +msgstr "Métodos de sequências mutáveis" -#: ../../library/stdtypes.rst:1212 -msgid "removes the first item from *s* where ``s[i]`` is equal to *x*" -msgstr "remove o primeiro item de *s* onde ``s[i]`` é igual a *x*" +#: ../../builtins/stdtypes.rst:1228 +msgid "Mutable sequence types also support the following methods:" +msgstr "" +"Tipos de sequências mutáveis também oferecem suporte aos seguintes métodos:" -#: ../../library/stdtypes.rst:1216 -msgid "``s.reverse()``" -msgstr "``s.reverse()``" +#: ../../builtins/stdtypes.rst:1237 +msgid "" +"Append *value* to the end of the sequence. This is equivalent to writing " +"``seq[len(seq):len(seq)] = [value]``." +msgstr "" +"Adiciona *value* ao final da sequência. Isso equivale a escrever " +"``seq[len(seq):len(seq)] = [value]``." -#: ../../library/stdtypes.rst:1216 -msgid "reverses the items of *s* in place" -msgstr "inverte os itens de *s* in-place" +#: ../../builtins/stdtypes.rst:1249 +msgid "" +"Remove all items from *sequence*. This is equivalent to writing ``del " +"sequence[:]``." +msgstr "" +"Remove todos os itens de *sequence*. Isso equivale a escrever ``del " +"sequence[:]``." -#: ../../library/stdtypes.rst:1224 +#: ../../builtins/stdtypes.rst:1261 msgid "" -"If *k* is not equal to ``1``, *t* must have the same length as the slice it " -"is replacing." +"Create a shallow copy of *sequence*. This is equivalent to writing " +"``sequence[:]``." msgstr "" -"se *k* não for igual a ``1``, *t* deve ter o mesmo comprimento que a fatia a " -"qual ele está substituindo." +"Cria uma cópia rasa de *sequence*. Isso equivale a escrever ``sequence[:]``." -#: ../../library/stdtypes.rst:1227 +#: ../../builtins/stdtypes.rst:1264 msgid "" -"The optional argument *i* defaults to ``-1``, so that by default the last " -"item is removed and returned." +"The :meth:`!copy` method is not part of " +"the :class:`~collections.abc.MutableSequence` :class:`~abc.ABC`, but most " +"concrete mutable sequence types provide it." msgstr "" -"O argumento opcional *i* tem como padrão ``-1``, de modo que, por padrão, o " -"último item é removido e retornado." +"O método :meth:`!copy` não faz parte " +"de :class:`~collections.abc.MutableSequence` :class:`~abc.ABC`, mas a " +"maioria dos tipos de sequências mutáveis concretas o fornecem." -#: ../../library/stdtypes.rst:1231 -msgid ":meth:`remove` raises :exc:`ValueError` when *x* is not found in *s*." +#: ../../builtins/stdtypes.rst:1275 +msgid "" +"Extend *sequence* with the contents of *iterable*. For the most part, this " +"is the same as writing ``seq[len(seq):len(seq)] = iterable``." msgstr "" -":meth:`remove` levanta :exc:`ValueError` quando *x* não é encontrado em *s*." +"Estende *sequence* com o conteúdo de *iterable*. Em geral, isso equivale a " +"escrever ``seq[len(seq):len(seq)] = iterable``." -#: ../../library/stdtypes.rst:1234 +#: ../../builtins/stdtypes.rst:1286 msgid "" -"The :meth:`reverse` method modifies the sequence in place for economy of " -"space when reversing a large sequence. To remind users that it operates by " -"side effect, it does not return the reversed sequence." +"Insert *value* into *sequence* at the given *index*. This is equivalent to " +"writing ``sequence[index:index] = [value]``." msgstr "" -"O método :meth:`reverse` modifica a sequência no lugar para economizar " -"espaço ao reverter uma grande sequência. Para lembrar os usuários que isso " -"ocorre como sendo um efeito colateral, o mesmo não retorna a sequência " -"invertida." +"Insire *value* em *sequence* no *index* fornecido. Isso equivale a escrever " +"``sequence[index:index] = [value]``." -#: ../../library/stdtypes.rst:1239 +#: ../../builtins/stdtypes.rst:1296 msgid "" -":meth:`clear` and :meth:`!copy` are included for consistency with the " -"interfaces of mutable containers that don't support slicing operations (such " -"as :class:`dict` and :class:`set`). :meth:`!copy` is not part of the :class:" -"`collections.abc.MutableSequence` ABC, but most concrete mutable sequence " -"classes provide it." +"Retrieve the item at *index* and also remove it from *sequence*. By default, " +"the last item in *sequence* is removed and returned." msgstr "" -":meth:`clear` e :meth:`!copy` estão incluídos para consistência com as " -"interfaces de contêineres mutáveis que não suportam operações de fatiamento " -"(como :class:`dict` e :class:`set`). :meth:`!copy` não faz parte da ABC de :" -"class:`collections.abc.MutableSequence`, mas a maioria das classes concretas " -"de sequências mutáveis fornece isso." +"Recupera o item em *index* e também o remove de *sequence*. Por padrão, o " +"último item em *sequence* é removido e retornado." -#: ../../library/stdtypes.rst:1245 -msgid ":meth:`clear` and :meth:`!copy` methods." -msgstr "Métodos :meth:`clear` e :meth:`!copy`." +#: ../../builtins/stdtypes.rst:1306 +msgid "Remove the first item from *sequence* where ``sequence[i] == value``." +msgstr "Remove o primeiro item de *sequence* onde ``sequence[i] == value``." -#: ../../library/stdtypes.rst:1249 +#: ../../builtins/stdtypes.rst:1317 msgid "" -"The value *n* is an integer, or an object implementing :meth:`~object." -"__index__`. Zero and negative values of *n* clear the sequence. Items in " -"the sequence are not copied; they are referenced multiple times, as " -"explained for ``s * n`` under :ref:`typesseq-common`." +"Reverse the items of *sequence* in place. This method maintains economy of " +"space when reversing a large sequence. To remind users that it operates by " +"side-effect, it returns ``None``." msgstr "" -"O valor *n* é um inteiro, ou um objeto implementando :meth:`~object." -"__index__`. Valores zero e negativos de *n* limparão a sequência. Os itens " -"na sequência não são copiados; eles são referenciados várias vezes, como " -"explicado para ``s * n`` em :ref:`typesseq-common`." +"Inverte os itens da *sequence* no lugar. Este método mantém a economia de " +"espaço ao inverter uma sequência grande. Para lembrar aos usuários que ele " +"opera por efeito colateral, ele retorna ``None``." -#: ../../library/stdtypes.rst:1258 +#: ../../builtins/stdtypes.rst:1325 msgid "Lists" msgstr "Listas" -#: ../../library/stdtypes.rst:1262 +#: ../../builtins/stdtypes.rst:1329 msgid "" "Lists are mutable sequences, typically used to store collections of " "homogeneous items (where the precise degree of similarity will vary by " @@ -2110,28 +2402,28 @@ msgstr "" "coleções de itens homogêneos (onde o grau preciso de similaridade variará de " "acordo com a aplicação)." -#: ../../library/stdtypes.rst:1268 +#: ../../builtins/stdtypes.rst:1335 msgid "Lists may be constructed in several ways:" msgstr "As listas podem ser construídas de várias maneiras:" -#: ../../library/stdtypes.rst:1270 +#: ../../builtins/stdtypes.rst:1337 msgid "Using a pair of square brackets to denote the empty list: ``[]``" msgstr "Usando um par de colchetes para denotar uma lista vazia: ``[]``" -#: ../../library/stdtypes.rst:1271 +#: ../../builtins/stdtypes.rst:1338 msgid "" "Using square brackets, separating items with commas: ``[a]``, ``[a, b, c]``" msgstr "Usando colchetes, separando itens por vírgulas: ``[a]``, ``[a, b, c]``" -#: ../../library/stdtypes.rst:1272 +#: ../../builtins/stdtypes.rst:1339 msgid "Using a list comprehension: ``[x for x in iterable]``" msgstr "Usando uma compreensão de lista: ``[x for x in iterable]``" -#: ../../library/stdtypes.rst:1273 +#: ../../builtins/stdtypes.rst:1340 msgid "Using the type constructor: ``list()`` or ``list(iterable)``" msgstr "Usando o construtor de tipo: ``list()`` ou ``list(iterable)``" -#: ../../library/stdtypes.rst:1275 +#: ../../builtins/stdtypes.rst:1342 msgid "" "The constructor builds a list whose items are the same and in the same order " "as *iterable*'s items. *iterable* may be either a sequence, a container " @@ -2149,15 +2441,20 @@ msgstr "" "``[1, 2, 3]``. Se nenhum argumento for dado, o construtor criará uma nova " "lista vazia ``[]``." -#: ../../library/stdtypes.rst:1284 +#: ../../builtins/stdtypes.rst:1351 msgid "" "Many other operations also produce lists, including the :func:`sorted` built-" "in." msgstr "" -"Muitas outras operações também produzem listas, incluindo a função embutida :" -"func:`sorted`." +"Muitas outras operações também produzem listas, incluindo a função " +"embutida :func:`sorted`." -#: ../../library/stdtypes.rst:1287 +#: ../../builtins/stdtypes.rst:1354 +msgid "Lists are :ref:`generic ` over the types of their items." +msgstr "" +"Listas são :ref:`genéricas ` em relação aos tipos dos seus itens." + +#: ../../builtins/stdtypes.rst:1356 msgid "" "Lists implement all of the :ref:`common ` and :ref:`mutable " "` sequence operations. Lists also provide the following " @@ -2167,7 +2464,7 @@ msgstr "" "common>` e :ref:`mutáveis `. As listas também fornecem o " "seguinte método adicional:" -#: ../../library/stdtypes.rst:1293 +#: ../../builtins/stdtypes.rst:1362 msgid "" "This method sorts the list in place, using only ``<`` comparisons between " "items. Exceptions are not suppressed - if any comparison operations fail, " @@ -2179,15 +2476,15 @@ msgstr "" "comparação falhar, toda a operação de ordenação falhará (e a lista " "provavelmente será deixada em um estado parcialmente modificado)." -#: ../../library/stdtypes.rst:1298 +#: ../../builtins/stdtypes.rst:1367 msgid "" -":meth:`sort` accepts two arguments that can only be passed by keyword (:ref:" -"`keyword-only arguments `):" +":meth:`sort` accepts two arguments that can only be passed by keyword " +"(:ref:`keyword-only arguments `):" msgstr "" -":meth:`sort` aceita 2 argumentos que só podem ser passados como :ref:" -"`argumentos somente-nomeados `:" +":meth:`sort` aceita 2 argumentos que só podem ser passados " +"como :ref:`argumentos somente-nomeados `:" -#: ../../library/stdtypes.rst:1301 +#: ../../builtins/stdtypes.rst:1370 msgid "" "*key* specifies a function of one argument that is used to extract a " "comparison key from each list element (for example, ``key=str.lower``). The " @@ -2196,13 +2493,13 @@ msgid "" "list items are sorted directly without calculating a separate key value." msgstr "" "*key* especifica uma função de um argumento que é usado para extrair uma " -"chave de comparação de cada elemento da lista (por exemplo, ``key=str." -"lower``). A chave correspondente a cada item na lista é calculada uma vez e " -"depois usada para todo o processo de classificação. O valor padrão ``None`` " -"significa que os itens da lista são classificados diretamente sem calcular " -"um valor de chave separado." +"chave de comparação de cada elemento da lista (por exemplo, " +"``key=str.lower``). A chave correspondente a cada item na lista é calculada " +"uma vez e depois usada para todo o processo de classificação. O valor padrão " +"``None`` significa que os itens da lista são classificados diretamente sem " +"calcular um valor de chave separado." -#: ../../library/stdtypes.rst:1308 +#: ../../builtins/stdtypes.rst:1377 msgid "" "The :func:`functools.cmp_to_key` utility is available to convert a 2.x style " "*cmp* function to a *key* function." @@ -2210,7 +2507,7 @@ msgstr "" "A função utilitária :func:`functools.cmp_to_key` está disponível para " "converter a função *cmp* no estilo 2.x para uma função *key*." -#: ../../library/stdtypes.rst:1311 +#: ../../builtins/stdtypes.rst:1380 msgid "" "*reverse* is a boolean value. If set to ``True``, then the list elements " "are sorted as if each comparison were reversed." @@ -2219,7 +2516,7 @@ msgstr "" "elementos da lista são classificados como se cada comparação estivesse " "invertida." -#: ../../library/stdtypes.rst:1314 +#: ../../builtins/stdtypes.rst:1383 msgid "" "This method modifies the sequence in place for economy of space when sorting " "a large sequence. To remind users that it operates by side effect, it does " @@ -2232,7 +2529,7 @@ msgstr "" "função :func:`sorted` para solicitar explicitamente uma nova instância da " "lista ordenada)." -#: ../../library/stdtypes.rst:1319 +#: ../../builtins/stdtypes.rst:1388 msgid "" "The :meth:`sort` method is guaranteed to be stable. A sort is stable if it " "guarantees not to change the relative order of elements that compare equal " @@ -2244,14 +2541,14 @@ msgstr "" "comparam igual -- isso é útil para classificar em várias passagens (por " "exemplo, classificar por departamento, depois por nota salarial)." -#: ../../library/stdtypes.rst:1324 +#: ../../builtins/stdtypes.rst:1393 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -"Para exemplos de classificação e um breve tutorial de classificação, veja :" -"ref:`sortinghowto`." +"Para exemplos de classificação e um breve tutorial de classificação, " +"veja :ref:`sortinghowto`." -#: ../../library/stdtypes.rst:1328 +#: ../../builtins/stdtypes.rst:1397 msgid "" "While a list is being sorted, the effect of attempting to mutate, or even " "inspect, the list is undefined. The C implementation of Python makes the " @@ -2264,17 +2561,17 @@ msgstr "" "exceção :exc:`ValueError` se puder detectar que a lista foi alterada durante " "uma ordenação." -#: ../../library/stdtypes.rst:1337 +#: ../../builtins/stdtypes.rst:1406 msgid "Tuples" msgstr "Tuplas" -#: ../../library/stdtypes.rst:1341 +#: ../../builtins/stdtypes.rst:1410 msgid "" "Tuples are immutable sequences, typically used to store collections of " "heterogeneous data (such as the 2-tuples produced by the :func:`enumerate` " "built-in). Tuples are also used for cases where an immutable sequence of " -"homogeneous data is needed (such as allowing storage in a :class:`set` or :" -"class:`dict` instance)." +"homogeneous data is needed (such as allowing storage in a :class:`set` " +"or :class:`dict` instance)." msgstr "" "Tuplas são sequências imutáveis, tipicamente usadas para armazenar coleções " "de dados heterogêneos (como as tuplas de 2 elementos produzidas pelo função " @@ -2282,29 +2579,29 @@ msgstr "" "necessária uma sequência imutável de dados homogêneos (como permitir o " "armazenamento em uma instância :class:`set` ou :class:`dict`)." -#: ../../library/stdtypes.rst:1349 +#: ../../builtins/stdtypes.rst:1418 msgid "Tuples may be constructed in a number of ways:" msgstr "As tuplas podem ser construídas de várias maneiras:" -#: ../../library/stdtypes.rst:1351 +#: ../../builtins/stdtypes.rst:1420 msgid "Using a pair of parentheses to denote the empty tuple: ``()``" msgstr "Usando um par de parênteses para denotar a tupla vazia: ``()``" -#: ../../library/stdtypes.rst:1352 +#: ../../builtins/stdtypes.rst:1421 msgid "Using a trailing comma for a singleton tuple: ``a,`` or ``(a,)``" msgstr "" "Usando uma vírgula à direita para uma tupla singleton: ``a,`` ou ``(a,)``" -#: ../../library/stdtypes.rst:1353 +#: ../../builtins/stdtypes.rst:1422 msgid "Separating items with commas: ``a, b, c`` or ``(a, b, c)``" msgstr "Separando os itens com vírgulas: ``a, b, c`` ou ``(a, b, c)``" -#: ../../library/stdtypes.rst:1354 +#: ../../builtins/stdtypes.rst:1423 msgid "Using the :func:`tuple` built-in: ``tuple()`` or ``tuple(iterable)``" msgstr "" "Usando a função embutida :func:`tuple`: ``tuple()`` ou ``tuple(iterable)``" -#: ../../library/stdtypes.rst:1356 +#: ../../builtins/stdtypes.rst:1425 msgid "" "The constructor builds a tuple whose items are the same and in the same " "order as *iterable*'s items. *iterable* may be either a sequence, a " @@ -2321,7 +2618,7 @@ msgstr "" "'b', 'c')`` e ``tuple( [1, 2, 3] )`` retorna ``(1, 2, 3)``. Se nenhum " "argumento for dado, o construtor criará uma tupla vazia, ``()``." -#: ../../library/stdtypes.rst:1364 +#: ../../builtins/stdtypes.rst:1433 msgid "" "Note that it is actually the comma which makes a tuple, not the parentheses. " "The parentheses are optional, except in the empty tuple case, or when they " @@ -2335,7 +2632,7 @@ msgstr "" "é uma chamada da função com três argumentos, enquanto que ``f((a, b, c))`` é " "uma chamada de função com uma tupla de 3 elementos com um único argumento." -#: ../../library/stdtypes.rst:1370 +#: ../../builtins/stdtypes.rst:1439 msgid "" "Tuples implement all of the :ref:`common ` sequence " "operations." @@ -2343,7 +2640,17 @@ msgstr "" "As tuplas implementam todas as operações :ref:`comuns ` de " "sequência." -#: ../../library/stdtypes.rst:1373 +#: ../../builtins/stdtypes.rst:1442 +msgid "" +"Tuples are :ref:`generic ` over the types of their contents. For " +"more information, refer to :ref:`the typing documentation on annotating " +"tuples `." +msgstr "" +"Tuplas são :ref:`genéricas ` em relação aos tipos de seu conteúdo. " +"Para mais informações, consulte :ref:`a documentação de tipagem sobre a " +"anotação de tuplas `." + +#: ../../builtins/stdtypes.rst:1446 msgid "" "For heterogeneous collections of data where access by name is clearer than " "access by index, :func:`collections.namedtuple` may be a more appropriate " @@ -2353,34 +2660,35 @@ msgstr "" "que o acesso pelo índice, :func:`collections.namedtuple` pode ser uma " "escolha mais apropriada do que um objeto tupla simples." -#: ../../library/stdtypes.rst:1381 +#: ../../builtins/stdtypes.rst:1454 msgid "Ranges" msgstr "Intervalos" -#: ../../library/stdtypes.rst:1385 +#: ../../builtins/stdtypes.rst:1458 msgid "" "The :class:`range` type represents an immutable sequence of numbers and is " "commonly used for looping a specific number of times in :keyword:`for` loops." msgstr "" "O tipo :class:`range` representa uma sequência imutável de números e é " -"comumente usado para percorrer um número determinado de vezes em um laço :" -"keyword:`for`." +"comumente usado para percorrer um número determinado de vezes em um " +"laço :keyword:`for`." -#: ../../library/stdtypes.rst:1392 +#: ../../builtins/stdtypes.rst:1465 msgid "" -"The arguments to the range constructor must be integers (either built-in :" -"class:`int` or any object that implements the :meth:`~object.__index__` " +"The arguments to the range constructor must be integers (either built-" +"in :class:`int` or any object that implements the :meth:`~object.__index__` " "special method). If the *step* argument is omitted, it defaults to ``1``. " "If the *start* argument is omitted, it defaults to ``0``. If *step* is " "zero, :exc:`ValueError` is raised." msgstr "" -"Os argumentos para o construtor de intervalo devem ser inteiros (:class:" -"`int` embutido ou qualquer objeto que implemente o método especial :meth:" -"`~object.__index__`). Se o argumento *step* for omitido, será usado o padrão " -"``1``. Se o argumento *start* for omitido, será usado o padrão ``0``. Se " -"*step* for zero, uma exceção :exc:`ValueError` será levantada." +"Os argumentos para o construtor de intervalo devem ser inteiros " +"(:class:`int` embutido ou qualquer objeto que implemente o método " +"especial :meth:`~object.__index__`). Se o argumento *step* for omitido, será " +"usado o padrão ``1``. Se o argumento *start* for omitido, será usado o " +"padrão ``0``. Se *step* for zero, uma exceção :exc:`ValueError` será " +"levantada." -#: ../../library/stdtypes.rst:1398 +#: ../../builtins/stdtypes.rst:1471 msgid "" "For a positive *step*, the contents of a range ``r`` are determined by the " "formula ``r[i] = start + step*i`` where ``i >= 0`` and ``r[i] < stop``." @@ -2388,7 +2696,7 @@ msgstr "" "Para um *step* positivo, o conteúdo de um intervalo ``r`` será determinado " "pela fórmula ``r[i] = start + step*i`` onde ``i >= 0`` e ``r[i] < stop``." -#: ../../library/stdtypes.rst:1402 +#: ../../builtins/stdtypes.rst:1475 msgid "" "For a negative *step*, the contents of the range are still determined by the " "formula ``r[i] = start + step*i``, but the constraints are ``i >= 0`` and " @@ -2398,7 +2706,7 @@ msgstr "" "fórmula ``r[i] = start + step*i``, mas as restrições serão ``i >= 0`` e " "``r[i] > stop``." -#: ../../library/stdtypes.rst:1406 +#: ../../builtins/stdtypes.rst:1479 msgid "" "A range object will be empty if ``r[0]`` does not meet the value constraint. " "Ranges do support negative indices, but these are interpreted as indexing " @@ -2409,21 +2717,53 @@ msgstr "" "como indexadores partindo do final da sequência determinada pelos índices " "positivos." -#: ../../library/stdtypes.rst:1411 +#: ../../builtins/stdtypes.rst:1484 msgid "" "Ranges containing absolute values larger than :data:`sys.maxsize` are " -"permitted but some features (such as :func:`len`) may raise :exc:" -"`OverflowError`." +"permitted but some features (such as :func:`len`) may " +"raise :exc:`OverflowError`." msgstr "" "Intervalos contendo valores absolutos maiores que :data:`sys.maxsize` são " -"permitidos, mas alguns recursos (como :func:`len`) podem levantar :exc:" -"`OverflowError`." +"permitidos, mas alguns recursos (como :func:`len`) podem " +"levantar :exc:`OverflowError`." -#: ../../library/stdtypes.rst:1415 +#: ../../builtins/stdtypes.rst:1488 msgid "Range examples::" msgstr "Exemplos de intervalos::" -#: ../../library/stdtypes.rst:1432 +#: ../../builtins/stdtypes.rst:1490 +msgid "" +">>> list(range(10))\n" +"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n" +">>> list(range(1, 11))\n" +"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n" +">>> list(range(0, 30, 5))\n" +"[0, 5, 10, 15, 20, 25]\n" +">>> list(range(0, 10, 3))\n" +"[0, 3, 6, 9]\n" +">>> list(range(0, -10, -1))\n" +"[0, -1, -2, -3, -4, -5, -6, -7, -8, -9]\n" +">>> list(range(0))\n" +"[]\n" +">>> list(range(1, 0))\n" +"[]" +msgstr "" +">>> list(range(10))\n" +"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n" +">>> list(range(1, 11))\n" +"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n" +">>> list(range(0, 30, 5))\n" +"[0, 5, 10, 15, 20, 25]\n" +">>> list(range(0, 10, 3))\n" +"[0, 3, 6, 9]\n" +">>> list(range(0, -10, -1))\n" +"[0, -1, -2, -3, -4, -5, -6, -7, -8, -9]\n" +">>> list(range(0))\n" +"[]\n" +">>> list(range(1, 0))\n" +"[]" + +#: ../../builtins/stdtypes.rst:1505 msgid "" "Ranges implement all of the :ref:`common ` sequence " "operations except concatenation and repetition (due to the fact that range " @@ -2435,28 +2775,28 @@ msgstr "" "objetos intervalos só podem representar sequências que seguem um padrão " "rígido. e a repetição e a concatenação geralmente vão violar esse padrão)." -#: ../../library/stdtypes.rst:1439 +#: ../../builtins/stdtypes.rst:1512 msgid "" "The value of the *start* parameter (or ``0`` if the parameter was not " "supplied)" msgstr "" "O valor do parâmetro *start* (ou ``0`` se o parâmetro não for fornecido)" -#: ../../library/stdtypes.rst:1444 +#: ../../builtins/stdtypes.rst:1517 msgid "The value of the *stop* parameter" msgstr "O valor do parâmetro *stop*" -#: ../../library/stdtypes.rst:1448 +#: ../../builtins/stdtypes.rst:1521 msgid "" "The value of the *step* parameter (or ``1`` if the parameter was not " "supplied)" msgstr "" "O valor do parâmetro *step* (ou ``1`` se o parâmetro não for fornecido)" -#: ../../library/stdtypes.rst:1451 +#: ../../builtins/stdtypes.rst:1524 msgid "" -"The advantage of the :class:`range` type over a regular :class:`list` or :" -"class:`tuple` is that a :class:`range` object will always take the same " +"The advantage of the :class:`range` type over a regular :class:`list` " +"or :class:`tuple` is that a :class:`range` object will always take the same " "(small) amount of memory, no matter the size of the range it represents (as " "it only stores the ``start``, ``stop`` and ``step`` values, calculating " "individual items and subranges as needed)." @@ -2467,7 +2807,7 @@ msgstr "" "representando (como ele apenas armazena os valores ``start``, ``stop`` e " "``step``, calculando itens individuais e subintervalos conforme necessário)." -#: ../../library/stdtypes.rst:1457 +#: ../../builtins/stdtypes.rst:1530 msgid "" "Range objects implement the :class:`collections.abc.Sequence` ABC, and " "provide features such as containment tests, element index lookup, slicing " @@ -2477,7 +2817,7 @@ msgstr "" "fornecem recursos como testes de contenção, pesquisa de índice de elemento, " "fatiamento e suporte a índices negativos (veja :ref:`typesseq`):" -#: ../../library/stdtypes.rst:1477 +#: ../../builtins/stdtypes.rst:1550 msgid "" "Testing range objects for equality with ``==`` and ``!=`` compares them as " "sequences. That is, two range objects are considered equal if they " @@ -2489,21 +2829,22 @@ msgstr "" "Testar objetos intervalos por igualdade com ``==`` e ``!=`` os compara como " "sequências. Ou seja, dois objetos intervalos são considerados iguais se " "representarem a mesma sequência de valores. (Observe que dois objetos " -"intervalos considerados iguais podem ter diferentes atributos :attr:`~range." -"start`, :attr:`~range.stop` e :attr:`~range.step`, por exemplo ``range(0) == " -"range(2, 1, 3)`` ou ``range(0, 3, 2) == range(0, 4, 2)``.)" +"intervalos considerados iguais podem ter diferentes " +"atributos :attr:`~range.start`, :attr:`~range.stop` e :attr:`~range.step`, " +"por exemplo ``range(0) == range(2, 1, 3)`` ou ``range(0, 3, 2) == range(0, " +"4, 2)``.)" -#: ../../library/stdtypes.rst:1484 +#: ../../builtins/stdtypes.rst:1557 msgid "" -"Implement the Sequence ABC. Support slicing and negative indices. Test :" -"class:`int` objects for membership in constant time instead of iterating " -"through all items." +"Implement the Sequence ABC. Support slicing and negative indices. " +"Test :class:`int` objects for membership in constant time instead of " +"iterating through all items." msgstr "" "Implementa a ABC Sequence. Suporte a fatiamento e a índices negativos. Testa " "objetos :class:`int` para associação em tempo constante em vez de iterar " "através de todos os itens." -#: ../../library/stdtypes.rst:1490 +#: ../../builtins/stdtypes.rst:1563 msgid "" "Define '==' and '!=' to compare range objects based on the sequence of " "values they define (instead of comparing based on object identity)." @@ -2512,15 +2853,15 @@ msgstr "" "valores que eles definem (em vez de comparar com base na identidade do " "objeto)." -#: ../../library/stdtypes.rst:1495 +#: ../../builtins/stdtypes.rst:1568 msgid "" "Added the :attr:`~range.start`, :attr:`~range.stop` and :attr:`~range.step` " "attributes." msgstr "" -"Adicionados os atributos :attr:`~range.start`, :attr:`~range.stop` e :attr:" -"`~range.step`." +"Adicionados os atributos :attr:`~range.start`, :attr:`~range.stop` " +"e :attr:`~range.step`." -#: ../../library/stdtypes.rst:1500 +#: ../../builtins/stdtypes.rst:1573 msgid "" "The `linspace recipe `_ shows how to implement a lazy version of range " @@ -2530,29 +2871,30 @@ msgstr "" "spaced-numbers-linspace/>`_ mostra como implementar uma versão preguiçosa de " "um intervalo adequado para aplicações de ponto flutuante." -#: ../../library/stdtypes.rst:1512 +#: ../../builtins/stdtypes.rst:1585 msgid "Text Sequence Type --- :class:`str`" msgstr "Tipo sequência de texto --- :class:`str`" -#: ../../library/stdtypes.rst:1514 +#: ../../builtins/stdtypes.rst:1587 msgid "" -"Textual data in Python is handled with :class:`str` objects, or :dfn:" -"`strings`. Strings are immutable :ref:`sequences ` of Unicode code " -"points. String literals are written in a variety of ways:" +"Textual data in Python is handled with :class:`str` objects, " +"or :dfn:`strings`. Strings are immutable :ref:`sequences ` of " +"Unicode code points. String literals are written in a variety of ways:" msgstr "" -"Os dados textuais em Python são tratados com objetos :class:`str`, ou :dfn:" -"`strings`. Strings são :ref:`sequências ` imutáveis de pontos de " -"código Unicode. As strings literais são escritas de diversas maneiras:" +"Os dados textuais em Python são tratados com objetos :class:`str`, " +"ou :dfn:`strings`. Strings são :ref:`sequências ` imutáveis de " +"pontos de código Unicode. As strings literais são escritas de diversas " +"maneiras:" -#: ../../library/stdtypes.rst:1519 +#: ../../builtins/stdtypes.rst:1592 msgid "Single quotes: ``'allows embedded \"double\" quotes'``" msgstr "Aspas simples: ``'permitem aspas \"duplas\" internas'``" -#: ../../library/stdtypes.rst:1520 +#: ../../builtins/stdtypes.rst:1593 msgid "Double quotes: ``\"allows embedded 'single' quotes\"``" msgstr "Aspas duplas: ``\"permitem aspas 'simples' internas\"``" -#: ../../library/stdtypes.rst:1521 +#: ../../builtins/stdtypes.rst:1594 msgid "" "Triple quoted: ``'''Three single quotes'''``, ``\"\"\"Three double " "quotes\"\"\"``" @@ -2560,7 +2902,7 @@ msgstr "" "Aspas triplas: ``'''Três aspas simples'''``, ``\"\"\"Três aspas " "duplas\"\"\"``" -#: ../../library/stdtypes.rst:1523 +#: ../../builtins/stdtypes.rst:1596 msgid "" "Triple quoted strings may span multiple lines - all associated whitespace " "will be included in the string literal." @@ -2568,7 +2910,7 @@ msgstr "" "Strings de aspas triplas podem expandir por várias linhas -- todos os " "espaços em branco associados serão incluídos em literal string." -#: ../../library/stdtypes.rst:1526 +#: ../../builtins/stdtypes.rst:1599 msgid "" "String literals that are part of a single expression and have only " "whitespace between them will be implicitly converted to a single string " @@ -2578,7 +2920,7 @@ msgstr "" "espaços em branco entre eles serão implicitamente convertidos em um único " "literal string. Isso é, ``(\"spam \" \"eggs\") == \"spam eggs\"``." -#: ../../library/stdtypes.rst:1530 +#: ../../builtins/stdtypes.rst:1603 msgid "" "See :ref:`strings` for more about the various forms of string literal, " "including supported :ref:`escape sequences `, and the " @@ -2589,7 +2931,7 @@ msgstr "" "sequences>`, e o prefixo ``r`` (\"raw\") que desabilita a maioria dos " "processos de sequência de escape." -#: ../../library/stdtypes.rst:1534 +#: ../../builtins/stdtypes.rst:1607 msgid "" "Strings may also be created from other objects using the :class:`str` " "constructor." @@ -2597,7 +2939,7 @@ msgstr "" "As strings também podem ser criadas a partir de outros objetos usando o " "construtor :class:`str`." -#: ../../library/stdtypes.rst:1537 +#: ../../builtins/stdtypes.rst:1610 msgid "" "Since there is no separate \"character\" type, indexing a string produces " "strings of length 1. That is, for a non-empty string *s*, ``s[0] == s[0:1]``." @@ -2606,17 +2948,17 @@ msgstr "" "string produz strings de comprimento 1. Ou seja, para uma string não vazia " "*s*, ``s[0] == s[0:1]``." -#: ../../library/stdtypes.rst:1543 +#: ../../builtins/stdtypes.rst:1616 msgid "" -"There is also no mutable string type, but :meth:`str.join` or :class:`io." -"StringIO` can be used to efficiently construct strings from multiple " -"fragments." +"There is also no mutable string type, but :meth:`str.join` " +"or :class:`io.StringIO` can be used to efficiently construct strings from " +"multiple fragments." msgstr "" "Também não existe um tipo string mutável, mas o método :meth:`str.join` ou a " "classe :class:`io.StringIO` podem ser usados para construir strings de forma " "eficiente a partir de vários partes distintas." -#: ../../library/stdtypes.rst:1547 +#: ../../builtins/stdtypes.rst:1620 msgid "" "For backwards compatibility with the Python 2 series, the ``u`` prefix is " "once again permitted on string literals. It has no effect on the meaning of " @@ -2627,7 +2969,7 @@ msgstr "" "sobre o significado de literais strings e não pode ser combinado com o " "prefixo ``r``." -#: ../../library/stdtypes.rst:1559 +#: ../../builtins/stdtypes.rst:1634 msgid "" "Return a :ref:`string ` version of *object*. If *object* is not " "provided, returns the empty string. Otherwise, the behavior of ``str()`` " @@ -2638,43 +2980,43 @@ msgstr "" "``str()`` dependerá se o *encoding* ou *errors* são fornecidos, da seguinte " "forma." -#: ../../library/stdtypes.rst:1563 +#: ../../builtins/stdtypes.rst:1638 msgid "" -"If neither *encoding* nor *errors* is given, ``str(object)`` returns :meth:" -"`type(object).__str__(object) `, which is the \"informal\" " -"or nicely printable string representation of *object*. For string objects, " -"this is the string itself. If *object* does not have a :meth:`~object." -"__str__` method, then :func:`str` falls back to returning :func:" -"`repr(object) `." +"If neither *encoding* nor *errors* is given, ``str(object)`` " +"returns :meth:`type(object).__str__(object) `, which is the " +"\"informal\" or nicely printable string representation of *object*. For " +"string objects, this is the string itself. If *object* does not have " +"a :meth:`~object.__str__` method, then :func:`str` falls back to " +"returning :func:`repr(object) `." msgstr "" -"Se nem *encoding* nem *errors* for fornecido, ``str(object)`` retornará :" -"meth:`type(object).__str__(object) `, que é a representação " -"da string \"informal\" ou que pode ser facilmente imprimível  de *object*. " -"Para objetos string, esta é a própria string. Se *object* não tiver um " -"método::meth:`~object.__str__`, então a função :func:`str` retornará :func:" -"`repr(object) `." +"Se nem *encoding* nem *errors* for fornecido, ``str(object)`` " +"retornará :meth:`type(object).__str__(object) `, que é a " +"representação da string \"informal\" ou que pode ser facilmente imprimível  " +"de *object*. Para objetos string, esta é a própria string. Se *object* não " +"tiver um método::meth:`~object.__str__`, então a função :func:`str` " +"retornará :func:`repr(object) `." -#: ../../library/stdtypes.rst:1575 +#: ../../builtins/stdtypes.rst:1650 msgid "" -"If at least one of *encoding* or *errors* is given, *object* should be a :" -"term:`bytes-like object` (e.g. :class:`bytes` or :class:`bytearray`). In " +"If at least one of *encoding* or *errors* is given, *object* should be " +"a :term:`bytes-like object` (e.g. :class:`bytes` or :class:`bytearray`). In " "this case, if *object* is a :class:`bytes` (or :class:`bytearray`) object, " -"then ``str(bytes, encoding, errors)`` is equivalent to :meth:`bytes." -"decode(encoding, errors) `. Otherwise, the bytes object " -"underlying the buffer object is obtained before calling :meth:`bytes." -"decode`. See :ref:`binaryseq` and :ref:`bufferobjects` for information on " -"buffer objects." +"then ``str(bytes, encoding, errors)`` is equivalent " +"to :meth:`bytes.decode(encoding, errors) `. Otherwise, the " +"bytes object underlying the buffer object is obtained before " +"calling :meth:`bytes.decode`. See :ref:`binaryseq` and :ref:`bufferobjects` " +"for information on buffer objects." msgstr "" "Se pelo menos um de *encoding* ou *errors* for fornecido, *object* deve ser " -"um :term:`objeto byte ou similar ` (por exemplo, :class:" -"`bytes` ou :class:`bytearray`). Nesse caso, se *object* for um objeto :class:" -"`bytes` (ou :class:`bytearray`), então ``str(bytes, encoding, errors)`` será " -"equivalente a :meth:`bytes.decode(encoding, errors) `. Caso " -"contrário, o objeto byte subjacente ao objeto buffer é obtido antes de " +"um :term:`objeto bytes ou similar` (por exemplo, :class:`bytes` " +"ou :class:`bytearray`). Nesse caso, se *object* for um objeto :class:`bytes` " +"(ou :class:`bytearray`), então ``str(bytes, encoding, errors)`` equivale " +"a :meth:`bytes.decode(encoding, errors) `. Caso contrário, o " +"objeto bytes subjacente ao objeto buffer é obtido antes de " "chamar :meth:`bytes.decode`. Veja :ref:`binaryseq` e :ref:`bufferobjects` " "para obter informações sobre objetos buffer." -#: ../../library/stdtypes.rst:1584 +#: ../../builtins/stdtypes.rst:1659 msgid "" "Passing a :class:`bytes` object to :func:`str` without the *encoding* or " "*errors* arguments falls under the first case of returning the informal " @@ -2686,23 +3028,31 @@ msgstr "" "representação informal de strings (consulte também a opção de linha de " "comando :option:`-b` para Python). Por exemplo::" -#: ../../library/stdtypes.rst:1592 +#: ../../builtins/stdtypes.rst:1664 +msgid "" +">>> str(b'Zoot!')\n" +"\"b'Zoot!'\"" +msgstr "" +">>> str(b'Zoot!')\n" +"\"b'Zoot!'\"" + +#: ../../builtins/stdtypes.rst:1667 msgid "" -"For more information on the ``str`` class and its methods, see :ref:" -"`textseq` and the :ref:`string-methods` section below. To output formatted " -"strings, see the :ref:`f-strings` and :ref:`formatstrings` sections. In " -"addition, see the :ref:`stringservices` section." +"For more information on the ``str`` class and its methods, " +"see :ref:`textseq` and the :ref:`string-methods` section below. To output " +"formatted strings, see the :ref:`f-strings` and :ref:`formatstrings` " +"sections. In addition, see the :ref:`stringservices` section." msgstr "" -"Para mais informações sobre a classe ``str`` e seus métodos, veja :ref:" -"`textseq` e a seção :ref:`string-methods` abaixo. Para gerar strings " -"formatadas, veja as seções :ref:`f-strings` e :ref:`formatstrings`. Além " -"disso, veja a seção :ref:`stringservices`." +"Para mais informações sobre a classe ``str`` e seus métodos, " +"veja :ref:`textseq` e a seção :ref:`string-methods` abaixo. Para gerar " +"strings formatadas, veja as seções :ref:`f-strings` e :ref:`formatstrings`. " +"Além disso, veja a seção :ref:`stringservices`." -#: ../../library/stdtypes.rst:1604 +#: ../../builtins/stdtypes.rst:1679 msgid "String Methods" -msgstr "Métodos de string" +msgstr "String Methods" -#: ../../library/stdtypes.rst:1609 +#: ../../builtins/stdtypes.rst:1684 msgid "" "Strings implement all of the :ref:`common ` sequence " "operations, along with the additional methods described below." @@ -2710,24 +3060,24 @@ msgstr "" "Strings implementam todas as operações :ref:`comuns ` de " "sequências, juntamente com os métodos adicionais descritos abaixo." -#: ../../library/stdtypes.rst:1612 +#: ../../builtins/stdtypes.rst:1687 msgid "" "Strings also support two styles of string formatting, one providing a large " -"degree of flexibility and customization (see :meth:`str.format`, :ref:" -"`formatstrings` and :ref:`string-formatting`) and the other based on C " -"``printf`` style formatting that handles a narrower range of types and is " -"slightly harder to use correctly, but is often faster for the cases it can " -"handle (:ref:`old-string-formatting`)." +"degree of flexibility and customization " +"(see :meth:`str.format`, :ref:`formatstrings` and :ref:`string-formatting`) " +"and the other based on C ``printf`` style formatting that handles a narrower " +"range of types and is slightly harder to use correctly, but is often faster " +"for the cases it can handle (:ref:`old-string-formatting`)." msgstr "" "Strings também possuem suporte para duas formas de formatação de string, uma " -"fornecendo uma ampla gama de flexibilidade e customização (veja :meth:`str." -"format`, :ref:`formatstrings` e :ref:`string-formatting`) e a outra baseada " -"no estilo de formatação ``printf`` da linguagem C, que lida com uma gama " -"menor de tipos e é levemente mais difícil de utilizar corretamente, mas é " -"frequentemente mais rápida para os casos na qual ela consegue manipular (:" -"ref:`old-string-formatting`)." +"fornecendo uma ampla gama de flexibilidade e customização " +"(veja :meth:`str.format`, :ref:`formatstrings` e :ref:`string-formatting`) e " +"a outra baseada no estilo de formatação ``printf`` da linguagem C, que lida " +"com uma gama menor de tipos e é levemente mais difícil de utilizar " +"corretamente, mas é frequentemente mais rápida para os casos na qual ela " +"consegue manipular (:ref:`old-string-formatting`)." -#: ../../library/stdtypes.rst:1619 +#: ../../builtins/stdtypes.rst:1694 msgid "" "The :ref:`textservices` section of the standard library covers a number of " "other modules that provide various text related utilities (including regular " @@ -2737,7 +3087,7 @@ msgstr "" "outros módulos que fornecem vários utilitários relacionados a texto " "(incluindo suporte a expressões regulares no módulo :mod:`re`)." -#: ../../library/stdtypes.rst:1625 +#: ../../builtins/stdtypes.rst:1700 msgid "" "Return a copy of the string with its first character capitalized and the " "rest lowercased." @@ -2745,7 +3095,7 @@ msgstr "" "Retorna uma cópia da string com o seu primeiro caractere em maiúsculo e o " "restante em minúsculo." -#: ../../library/stdtypes.rst:1628 +#: ../../builtins/stdtypes.rst:1703 msgid "" "The first character is now put into titlecase rather than uppercase. This " "means that characters like digraphs will only have their first letter " @@ -2755,7 +3105,7 @@ msgstr "" "maiúsculas. Isso significa que caracteres como dígrafos apenas terão sua " "primeira letra alterada para maiúscula, ao invés de todos os caracteres." -#: ../../library/stdtypes.rst:1635 +#: ../../builtins/stdtypes.rst:1710 msgid "" "Return a casefolded copy of the string. Casefolded strings may be used for " "caseless matching." @@ -2763,22 +3113,34 @@ msgstr "" "Retorna uma cópia da string em *casefolded*. Strings em *casefold* podem ser " "usadas para corresponder letras sem importar se são minúsculas ou maiúsculas." -#: ../../library/stdtypes.rst:1638 +#: ../../builtins/stdtypes.rst:1713 msgid "" "Casefolding is similar to lowercasing but more aggressive because it is " "intended to remove all case distinctions in a string. For example, the " "German lowercase letter ``'ß'`` is equivalent to ``\"ss\"``. Since it is " -"already lowercase, :meth:`lower` would do nothing to ``'ß'``; :meth:" -"`casefold` converts it to ``\"ss\"``." +"already lowercase, :meth:`lower` would do nothing to " +"``'ß'``; :meth:`casefold` converts it to ``\"ss\"``. For example:" msgstr "" "*Casefolding* é similar a mudar para letras minúsculas, mas mais agressivo " "porque destina-se a remover todas as diferenças maiúsculas/minúsculas em uma " -"string. Por exemplo, a letra minúscula alemã ``'ß'`` é equivalente a " -"``\"ss\"``. Como ela já é uma minúscula, o método :meth:`lower` não irá " -"fazer nada para ``'ß'``; já o método :meth:`casefold` converte a letra para " -"``\"ss\"``." +"string. Por exemplo, a letra minúscula alemã ``'ß'`` equivale a ``\"ss\"``. " +"Como ela já é uma minúscula, o método :meth:`lower` não irá fazer nada para " +"``'ß'``; já o método :meth:`casefold` converte a letra para ``\"ss\"``. Por " +"exemplo:" + +#: ../../builtins/stdtypes.rst:1720 +msgid "" +">>> 'straße'.lower()\n" +"'straße'\n" +">>> 'straße'.casefold()\n" +"'strasse'" +msgstr "" +">>> 'straße'.lower()\n" +"'straße'\n" +">>> 'straße'.casefold()\n" +"'strasse'" -#: ../../library/stdtypes.rst:1644 +#: ../../builtins/stdtypes.rst:1727 msgid "" "The casefolding algorithm is `described in section 3.13 'Default Case " "Folding' of the Unicode Standard `__." -#: ../../library/stdtypes.rst:1653 +#: ../../builtins/stdtypes.rst:1736 msgid "" "Return centered in a string of length *width*. Padding is done using the " "specified *fillchar* (default is an ASCII space). The original string is " -"returned if *width* is less than or equal to ``len(s)``." +"returned if *width* is less than or equal to ``len(s)``. For example::" msgstr "" "Retorna um texto centralizado em uma string de comprimento *width*. " "Preenchimento é feito usando o parâmetro *fillchar* especificado (padrão é o " "caractere de espaço ASCII). A string original é retornada se *width* é menor " -"ou igual que ``len(s)``." +"ou igual que ``len(s)``. Por exemplo::" -#: ../../library/stdtypes.rst:1661 +#: ../../builtins/stdtypes.rst:1740 +msgid "" +">>> 'Python'.center(10)\n" +"' Python '\n" +">>> 'Python'.center(10, '-')\n" +"'--Python--'\n" +">>> 'Python'.center(4)\n" +"'Python'" +msgstr "" +">>> 'Python'.center(10)\n" +"' Python '\n" +">>> 'Python'.center(10, '-')\n" +"'--Python--'\n" +">>> 'Python'.center(4)\n" +"'Python'" + +#: ../../builtins/stdtypes.rst:1750 msgid "" "Return the number of non-overlapping occurrences of substring *sub* in the " "range [*start*, *end*]. Optional arguments *start* and *end* are " @@ -2809,19 +3187,43 @@ msgstr "" "intervalo [*start*, *end*]. Argumentos opcionais *start* e *end* são " "interpretados como na notação de fatias." -#: ../../library/stdtypes.rst:1665 +#: ../../builtins/stdtypes.rst:1754 msgid "" "If *sub* is empty, returns the number of empty strings between characters " -"which is the length of the string plus one." +"which is the length of the string plus one. For example::" msgstr "" "Se *sub* estiver vazio, retorna o número de strings vazias entre os " -"caracteres, que é o comprimento da string mais um." - -#: ../../library/stdtypes.rst:1671 +"caracteres, que é o comprimento da string mais um. Por exemplo::" + +#: ../../builtins/stdtypes.rst:1757 +msgid "" +">>> 'spam, spam, spam'.count('spam')\n" +"3\n" +">>> 'spam, spam, spam'.count('spam', 5)\n" +"2\n" +">>> 'spam, spam, spam'.count('spam', 5, 10)\n" +"1\n" +">>> 'spam, spam, spam'.count('eggs')\n" +"0\n" +">>> 'spam, spam, spam'.count('')\n" +"17" +msgstr "" +">>> 'spam, spam, spam'.count('spam')\n" +"3\n" +">>> 'spam, spam, spam'.count('spam', 5)\n" +"2\n" +">>> 'spam, spam, spam'.count('spam', 5, 10)\n" +"1\n" +">>> 'spam, spam, spam'.count('eggs')\n" +"0\n" +">>> 'spam, spam, spam'.count('')\n" +"17" + +#: ../../builtins/stdtypes.rst:1770 msgid "Return the string encoded to :class:`bytes`." msgstr "Retorna a string codificada para :class:`bytes`." -#: ../../library/stdtypes.rst:1673 ../../library/stdtypes.rst:2824 +#: ../../builtins/stdtypes.rst:1772 ../../builtins/stdtypes.rst:3414 msgid "" "*encoding* defaults to ``'utf-8'``; see :ref:`standard-encodings` for " "possible values." @@ -2829,57 +3231,97 @@ msgstr "" "*encoding* tem como padrão ``'utf-8'``; veja :ref:`standard-encodings` para " "valores possíveis." -#: ../../library/stdtypes.rst:1676 +#: ../../builtins/stdtypes.rst:1775 msgid "" "*errors* controls how encoding errors are handled. If ``'strict'`` (the " "default), a :exc:`UnicodeError` exception is raised. Other possible values " "are ``'ignore'``, ``'replace'``, ``'xmlcharrefreplace'``, " -"``'backslashreplace'`` and any other name registered via :func:`codecs." -"register_error`. See :ref:`error-handlers` for details." +"``'backslashreplace'`` and any other name registered " +"via :func:`codecs.register_error`. See :ref:`error-handlers` for details." msgstr "" "*errors* controla como os erros de codificação são tratados. Se ``'strict'`` " "(o padrão), uma exceção :exc:`UnicodeError` é levantada. Outros valores " "possíveis são ``'ignore'``, ``'replace'``, ``'xmlcharrefreplace'``, " -"``'backslashreplace'`` e qualquer outro nome registrado via :func:`codecs." -"register_error`. Veja :ref:`error-handlers` para detalhes." +"``'backslashreplace'`` e qualquer outro nome registrado " +"via :func:`codecs.register_error`. Veja :ref:`error-handlers` para detalhes." -#: ../../library/stdtypes.rst:1683 +#: ../../builtins/stdtypes.rst:1782 msgid "" "For performance reasons, the value of *errors* is not checked for validity " -"unless an encoding error actually occurs, :ref:`devmode` is enabled or a :" -"ref:`debug build ` is used." +"unless an encoding error actually occurs, :ref:`devmode` is enabled or " +"a :ref:`debug build ` is used. For example::" msgstr "" "Por motivos de desempenho, o valor de *errors* não é verificado quanto à " -"validade, a menos que um erro de codificação realmente ocorra, :ref:" -"`devmode` esteja ativado ou uma :ref:`construção de depuração ` " -"seja usada." +"validade, a menos que um erro de codificação realmente " +"ocorra, :ref:`devmode` esteja ativado ou uma :ref:`construção de depuração " +"` seja usada. Por exemplo::" -#: ../../library/stdtypes.rst:1688 ../../library/stdtypes.rst:2843 +#: ../../builtins/stdtypes.rst:1788 +msgid "" +">>> encoded_str_to_bytes = 'Python'.encode()\n" +">>> type(encoded_str_to_bytes)\n" +"\n" +">>> encoded_str_to_bytes\n" +"b'Python'" +msgstr "" +">>> encoded_str_to_bytes = 'Python'.encode()\n" +">>> type(encoded_str_to_bytes)\n" +"\n" +">>> encoded_str_to_bytes\n" +"b'Python'" + +#: ../../builtins/stdtypes.rst:1795 ../../builtins/stdtypes.rst:3433 msgid "Added support for keyword arguments." msgstr "Adicionado suporte para argumentos nomeados." -#: ../../library/stdtypes.rst:1691 ../../library/stdtypes.rst:2846 +#: ../../builtins/stdtypes.rst:1798 ../../builtins/stdtypes.rst:3436 msgid "" -"The value of the *errors* argument is now checked in :ref:`devmode` and in :" -"ref:`debug mode `." +"The value of the *errors* argument is now checked in :ref:`devmode` and " +"in :ref:`debug mode `." msgstr "" -"O valor do argumento *errors* agora é verificado em :ref:`devmode` e no :ref:" -"`modo de depuração `." +"O valor do argumento *errors* agora é verificado em :ref:`devmode` e " +"no :ref:`modo de depuração `." -#: ../../library/stdtypes.rst:1698 +#: ../../builtins/stdtypes.rst:1805 msgid "" "Return ``True`` if the string ends with the specified *suffix*, otherwise " "return ``False``. *suffix* can also be a tuple of suffixes to look for. " "With optional *start*, test beginning at that position. With optional " -"*end*, stop comparing at that position." +"*end*, stop comparing at that position. Using *start* and *end* is " +"equivalent to ``str[start:end].endswith(suffix)``. For example::" msgstr "" "Retorna ``True`` se a string terminar com o *suffix* especificado, caso " "contrário retorna ``False``. *suffix* também pode ser uma tupla de sufixos " "para procurar. Com o parâmetro opcional *start*, começamos a testar a partir " "daquela posição. Com o parâmetro opcional *end*, devemos parar de comparar " -"na posição especificada." - -#: ../../library/stdtypes.rst:1706 +"na posição especificada. Usar *start* e *end* equivale a " +"``str[start:end].endswith(suffix)``. Por exemplo::" + +#: ../../builtins/stdtypes.rst:1811 +msgid "" +">>> 'Python'.endswith('on')\n" +"True\n" +">>> 'a tuple of suffixes'.endswith(('at', 'in'))\n" +"False\n" +">>> 'a tuple of suffixes'.endswith(('at', 'es'))\n" +"True\n" +">>> 'Python is amazing'.endswith('is', 0, 9)\n" +"True" +msgstr "" +">>> 'Python'.endswith('on')\n" +"True\n" +">>> 'a tuple of suffixes'.endswith(('at', 'in'))\n" +"False\n" +">>> 'a tuple of suffixes'.endswith(('at', 'es'))\n" +"True\n" +">>> 'Python is amazing'.endswith('is', 0, 9)\n" +"True" + +#: ../../builtins/stdtypes.rst:1820 +msgid "See also :meth:`startswith` and :meth:`removesuffix`." +msgstr "Veja também :meth:`startswith` e :meth:`removesuffix`." + +#: ../../builtins/stdtypes.rst:1825 msgid "" "Return a copy of the string where all tab characters are replaced by one or " "more spaces, depending on the current column and the given tab size. Tab " @@ -2892,7 +3334,7 @@ msgid "" "(``\\n``) or return (``\\r``), it is copied and the current column is reset " "to zero. Any other character is copied unchanged and the current column is " "incremented by one regardless of how the character is represented when " -"printed." +"printed. For example::" msgstr "" "Retorna uma cópia da string onde todos os caracteres de tabulação são " "substituídos por um ou mais espaços, dependendo da coluna atual e do tamanho " @@ -2906,46 +3348,106 @@ msgstr "" "caractere de nova linha (``\\n``) ou de retorno (``\\r``), ele é copiado e a " "coluna atual é redefinida para zero. Qualquer outro caractere é copiado sem " "ser modificado e a coluna atual é incrementada em uma unidade " -"independentemente de como o caractere é representado quando é impresso." +"independentemente de como o caractere é representado quando é impresso. Por " +"exemplo::" + +#: ../../builtins/stdtypes.rst:1838 +msgid "" +">>> '01\\t012\\t0123\\t01234'.expandtabs()\n" +"'01 012 0123 01234'\n" +">>> '01\\t012\\t0123\\t01234'.expandtabs(4)\n" +"'01 012 0123 01234'\n" +">>> print('01\\t012\\n0123\\t01234'.expandtabs(4))\n" +"01 012\n" +"0123 01234" +msgstr "" +">>> '01\\t012\\t0123\\t01234'.expandtabs()\n" +"'01 012 0123 01234'\n" +">>> '01\\t012\\t0123\\t01234'.expandtabs(4)\n" +"'01 012 0123 01234'\n" +">>> print('01\\t012\\n0123\\t01234'.expandtabs(4))\n" +"01 012\n" +"0123 01234" -#: ../../library/stdtypes.rst:1727 +#: ../../builtins/stdtypes.rst:1849 msgid "" "Return the lowest index in the string where substring *sub* is found within " "the slice ``s[start:end]``. Optional arguments *start* and *end* are " -"interpreted as in slice notation. Return ``-1`` if *sub* is not found." +"interpreted as in slice notation. Return ``-1`` if *sub* is not found. For " +"example::" msgstr "" "Retorna o índice mais baixo na string onde a substring *sub* é encontrado " "dentro da fatia ``s[start:end]``. Argumentos opcionais como *start* e *end* " "são interpretados como na notação de fatiamento. Retorna ``-1`` se *sub* não " -"for localizado." +"for localizado. Por exemplo::" -#: ../../library/stdtypes.rst:1733 +#: ../../builtins/stdtypes.rst:1854 +msgid "" +">>> 'spam, spam, spam'.find('sp')\n" +"0\n" +">>> 'spam, spam, spam'.find('sp', 5)\n" +"6" +msgstr "" +">>> 'spam, spam, spam'.find('sp')\n" +"0\n" +">>> 'spam, spam, spam'.find('sp', 5)\n" +"6" + +#: ../../builtins/stdtypes.rst:1859 +msgid "See also :meth:`rfind` and :meth:`index`." +msgstr "Veja também :meth:`rfind` e :meth:`index`." + +#: ../../builtins/stdtypes.rst:1863 msgid "" "The :meth:`~str.find` method should be used only if you need to know the " -"position of *sub*. To check if *sub* is a substring or not, use the :" -"keyword:`in` operator::" +"position of *sub*. To check if *sub* is a substring or not, use " +"the :keyword:`in` operator::" msgstr "" "O método :meth:`~str.find` deve ser usado apenas se precisarmos conhecer a " "posição de *sub*. Para verificar se *sub* é ou não uma substring, use o " "operador :keyword:`in`::" -#: ../../library/stdtypes.rst:1743 +#: ../../builtins/stdtypes.rst:1867 +msgid "" +">>> 'Py' in 'Python'\n" +"True" +msgstr "" +">>> 'Py' in 'Python'\n" +"True" + +#: ../../builtins/stdtypes.rst:1873 msgid "" "Perform a string formatting operation. The string on which this method is " "called can contain literal text or replacement fields delimited by braces " "``{}``. Each replacement field contains either the numeric index of a " "positional argument, or the name of a keyword argument. Returns a copy of " "the string where each replacement field is replaced with the string value of " -"the corresponding argument." +"the corresponding argument. For example:" msgstr "" "Executa uma operação de formatação de string. A string na qual este método é " "chamado pode conter texto literal ou campos para substituição delimitados " "por chaves ``{}``. Cada campo de substituição contém um índice numérico de " "um argumento posicional ou o nome de um argumento nomeado. Retorna a cópia " "da string onde cada campo para substituição é substituído com o valor da " -"string do argumento correspondente." +"string do argumento correspondente. Por exemplo:" + +#: ../../builtins/stdtypes.rst:1880 +msgid "" +">>> \"The sum of 1 + 2 is {0}\".format(1+2)\n" +"'The sum of 1 + 2 is 3'\n" +">>> \"The sum of {a} + {b} is {answer}\".format(answer=1+2, a=1, b=2)\n" +"'The sum of 1 + 2 is 3'\n" +">>> \"{1} expects the {0} Inquisition!\".format(\"Spanish\", \"Nobody\")\n" +"'Nobody expects the Spanish Inquisition!'" +msgstr "" +">>> \"A soma de 1 + 2 é {0}\".format(1+2)\n" +"'A soma de 1 + 2 é 3'\n" +">>> \"A soma de {a} + {b} é {answer}\".format(answer=1+2, a=1, b=2)\n" +"'A soma de 1 + 2 é 3'\n" +">>> \"{1} espera a inquisição {0}!\".format(\"espanhola\", \"Ninguém\")\n" +"'Ninguém espera a inquisição espanhola!'" -#: ../../library/stdtypes.rst:1753 +#: ../../builtins/stdtypes.rst:1889 msgid "" "See :ref:`formatstrings` for a description of the various formatting options " "that can be specified in format strings." @@ -2953,26 +3455,27 @@ msgstr "" "Veja :ref:`formatstrings` para uma descrição das várias opções de formatação " "que podem ser especificadas em uma strings de formato." -#: ../../library/stdtypes.rst:1757 +#: ../../builtins/stdtypes.rst:1893 msgid "" -"When formatting a number (:class:`int`, :class:`float`, :class:`complex`, :" -"class:`decimal.Decimal` and subclasses) with the ``n`` type (ex: ``'{:n}'." -"format(1234)``), the function temporarily sets the ``LC_CTYPE`` locale to " -"the ``LC_NUMERIC`` locale to decode ``decimal_point`` and ``thousands_sep`` " -"fields of :c:func:`localeconv` if they are non-ASCII or longer than 1 byte, " -"and the ``LC_NUMERIC`` locale is different than the ``LC_CTYPE`` locale. " -"This temporary change affects other threads." +"When formatting a number " +"(:class:`int`, :class:`float`, :class:`complex`, :class:`decimal.Decimal` " +"and subclasses) with the ``n`` type (ex: ``'{:n}'.format(1234)``), the " +"function temporarily sets the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` " +"locale to decode ``decimal_point`` and ``thousands_sep`` fields " +"of :c:func:`localeconv` if they are non-ASCII or longer than 1 byte, and the " +"``LC_NUMERIC`` locale is different than the ``LC_CTYPE`` locale. This " +"temporary change affects other threads." msgstr "" -"Ao formatar um número (:class:`int`, :class:`float`, :class:`complex`, :" -"class:`decimal.Decimal` e sub-classes) com o tipo ``n`` (ex: ``'{:n}'." -"format(1234)``), a função define temporariamente a localidade ``LC_CTYPE`` " -"para a localidade ``LC_NUMERIC`` a fim de decodificar campos " -"``decimal_point`` e ``thousands_sep`` de :c:func:`localeconv` se eles são " -"caracteres não-ASCII ou maiores que 1 byte, e a localidade ``LC_NUMERIC`` é " -"diferente da localidade ``LC_CTYPE``. Esta mudança temporária afeta outras " -"threads." +"Ao formatar um número " +"(:class:`int`, :class:`float`, :class:`complex`, :class:`decimal.Decimal` e " +"sub-classes) com o tipo ``n`` (ex: ``'{:n}'.format(1234)``), a função define " +"temporariamente a localidade ``LC_CTYPE`` para a localidade ``LC_NUMERIC`` a " +"fim de decodificar campos ``decimal_point`` e ``thousands_sep`` " +"de :c:func:`localeconv` se eles são caracteres não-ASCII ou maiores que 1 " +"byte, e a localidade ``LC_NUMERIC`` é diferente da localidade ``LC_CTYPE``. " +"Esta mudança temporária afeta outras threads." -#: ../../library/stdtypes.rst:1766 +#: ../../builtins/stdtypes.rst:1902 msgid "" "When formatting a number with the ``n`` type, the function sets temporarily " "the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale in some cases." @@ -2980,7 +3483,7 @@ msgstr "" "Ao formatar um número com o tipo ``n``, a função define temporariamente a " "localidade ``LC_CTYPE`` para a localidade ``LC_NUMERIC`` em alguns casos." -#: ../../library/stdtypes.rst:1774 +#: ../../builtins/stdtypes.rst:1910 msgid "" "Similar to ``str.format(**mapping)``, except that ``mapping`` is used " "directly and not copied to a :class:`dict`. This is useful if for example " @@ -2990,88 +3493,212 @@ msgstr "" "é usado diretamente e não copiado para uma classe :class:`dict`. Isso é útil " "se, por exemplo, ``mapping`` é uma subclasse de dict:" -#: ../../library/stdtypes.rst:1790 +#: ../../builtins/stdtypes.rst:1926 msgid "" "Like :meth:`~str.find`, but raise :exc:`ValueError` when the substring is " -"not found." +"not found. For example:" msgstr "" -"Senelhante a :meth:`~str.find`, mas levanta :exc:`ValueError` quando a " -"substring não é encontrada." +"Semelhante a :meth:`~str.find`, mas levanta :exc:`ValueError` quando a " +"substring *sub* não é encontrada. Por exemplo:" -#: ../../library/stdtypes.rst:1796 +#: ../../builtins/stdtypes.rst:1929 +msgid "" +">>> 'spam, spam, spam'.index('spam')\n" +"0\n" +">>> 'spam, spam, spam'.index('eggs')\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" 'spam, spam, spam'.index('eggs')\n" +" ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^\n" +"ValueError: substring not found" +msgstr "" +">>> 'spam, spam, spam'.index('spam')\n" +"0\n" +">>> 'spam, spam, spam'.index('eggs')\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" 'spam, spam, spam'.index('eggs')\n" +" ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^\n" +"ValueError: substring not found" + +#: ../../builtins/stdtypes.rst:1940 +msgid "See also :meth:`rindex`." +msgstr "Veja também :meth:`rindex`." + +#: ../../builtins/stdtypes.rst:1945 msgid "" "Return ``True`` if all characters in the string are alphanumeric and there " "is at least one character, ``False`` otherwise. A character ``c`` is " -"alphanumeric if one of the following returns ``True``: ``c.isalpha()``, ``c." -"isdecimal()``, ``c.isdigit()``, or ``c.isnumeric()``." +"alphanumeric if one of the following returns ``True``: ``c.isalpha()``, " +"``c.isdecimal()``, ``c.isdigit()``, or ``c.isnumeric()``. For example:" msgstr "" "Retorna ``True`` se todos os caracteres na string são alfanuméricos e existe " "pelo menos um caractere, ou ``False`` caso contrário. Um caractere ``c`` é " -"alfanumérico se um dos seguintes retorna ``True``: ``c.isalpha()``, ``c." -"isdecimal()``, ``c.isdigit()``, ou ``c.isnumeric()``." - -#: ../../library/stdtypes.rst:1804 +"alfanumérico se um dos seguintes retorna ``True``: ``c.isalpha()``, " +"``c.isdecimal()``, ``c.isdigit()``, ou ``c.isnumeric()``. Por exemplo:" + +#: ../../builtins/stdtypes.rst:1950 +msgid "" +">>> 'abc123'.isalnum()\n" +"True\n" +">>> 'abc123!@#'.isalnum()\n" +"False\n" +">>> ''.isalnum()\n" +"False\n" +">>> ' '.isalnum()\n" +"False" +msgstr "" +">>> 'abc123'.isalnum()\n" +"True\n" +">>> 'abc123!@#'.isalnum()\n" +"False\n" +">>> ''.isalnum()\n" +"False\n" +">>> ' '.isalnum()\n" +"False" + +#: ../../builtins/stdtypes.rst:1964 msgid "" "Return ``True`` if all characters in the string are alphabetic and there is " "at least one character, ``False`` otherwise. Alphabetic characters are " -"those characters defined in the Unicode character database as \"Letter\", i." -"e., those with general category property being one of \"Lm\", \"Lt\", " +"those characters defined in the Unicode character database as \"Letter\", " +"i.e., those with general category property being one of \"Lm\", \"Lt\", " "\"Lu\", \"Ll\", or \"Lo\". Note that this is different from the `Alphabetic " -"property defined in the section 4.10 'Letters, Alphabetic, and Ideographic' " -"of the Unicode Standard `_." +"property defined in section 4.10 'Letters, Alphabetic, and Ideographic' of " +"the Unicode Standard `_. For example:" msgstr "" -"Retorna ``True`` se todos os caracteres na string são alfabéticos e existe " -"pelo menos um caractere, ``False`` caso contrário. Caracteres alfabéticos " -"são aqueles caracteres definidos na base de dados de caracteres Unicode como " -"\"Letra\", isto é, aqueles cuja propriedade na categoria geral é um destes: " -"\"Lm\", \"Lt\", \"Lu\", \"Ll\" ou \"Lo\". Perceba que isso é diferente da " -"`propriedade Alfabética definida na seção 4.10 \"Letters, Alphabetic, and " -"Ideographic\" do Padrão Unicode `_." -#: ../../library/stdtypes.rst:1815 +#: ../../builtins/stdtypes.rst:1973 +msgid "" +">>> 'Letters and spaces'.isalpha()\n" +"False\n" +">>> 'LettersOnly'.isalpha()\n" +"True\n" +">>> 'µ'.isalpha() # non-ASCII characters can be considered alphabetical " +"too\n" +"True" +msgstr "" +">>> 'Letras e espaços'.isalpha()\n" +"False\n" +">>> 'LetrasApenas'.isalpha()\n" +"True\n" +">>> 'µ'.isalpha() # Caracteres não-ASCII podem ser considerados " +"alfabeticamente também\n" +"True" + +#: ../../builtins/stdtypes.rst:1982 +msgid "See :ref:`unicode-properties`." +msgstr "Consulte :ref:`unicode-properties`." + +#: ../../builtins/stdtypes.rst:1987 msgid "" "Return ``True`` if the string is empty or all characters in the string are " "ASCII, ``False`` otherwise. ASCII characters have code points in the range " -"U+0000-U+007F." +"U+0000-U+007F. For example:" msgstr "" "Retorna ``True`` se a string é vazia ou se todos os caracteres na string são " "ASCII, ``False`` caso contrário. Caracteres ASCII têm pontos de código no " -"intervalo U+0000-U+007F." +"intervalo U+0000-U+007F. Por exemplo:" -#: ../../library/stdtypes.rst:1824 +#: ../../builtins/stdtypes.rst:1991 +msgid "" +">>> 'ASCII characters'.isascii()\n" +"True\n" +">>> 'µ'.isascii()\n" +"False" +msgstr "" +">>> 'Caracteres ASCII'.isascii()\n" +"True\n" +">>> 'µ'.isascii()\n" +"False" + +#: ../../builtins/stdtypes.rst:2003 msgid "" "Return ``True`` if all characters in the string are decimal characters and " "there is at least one character, ``False`` otherwise. Decimal characters are " -"those that can be used to form numbers in base 10, e.g. U+0660, ARABIC-INDIC " -"DIGIT ZERO. Formally a decimal character is a character in the Unicode " -"General Category \"Nd\"." +"those that can be used to form numbers in base 10, such as U+0660, ARABIC-" +"INDIC DIGIT ZERO. Formally a decimal character is a character in the " +"Unicode General Category \"Nd\". For example:" msgstr "" "Retorna ``True`` se todos os caracteres na string são caracteres decimais e " "existe pelo menos um caractere, ``False`` caso contrário. Caracteres " "decimais são aqueles que podem ser usados para formar números na base 10, " -"exemplo U+0660, ou dígito zero para arábico-índico. Formalmente, um " -"caractere decimal é um caractere em Unicode cuja categoria geral é \"Nd\"." +"tal como U+0660, ou dígito zero para arábico-índico. Formalmente, um " +"caractere decimal é um caractere em Unicode cuja categoria geral é \"Nd\". " +"Por exemplo:" + +#: ../../builtins/stdtypes.rst:2010 +msgid "" +">>> '0123456789'.isdecimal()\n" +"True\n" +">>> '٠١٢٣٤٥٦٧٨٩'.isdecimal() # Arabic-Indic digits zero to nine\n" +"True\n" +">>> 'alphabetic'.isdecimal()\n" +"False" +msgstr "" +">>> '0123456789'.isdecimal()\n" +"True\n" +">>> '٠١٢٣٤٥٦٧٨٩'.isdecimal() # Dígitos árabe-índico zero até nove\n" +"True\n" +">>> 'alfabético'.isdecimal()\n" +"False" -#: ../../library/stdtypes.rst:1834 +#: ../../builtins/stdtypes.rst:2022 msgid "" "Return ``True`` if all characters in the string are digits and there is at " "least one character, ``False`` otherwise. Digits include decimal characters " "and digits that need special handling, such as the compatibility superscript " "digits. This covers digits which cannot be used to form numbers in base 10, " -"like the Kharosthi numbers. Formally, a digit is a character that has the " +"like the `Kharosthi numbers `__. Formally, a digit is a character that has the " "property value Numeric_Type=Digit or Numeric_Type=Decimal." msgstr "" "Retorna ``True`` se todos os caracteres na string são dígitos e existe pelo " "menos um caractere, ``False`` caso contrário. Dígitos incluem caracteres " "decimais e dígitos que precisam de tratamento especial, tal como a " "compatibilidade com dígitos sobre-escritos. Isso inclui dígitos que não " -"podem ser usados para formar números na base 10, como por exemplo os números " -"de Kharosthi. Formalmente, um dígito é um caractere que tem a propriedade " -"com valor Numeric_Type=Digit ou Numeric_Type=Decimal." - -#: ../../library/stdtypes.rst:1844 +"podem ser usados para formar números na base 10, como por exemplo os " +"`números de Kharosthi `__`. Formalmente, um dígito é um caractere que tem a " +"propriedade com valor Numeric_Type=Digit ou Numeric_Type=Decimal." + +#: ../../builtins/stdtypes.rst:2030 ../../builtins/stdtypes.rst:2111 +#: ../../builtins/stdtypes.rst:2128 ../../builtins/stdtypes.rst:2155 +#: ../../builtins/stdtypes.rst:2210 ../../builtins/stdtypes.rst:2283 +#: ../../builtins/stdtypes.rst:2394 ../../builtins/stdtypes.rst:2415 +#: ../../builtins/stdtypes.rst:2480 ../../builtins/stdtypes.rst:2501 +#: ../../builtins/stdtypes.rst:2515 ../../builtins/stdtypes.rst:2602 +#: ../../builtins/stdtypes.rst:2626 ../../builtins/stdtypes.rst:2640 +#: ../../builtins/stdtypes.rst:2747 ../../builtins/stdtypes.rst:2853 +msgid "For example:" +msgstr "Por exemplo:" + +#: ../../builtins/stdtypes.rst:2032 +msgid "" +">>> '0123456789'.isdigit()\n" +"True\n" +">>> '٠١٢٣٤٥٦٧٨٩'.isdigit() # Arabic-Indic digits zero to nine\n" +"True\n" +">>> '⅕'.isdigit() # Vulgar fraction one fifth\n" +"False\n" +">>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric()\n" +"(False, True, True)" +msgstr "" +">>> '0123456789'.isdigit()\n" +"True\n" +">>> '٠١٢٣٤٥٦٧٨٩'.isdigit() # Algarismos arábicos orientais de zero a nove\n" +"True\n" +">>> '⅕'.isdigit() # um quinto em fração ordinária\n" +"False\n" +">>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric()\n" +"(False, True, True)" + +#: ../../builtins/stdtypes.rst:2043 +msgid "See also :meth:`isdecimal` and :meth:`isnumeric`." +msgstr "Veja também :meth:`isdecimal` e :meth:`isnumeric`." + +#: ../../builtins/stdtypes.rst:2048 msgid "" "Return ``True`` if the string is a valid identifier according to the " "language definition, section :ref:`identifiers`." @@ -3079,7 +3706,7 @@ msgstr "" "Retorna ``True`` se a string é um identificador válido conforme a definição " "da linguagem, seção :ref:`identifiers`." -#: ../../library/stdtypes.rst:1847 +#: ../../builtins/stdtypes.rst:2051 msgid "" ":func:`keyword.iskeyword` can be used to test whether string ``s`` is a " "reserved identifier, such as :keyword:`def` and :keyword:`class`." @@ -3087,11 +3714,27 @@ msgstr "" ":func:`keyword.iskeyword` pode ser usada para testar se a string ``s`` é uma " "palavra reservada, tal como :keyword:`def` e :keyword:`class`." -#: ../../library/stdtypes.rst:1850 +#: ../../builtins/stdtypes.rst:2054 msgid "Example: ::" msgstr "Exemplo: ::" -#: ../../library/stdtypes.rst:1863 +#: ../../builtins/stdtypes.rst:2057 +msgid "" +">>> from keyword import iskeyword\n" +"\n" +">>> 'hello'.isidentifier(), iskeyword('hello')\n" +"(True, False)\n" +">>> 'def'.isidentifier(), iskeyword('def')\n" +"(True, True)" +msgstr "" +">>> from keyword import iskeyword\n" +"\n" +">>> 'olá.isidentifier(), iskeyword('olá')\n" +"(True, False)\n" +">>> 'def'.isidentifier(), iskeyword('def')\n" +"(True, True)" + +#: ../../builtins/stdtypes.rst:2067 msgid "" "Return ``True`` if all cased characters [4]_ in the string are lowercase and " "there is at least one cased character, ``False`` otherwise." @@ -3100,43 +3743,99 @@ msgstr "" "minúsculo) [4]_ na string são minúsculos e existe pelo menos um caractere em " "caixa, ``False`` caso contrário." -#: ../../library/stdtypes.rst:1869 +#: ../../builtins/stdtypes.rst:2073 msgid "" "Return ``True`` if all characters in the string are numeric characters, and " "there is at least one character, ``False`` otherwise. Numeric characters " "include digit characters, and all characters that have the Unicode numeric " "value property, e.g. U+2155, VULGAR FRACTION ONE FIFTH. Formally, numeric " "characters are those with the property value Numeric_Type=Digit, " -"Numeric_Type=Decimal or Numeric_Type=Numeric." +"Numeric_Type=Decimal or Numeric_Type=Numeric. For example:" msgstr "" "Retorna ``True`` se todos os caracteres na string são caracteres numéricos, " "e existe pelo menos um caractere, ``False`` caso contrário. Caracteres " "numéricos incluem dígitos, e todos os caracteres que têm a propriedade com " "valor numérico Unicode, isto é: U+2155, um quinto de fração vulgar. " "Formalmente, caracteres numéricos são aqueles que possuem propriedades com " -"valor Numeric_Type=Digit, Numeric_Type=Decimal ou Numeric_Type=Numeric." - -#: ../../library/stdtypes.rst:1879 -msgid "" -"Return ``True`` if all characters in the string are printable or the string " -"is empty, ``False`` otherwise. 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 "" -"Retorna ``True`` se todos os caracteres na string podem ser impressos ou se " -"a string é vazia, ``False`` caso contrário. Caracteres que não podem ser " -"impressos são aqueles que estão definidos no banco de dados de caracteres " -"Unicode como \"Outros\" ou \"Separadores\", exceto o caractere ASCII que " -"representa o espaço (0x20), o qual é impresso. (Perceba que caracteres que " -"podem ser impressos, neste contexto, são aqueles que não devem ser escapados " -"quando :func:`repr` é invocada sobre uma string. Ela não tem sentido no " -"tratamento de strings escritas usando :data:`sys.stdout` ou :data:`sys." -"stderr`.)" - -#: ../../library/stdtypes.rst:1890 +"valor Numeric_Type=Digit, Numeric_Type=Decimal ou Numeric_Type=Numeric. Por " +"exemplo:" + +#: ../../builtins/stdtypes.rst:2081 +msgid "" +">>> '0123456789'.isnumeric()\n" +"True\n" +">>> '٠١٢٣٤٥٦٧٨٩'.isnumeric() # Arabic-Indic digits zero to nine\n" +"True\n" +">>> '⅕'.isnumeric() # Vulgar fraction one fifth\n" +"True\n" +">>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric()\n" +"(False, True, True)" +msgstr "" +">>> '0123456789'.isnumeric()\n" +"True\n" +">>> '٠١٢٣٤٥٦٧٨٩'.isnumeric() # Algarismos arábicos orientais de zero a " +"nove\n" +"True\n" +">>> '⅕'.isnumeric() # um quinto em fração ordinária\n" +"True\n" +">>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric()\n" +"(False, True, True)" + +#: ../../builtins/stdtypes.rst:2092 +msgid "See also :meth:`isdecimal` and :meth:`isdigit`." +msgstr "Veja também :meth:`isdecimal` e :meth:`isdigit`." + +#: ../../builtins/stdtypes.rst:2097 +msgid "" +"Return ``True`` if all characters in the string are printable, ``False`` if " +"it contains at least one non-printable character." +msgstr "" +"Retorna ``True`` se todos os caracteres na string forem imprimíveis, " +"``False`` se contiver pelo menos um caractere não imprimível." + +#: ../../builtins/stdtypes.rst:2100 +msgid "" +"Here \"printable\" means the character is suitable for :func:`repr` to use " +"in its output; \"non-printable\" means that :func:`repr` on built-in types " +"will hex-escape the character. It has no bearing on the handling of strings " +"written to :data:`sys.stdout` or :data:`sys.stderr`." +msgstr "" +"Aqui, \"imprimíveis\" significa que o caractere é adequado para :func:`repr` " +"usar em sua saída; \"não imprimível\" significa que :func:`repr` em tipos " +"embutidos fará o escape hexadecimal do caractere. Não tem relação com o " +"tratamento de strings escritas em :data:`sys.stdout` ou :data:`sys.stderr`." + +#: ../../builtins/stdtypes.rst:2105 +msgid "" +"The printable characters are those which in the Unicode character database " +"(see :mod:`unicodedata`) have a general category in group Letter, Mark, " +"Number, Punctuation, or Symbol (L, M, N, P, or S); plus the ASCII space " +"0x20. Nonprintable characters are those in group Separator or Other (Z or " +"C), except the ASCII space." +msgstr "" +"Os caracteres imprimíveis são aqueles que no banco de dados de caracteres " +"Unicode (veja :mod:`unicodedata`) têm uma categoria geral no grupo Letra, " +"Marca, Número, Pontuação ou Símbolo (L, M, N, P ou S); mais o espaço ASCII " +"0x20. Caracteres não imprimíveis são aqueles no grupo Separador ou Outro (Z " +"ou C), exceto o espaço ASCII." + +#: ../../builtins/stdtypes.rst:2113 +msgid "" +">>> ''.isprintable(), ' '.isprintable()\n" +"(True, True)\n" +">>> '\\t'.isprintable(), '\\n'.isprintable()\n" +"(False, False)" +msgstr "" +">>> ''.isprintable(), ' '.isprintable()\n" +"(True, True)\n" +">>> '\\t'.isprintable(), '\\n'.isprintable()\n" +"(False, False)" + +#: ../../builtins/stdtypes.rst:2120 +msgid "See also :meth:`isspace`." +msgstr "Veja também :meth:`isspace`." + +#: ../../builtins/stdtypes.rst:2125 msgid "" "Return ``True`` if there are only whitespace characters in the string and " "there is at least one character, ``False`` otherwise." @@ -3144,17 +3843,42 @@ msgstr "" "Retorna ``True`` se existem apenas caracteres de espaço em branco na string " "e existe pelo menos um caractere, ``False`` caso contrário." -#: ../../library/stdtypes.rst:1893 -msgid "" -"A character is *whitespace* if in the Unicode character database (see :mod:" -"`unicodedata`), either its general category is ``Zs`` (\"Separator, " -"space\"), or its bidirectional class is one of ``WS``, ``B``, or ``S``." +#: ../../builtins/stdtypes.rst:2130 +msgid "" +">>> ''.isspace()\n" +"False\n" +">>> ' '.isspace()\n" +"True\n" +">>> '\\t\\n'.isspace() # TAB and BREAK LINE\n" +"True\n" +">>> '\\u3000'.isspace() # IDEOGRAPHIC SPACE\n" +"True" +msgstr "" +">>> ''.isspace()\n" +"False\n" +">>> ' '.isspace()\n" +"True\n" +">>> '\\t\\n'.isspace() # TAB e QUEBRA DE LINHA\n" +"True\n" +">>> '\\u3000'.isspace() # ESPAÇO IDEOGRÁFICO\n" +"True" + +#: ../../builtins/stdtypes.rst:2141 +msgid "" +"A character is *whitespace* if in the Unicode character database " +"(see :mod:`unicodedata`), either its general category is ``Zs`` " +"(\"Separator, space\"), or its bidirectional class is one of ``WS``, ``B``, " +"or ``S``." msgstr "" "Um caractere é *espaço em branco* se no banco de dados de caracteres Unicode " "(veja :mod:`unicodedata`), ou pertence a categoria geral ``Zs`` " "(\"Separador, espaço\"), ou sua classe bidirecional é ``WS``, ``B`` ou ``S``." -#: ../../library/stdtypes.rst:1901 +#: ../../builtins/stdtypes.rst:2146 +msgid "See also :meth:`isprintable`." +msgstr "Veja também :meth:`isprintable`." + +#: ../../builtins/stdtypes.rst:2151 msgid "" "Return ``True`` if the string is a titlecased string and there is at least " "one character, for example uppercase characters may only follow uncased " @@ -3166,7 +3890,27 @@ msgstr "" "diferenciam maiúsculas/minúsculas, e caracteres minúsculos somente podem " "proceder caracteres que permitem ambos. Retorna ``False`` caso contrário." -#: ../../library/stdtypes.rst:1908 +#: ../../builtins/stdtypes.rst:2157 +msgid "" +">>> 'Spam, Spam, Spam'.istitle()\n" +"True\n" +">>> 'spam, spam, spam'.istitle()\n" +"False\n" +">>> 'SPAM, SPAM, SPAM'.istitle()\n" +"False" +msgstr "" +">>> 'Spam, Spam, Spam'.istitle()\n" +"True\n" +">>> 'spam, spam, spam'.istitle()\n" +"False\n" +">>> 'SPAM, SPAM, SPAM'.istitle()\n" +"False" + +#: ../../builtins/stdtypes.rst:2166 +msgid "See also :meth:`title`." +msgstr "Veja também :meth:`title`." + +#: ../../builtins/stdtypes.rst:2171 msgid "" "Return ``True`` if all cased characters [4]_ in the string are uppercase and " "there is at least one cased character, ``False`` otherwise." @@ -3175,19 +3919,35 @@ msgstr "" "minúsculas [4]_ na string estão com letras maiúsculas, e existe pelo menos " "um caractere maiúsculo, ``False`` caso contrário." -#: ../../library/stdtypes.rst:1926 +#: ../../builtins/stdtypes.rst:2189 msgid "" -"Return a string which is the concatenation of the strings in *iterable*. A :" -"exc:`TypeError` will be raised if there are any non-string values in " +"Return a string which is the concatenation of the strings in *iterable*. " +"A :exc:`TypeError` will be raised if there are any non-string values in " "*iterable*, including :class:`bytes` objects. The separator between " -"elements is the string providing this method." +"elements is the string providing this method. For example:" msgstr "" -"Retorna a string que é a concatenação das strings no *iterável*. Uma :exc:" -"`TypeError` será levantada se existirem quaisquer valores que não sejam " -"strings no *iterável*, incluindo objetos :class:`bytes`. O separador entre " -"elementos é a string que está fornecendo este método." +"Retorna a string que é a concatenação das strings no *iterável*. " +"Uma :exc:`TypeError` será levantada se existirem quaisquer valores que não " +"sejam strings no *iterável*, incluindo objetos :class:`bytes`. O separador " +"entre elementos é a string que está fornecendo este método. Por exemplo:" -#: ../../library/stdtypes.rst:1934 +#: ../../builtins/stdtypes.rst:2194 +msgid "" +">>> ', '.join(['spam', 'spam', 'spam'])\n" +"'spam, spam, spam'\n" +">>> '-'.join('Python')\n" +"'P-y-t-h-o-n'" +msgstr "" +">>> ', '.join(['spam', 'spam', 'spam'])\n" +"'spam, spam, spam'\n" +">>> '-'.join('Python')\n" +"'P-y-t-h-o-n'" + +#: ../../builtins/stdtypes.rst:2201 +msgid "See also :meth:`split`." +msgstr "Veja também :meth:`split`." + +#: ../../builtins/stdtypes.rst:2206 msgid "" "Return the string left justified in a string of length *width*. Padding is " "done using the specified *fillchar* (default is an ASCII space). The " @@ -3198,15 +3958,43 @@ msgstr "" "caractere ASCII de espaço). A string original é retornada se *width* é menor " "ou igual que ``len(s)``." -#: ../../library/stdtypes.rst:1941 +#: ../../builtins/stdtypes.rst:2212 +msgid "" +">>> 'Python'.ljust(10)\n" +"'Python '\n" +">>> 'Python'.ljust(10, '.')\n" +"'Python....'\n" +">>> 'Monty Python'.ljust(10, '.')\n" +"'Monty Python'" +msgstr "" +">>> 'Python'.ljust(10)\n" +"'Python '\n" +">>> 'Python'.ljust(10, '.')\n" +"'Python....'\n" +">>> 'Monty Python'.ljust(10, '.')\n" +"'Monty Python'" + +#: ../../builtins/stdtypes.rst:2221 ../../builtins/stdtypes.rst:2756 +msgid "See also :meth:`rjust`." +msgstr "Veja também :meth:`rjust`" + +#: ../../builtins/stdtypes.rst:2226 msgid "" "Return a copy of the string with all the cased characters [4]_ converted to " -"lowercase." +"lowercase. For example:" msgstr "" "Retorna uma cópia da string com todos os caracteres que permitem maiúsculo E " -"minúsculo [4]_ convertidos para letras minúsculas." +"minúsculo [4]_ convertidos para letras minúsculas. Por exemplo:" + +#: ../../builtins/stdtypes.rst:2229 +msgid "" +">>> 'Lower Method Example'.lower()\n" +"'lower method example'" +msgstr "" +">>> 'Exemplo do Método Lower'.lower()\n" +"'exemplo do método lower'" -#: ../../library/stdtypes.rst:1944 +#: ../../builtins/stdtypes.rst:2234 msgid "" "The lowercasing algorithm used is `described in section 3.13 'Default Case " "Folding' of the Unicode Standard `__." -#: ../../library/stdtypes.rst:1951 +#: ../../builtins/stdtypes.rst:2241 msgid "" "Return a copy of the string with leading characters removed. The *chars* " "argument is a string specifying the set of characters to be removed. If " @@ -3229,9 +4017,21 @@ msgstr "" "removidos. Se for omitido ou se for ``None``, o argumento *chars* será " "considerado como espaço em branco por padrão para a remoção. O argumento " "*chars* não é um prefixo; ao invés disso, todas as combinações dos seus " -"valores são retirados::" +"valores são removidas::" -#: ../../library/stdtypes.rst:1961 +#: ../../builtins/stdtypes.rst:2246 +msgid "" +">>> ' spacious '.lstrip()\n" +"'spacious '\n" +">>> 'www.example.com'.lstrip('cmowz.')\n" +"'example.com'" +msgstr "" +">>> ' spacious '.lstrip()\n" +"'spacious '\n" +">>> 'www.example.com'.lstrip('cmowz.')\n" +"'example.com'" + +#: ../../builtins/stdtypes.rst:2251 msgid "" "See :meth:`str.removeprefix` for a method that will remove a single prefix " "string rather than all of a set of characters. For example::" @@ -3239,15 +4039,27 @@ msgstr "" "Consulte :meth:`str.removeprefix` para um método que removerá uma única " "string de prefixo em vez de todo um conjunto de caracteres. Por exemplo::" -#: ../../library/stdtypes.rst:1972 +#: ../../builtins/stdtypes.rst:2254 +msgid "" +">>> 'Arthur: three!'.lstrip('Arthur: ')\n" +"'ee!'\n" +">>> 'Arthur: three!'.removeprefix('Arthur: ')\n" +"'three!'" +msgstr "" +">>> 'Arthur: three!'.lstrip('Arthur: ')\n" +"'ee!'\n" +">>> 'Arthur: three!'.removeprefix('Arthur: ')\n" +"'three!'" + +#: ../../builtins/stdtypes.rst:2263 msgid "" -"This static method returns a translation table usable for :meth:`str." -"translate`." +"This static method returns a translation table usable " +"for :meth:`str.translate`." msgstr "" -"Este método estático retorna uma tabela de tradução usável para :meth:`str." -"translate`." +"Este método estático retorna uma tabela de tradução usável " +"para :meth:`str.translate`." -#: ../../library/stdtypes.rst:1974 +#: ../../builtins/stdtypes.rst:2265 msgid "" "If there is only one argument, it must be a dictionary mapping Unicode " "ordinals (integers) or characters (strings of length 1) to Unicode ordinals, " @@ -3259,19 +4071,20 @@ msgstr "" "Unicode, strings (de comprimento arbitrário) ou ``None``. Caracteres chave " "serão então convertidos para números ordinais." -#: ../../library/stdtypes.rst:1979 +#: ../../builtins/stdtypes.rst:2270 msgid "" "If there are two arguments, they must be strings of equal length, and in the " -"resulting dictionary, each character in x will be mapped to the character at " -"the same position in y. If there is a third argument, it must be a string, " -"whose characters will be mapped to ``None`` in the result." +"resulting dictionary, each character in *from* will be mapped to the " +"character at the same position in *to*. If there is a third argument, it " +"must be a string, whose characters will be mapped to ``None`` in the result." msgstr "" "Se existirem dois argumentos, eles devem ser strings de igual comprimento, e " -"no dicionário resultante, cada caractere em x será mapeado para o caractere " -"na mesma posição em y. Se existir um terceiro argumento, ele deve ser uma " -"string, cujos caracteres serão mapeados para ``None`` no resultado." +"no dicionário resultante, cada caractere em *from* será mapeado para o " +"caractere na mesma posição em *to*. Se existir um terceiro argumento, ele " +"deve ser uma string, cujos caracteres serão mapeados para ``None`` no " +"resultado." -#: ../../library/stdtypes.rst:1987 +#: ../../builtins/stdtypes.rst:2278 msgid "" "Split the string at the first occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself, and the part " @@ -3283,61 +4096,166 @@ msgstr "" "parte após o separador. Se o separador não for encontrado, retorna uma tupla " "com 3 elementos contendo a string, seguido de duas strings vazias." -#: ../../library/stdtypes.rst:1995 +#: ../../builtins/stdtypes.rst:2285 +msgid "" +">>> 'Monty Python'.partition(' ')\n" +"('Monty', ' ', 'Python')\n" +">>> \"Monty Python's Flying Circus\".partition(' ')\n" +"('Monty', ' ', \"Python's Flying Circus\")\n" +">>> 'Monty Python'.partition('-')\n" +"('Monty Python', '', '')" +msgstr "" +">>> 'Monty Python'.partition(' ')\n" +"('Monty', ' ', 'Python')\n" +">>> \"Monty Python's Flying Circus\".partition(' ')\n" +"('Monty', ' ', \"Python's Flying Circus\")\n" +">>> 'Monty Python'.partition('-')\n" +"('Monty Python', '', '')" + +#: ../../builtins/stdtypes.rst:2294 +msgid "See also :meth:`rpartition`." +msgstr "Veja também :meth:`rpartition`." + +#: ../../builtins/stdtypes.rst:2299 msgid "" "If the string starts with the *prefix* string, return " -"``string[len(prefix):]``. Otherwise, return a copy of the original string::" +"``string[len(prefix):]``. Otherwise, return a copy of the original string:" msgstr "" "Se a string começar com a string *prefix*, retorna ``string[len(prefix):]``. " -"Caso contrário, retorna uma cópia da string original::" +"Caso contrário, retorna uma cópia da string original:" -#: ../../library/stdtypes.rst:2009 +#: ../../builtins/stdtypes.rst:2303 +msgid "" +">>> 'TestHook'.removeprefix('Test')\n" +"'Hook'\n" +">>> 'BaseTestCase'.removeprefix('Test')\n" +"'BaseTestCase'" +msgstr "" +">>> 'TestHook'.removeprefix('Test')\n" +"'Hook'\n" +">>> 'BaseTestCase'.removeprefix('Test')\n" +"'BaseTestCase'" + +#: ../../builtins/stdtypes.rst:2312 +msgid "See also :meth:`removesuffix` and :meth:`startswith`." +msgstr "Veja também :meth:`removesuffix` e :meth:`startswith`." + +#: ../../builtins/stdtypes.rst:2317 msgid "" "If the string ends with the *suffix* string and that *suffix* is not empty, " "return ``string[:-len(suffix)]``. Otherwise, return a copy of the original " -"string::" +"string:" msgstr "" "Se a string terminar com a string *suffix* e a *suffix* não estiver vazia, " "retorna ``string[:-len(suffix)]``. Caso contrário, retorna uma cópia da " -"string original::" +"string original:" + +#: ../../builtins/stdtypes.rst:2321 +msgid "" +">>> 'MiscTests'.removesuffix('Tests')\n" +"'Misc'\n" +">>> 'TmpDirMixin'.removesuffix('Tests')\n" +"'TmpDirMixin'" +msgstr "" +">>> 'MiscTests'.removesuffix('Tests')\n" +"'Misc'\n" +">>> 'TmpDirMixin'.removesuffix('Tests')\n" +"'TmpDirMixin'" + +#: ../../builtins/stdtypes.rst:2330 +msgid "See also :meth:`removeprefix` and :meth:`endswith`." +msgstr "Veja também :meth:`removeprefix` e :meth:`endswith`." -#: ../../library/stdtypes.rst:2023 +#: ../../builtins/stdtypes.rst:2335 msgid "" "Return a copy of the string with all occurrences of substring *old* replaced " "by *new*. If *count* is given, only the first *count* occurrences are " "replaced. If *count* is not specified or ``-1``, then all occurrences are " -"replaced." +"replaced. For example:" msgstr "" "Retorna uma cópia da string com todas as ocorrências da substring *old* " "substituídas por *new*. Se o argumento opcional *count* é fornecido, apenas " "as primeiras *count* ocorrências são substituídas. Se *count* não é " "especificado ou é igual a ``-1``, então todas as ocorrências serão " -"substituídas." +"substituídas. Por exemplo:" -#: ../../library/stdtypes.rst:2027 +#: ../../builtins/stdtypes.rst:2340 +msgid "" +">>> 'spam, spam, spam'.replace('spam', 'eggs')\n" +"'eggs, eggs, eggs'\n" +">>> 'spam, spam, spam'.replace('spam', 'eggs', 1)\n" +"'eggs, spam, spam'" +msgstr "" +">>> 'spam, spam, spam'.replace('spam', 'eggs')\n" +"'eggs, eggs, eggs'\n" +">>> 'spam, spam, spam'.replace('spam', 'eggs', 1)\n" +"'eggs, spam, spam'" + +#: ../../builtins/stdtypes.rst:2347 msgid "*count* is now supported as a keyword argument." msgstr "*count* agora é suportado como um argumento nomeado." -#: ../../library/stdtypes.rst:2033 +#: ../../builtins/stdtypes.rst:2353 msgid "" "Return the highest index in the string where substring *sub* is found, such " "that *sub* is contained within ``s[start:end]``. Optional arguments *start* " -"and *end* are interpreted as in slice notation. Return ``-1`` on failure." +"and *end* are interpreted as in slice notation. Return ``-1`` on failure. " +"For example:" msgstr "" "Retorna o maior índice onde a substring *sub* foi encontrada dentro da " "string, onde *sub* está contida dentro do intervalo ``s[start:end]``. " "Argumentos opcionais *start* e *end* são interpretados usando a notação " -"slice. Retorna ``-1`` em caso de falha." +"slice. Retorna ``-1`` em caso de falha. Por exemplo:" + +#: ../../builtins/stdtypes.rst:2358 +msgid "" +">>> 'spam, spam, spam'.rfind('sp')\n" +"12\n" +">>> 'spam, spam, spam'.rfind('sp', 0, 10)\n" +"6" +msgstr "" +">>> 'spam, spam, spam'.rfind('sp')\n" +"12\n" +">>> 'spam, spam, spam'.rfind('sp', 0, 10)\n" +"6" + +#: ../../builtins/stdtypes.rst:2365 +msgid "See also :meth:`find` and :meth:`rindex`." +msgstr "Veja também :meth:`find` e :meth:`rindex`." -#: ../../library/stdtypes.rst:2040 +#: ../../builtins/stdtypes.rst:2370 msgid "" "Like :meth:`rfind` but raises :exc:`ValueError` when the substring *sub* is " -"not found." +"not found. For example:" +msgstr "" +"Semelhante a :meth:`rfind`, mas levanta :exc:`ValueError` quando a substring " +"*sub* não é encontrada. Por exemplo:" + +#: ../../builtins/stdtypes.rst:2374 +msgid "" +">>> 'spam, spam, spam'.rindex('spam')\n" +"12\n" +">>> 'spam, spam, spam'.rindex('eggs')\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" 'spam, spam, spam'.rindex('eggs')\n" +" ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^\n" +"ValueError: substring not found" msgstr "" -"Similar a :meth:`rfind` mas levanta um :exc:`ValueError` quando a substring " -"*sub* não é encontrada." +">>> 'spam, spam, spam'.rindex('spam')\n" +"12\n" +">>> 'spam, spam, spam'.rindex('eggs')\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" 'spam, spam, spam'.rindex('eggs')\n" +" ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^\n" +"ValueError: substring not found" + +#: ../../builtins/stdtypes.rst:2385 +msgid "See also :meth:`index` and :meth:`find`." +msgstr "Veja também :meth:`index` e :meth:`find`." -#: ../../library/stdtypes.rst:2046 +#: ../../builtins/stdtypes.rst:2390 msgid "" "Return the string right justified in a string of length *width*. Padding is " "done using the specified *fillchar* (default is an ASCII space). The " @@ -3348,7 +4266,27 @@ msgstr "" "um caractere de espaço ASCII). A string original é retornada se *width* é " "menor que ou igual a ``len(s)``." -#: ../../library/stdtypes.rst:2053 +#: ../../builtins/stdtypes.rst:2396 +msgid "" +">>> 'Python'.rjust(10)\n" +"' Python'\n" +">>> 'Python'.rjust(10, '.')\n" +"'....Python'\n" +">>> 'Monty Python'.rjust(10, '.')\n" +"'Monty Python'" +msgstr "" +">>> 'Python'.rjust(10)\n" +"' Python'\n" +">>> 'Python'.rjust(10, '.')\n" +"'....Python'\n" +">>> 'Monty Python'.rjust(10, '.')\n" +"'Monty Python'" + +#: ../../builtins/stdtypes.rst:2405 +msgid "See also :meth:`ljust` and :meth:`zfill`." +msgstr "Veja também :meth:`ljust` e :meth:`zfill`." + +#: ../../builtins/stdtypes.rst:2410 msgid "" "Split the string at the last occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself, and the part " @@ -3361,45 +4299,95 @@ msgstr "" "com 3 elementos contendo duas strings vazias, seguido da própria string " "original." -#: ../../library/stdtypes.rst:2061 +#: ../../builtins/stdtypes.rst:2417 +msgid "" +">>> 'Monty Python'.rpartition(' ')\n" +"('Monty', ' ', 'Python')\n" +">>> \"Monty Python's Flying Circus\".rpartition(' ')\n" +"(\"Monty Python's Flying\", ' ', 'Circus')\n" +">>> 'Monty Python'.rpartition('-')\n" +"('', '', 'Monty Python')" +msgstr "" +">>> 'Monty Python'.rpartition(' ')\n" +"('Monty', ' ', 'Python')\n" +">>> \"Monty Python's Flying Circus\".rpartition(' ')\n" +"(\"Monty Python's Flying\", ' ', 'Circus')\n" +">>> 'Monty Python'.rpartition('-')\n" +"('', '', 'Monty Python')" + +#: ../../builtins/stdtypes.rst:2426 +msgid "See also :meth:`partition`." +msgstr "Veja também :meth:`partition`." + +#: ../../builtins/stdtypes.rst:2431 msgid "" "Return a list of the words in the string, using *sep* as the delimiter " "string. If *maxsplit* is given, at most *maxsplit* splits are done, the " -"*rightmost* ones. If *sep* is not specified or ``None``, any whitespace " -"string is a separator. Except for splitting from the right, :meth:`rsplit` " -"behaves like :meth:`split` which is described in detail below." +"*rightmost* ones. If *sep* is not specified or ``None``, " +"any :meth:`whitespace ` string is a separator. Except for " +"splitting from the right, :meth:`rsplit` behaves like :meth:`split` which is " +"described in detail below." msgstr "" "Retorna uma lista de palavras na string, usando *sep* como a string " "delimitadora. Se *maxsplit* é fornecido, no máximo *maxsplit* cortes são " "feitos, sendo estes mais *à direita*. Se *sep* não foi especificado ou " -"``None`` foi informado, qualquer string de espaço em branco é um separador. " -"Exceto pelo fato de separar pela direita, :meth:`rsplit` se comporta como :" -"meth:`split`, o qual é descrito em detalhes abaixo." +"``None`` foi informado, qualquer string de :meth:`espaço em branco " +"` é um separador. Exceto pelo fato de separar pela " +"direita, :meth:`rsplit` se comporta como :meth:`split`, o qual é descrito em " +"detalhes abaixo." -#: ../../library/stdtypes.rst:2070 +#: ../../builtins/stdtypes.rst:2441 msgid "" "Return a copy of the string with trailing characters removed. The *chars* " "argument is a string specifying the set of characters to be removed. If " "omitted or ``None``, the *chars* argument defaults to removing whitespace. " "The *chars* argument is not a suffix; rather, all combinations of its values " -"are stripped::" +"are stripped. For example:" msgstr "" "Retorna uma cópia da string com caracteres no final removidos. O argumento " "*chars* é uma string que especifica o conjunto de caracteres para serem " "removidos. Se omitidos ou tiver o valor ``None``, o argumento *chars* " "considera como padrão a remoção dos espaços em branco. O argumento *chars* " "não é um sufixo; ao invés disso, todas as combinações dos seus valores são " -"removidos::" +"removidas. Por exemplo:" + +#: ../../builtins/stdtypes.rst:2447 +msgid "" +">>> ' spacious '.rstrip()\n" +"' spacious'\n" +">>> 'mississippi'.rstrip('ipz')\n" +"'mississ'" +msgstr "" +">>> ' spacious '.rstrip()\n" +"' spacious'\n" +">>> 'mississippi'.rstrip('ipz')\n" +"'mississ'" -#: ../../library/stdtypes.rst:2080 +#: ../../builtins/stdtypes.rst:2454 msgid "" -"See :meth:`str.removesuffix` for a method that will remove a single suffix " +"See :meth:`removesuffix` for a method that will remove a single suffix " "string rather than all of a set of characters. For example::" msgstr "" -"Consulte :meth:`str.removesuffix` para um método que removerá uma única " -"string de sufixo em vez de todo um conjunto de caracteres. Por exemplo::" +"Consulte :meth:`removesuffix` para um método que removerá uma única string " +"de sufixo em vez de todo um conjunto de caracteres. Por exemplo::" + +#: ../../builtins/stdtypes.rst:2457 +msgid "" +">>> 'Monty Python'.rstrip(' Python')\n" +"'M'\n" +">>> 'Monty Python'.removesuffix(' Python')\n" +"'Monty'" +msgstr "" +">>> 'Monty Python'.rstrip(' Python')\n" +"'M'\n" +">>> 'Monty Python'.removesuffix(' Python')\n" +"'Monty'" + +#: ../../builtins/stdtypes.rst:2462 +msgid "See also :meth:`strip`." +msgstr "Veja também :meth:`strip`." -#: ../../library/stdtypes.rst:2090 +#: ../../builtins/stdtypes.rst:2467 msgid "" "Return a list of the words in the string, using *sep* as the delimiter " "string. If *maxsplit* is given, at most *maxsplit* splits are done (thus, " @@ -3413,53 +4401,105 @@ msgstr "" "*maxsplit* não foi especificado ou ``-1`` foi informado, então não existe " "limite no número de cortes (todos os cortes possíveis são realizados)." -#: ../../library/stdtypes.rst:2096 +#: ../../builtins/stdtypes.rst:2473 msgid "" "If *sep* is given, consecutive delimiters are not grouped together and are " "deemed to delimit empty strings (for example, ``'1,,2'.split(',')`` returns " "``['1', '', '2']``). The *sep* argument may consist of multiple characters " -"as a single delimiter (to split with multiple delimiters, use :func:`re." -"split`). Splitting an empty string with a specified separator returns " -"``['']``." +"as a single delimiter (to split with multiple delimiters, " +"use :func:`re.split`). Splitting an empty string with a specified separator " +"returns ``['']``." msgstr "" "Se *sep* é fornecido, delimitadores consecutivos não são agrupados juntos e " -"eles são destinados para delimitar strings vazias (por exemplo, ``'1,,2'." -"split(',')`` retorna ``['1', '', '2']``). O argumento *sep* pode consistir " -"em vários caracteres como um único delimitador (para separar com vários " -"delimitadores, use :func:`re.split`). Separar uma string vazia com um " +"eles são destinados para delimitar strings vazias (por exemplo, " +"``'1,,2'.split(',')`` retorna ``['1', '', '2']``). O argumento *sep* pode " +"consistir em vários caracteres como um único delimitador (para separar com " +"vários delimitadores, use :func:`re.split`). Separar uma string vazia com um " "separador especificado retorna ``['']``." -#: ../../library/stdtypes.rst:2103 ../../library/stdtypes.rst:2121 -#: ../../library/stdtypes.rst:2173 ../../library/stdtypes.rst:2241 -#: ../../library/stdtypes.rst:2309 ../../library/stdtypes.rst:3161 -#: ../../library/stdtypes.rst:3179 ../../library/stdtypes.rst:3270 -#: ../../library/stdtypes.rst:3286 ../../library/stdtypes.rst:3311 -#: ../../library/stdtypes.rst:3325 ../../library/stdtypes.rst:3353 -#: ../../library/stdtypes.rst:3367 ../../library/stdtypes.rst:3385 -#: ../../library/stdtypes.rst:3412 ../../library/stdtypes.rst:3435 -#: ../../library/stdtypes.rst:3462 ../../library/stdtypes.rst:3504 -#: ../../library/stdtypes.rst:3528 -msgid "For example::" -msgstr "Por exemplo::" +#: ../../builtins/stdtypes.rst:2482 +msgid "" +">>> '1,2,3'.split(',')\n" +"['1', '2', '3']\n" +">>> '1,2,3'.split(',', maxsplit=1)\n" +"['1', '2,3']\n" +">>> '1,2,,3,'.split(',')\n" +"['1', '2', '', '3', '']\n" +">>> '1<>2<>3<4'.split('<>')\n" +"['1', '2', '3<4']" +msgstr "" +">>> '1,2,3'.split(',')\n" +"['1', '2', '3']\n" +">>> '1,2,3'.split(',', maxsplit=1)\n" +"['1', '2,3']\n" +">>> '1,2,,3,'.split(',')\n" +"['1', '2', '', '3', '']\n" +">>> '1<>2<>3<4'.split('<>')\n" +"['1', '2', '3<4']" -#: ../../library/stdtypes.rst:2114 +#: ../../builtins/stdtypes.rst:2493 msgid "" "If *sep* is not specified or is ``None``, a different splitting algorithm is " -"applied: runs of consecutive whitespace are regarded as a single separator, " -"and the result will contain no empty strings at the start or end if the " -"string has leading or trailing whitespace. Consequently, splitting an empty " -"string or a string consisting of just whitespace with a ``None`` separator " -"returns ``[]``." +"applied: runs of consecutive :meth:`whitespace ` are regarded " +"as a single separator, and the result will contain no empty strings at the " +"start or end if the string has leading or trailing whitespace. " +"Consequently, splitting an empty string or a string consisting of just " +"whitespace with a ``None`` separator returns ``[]``." msgstr "" "Se *sep* não for especificado ou for ``None``, um algoritmo diferente de " -"separação é aplicado: ocorrências consecutivas de espaços em branco são " -"consideradas como um separador único, e o resultado não conterá strings " -"vazias no início ou no final, se a string tiver espaços em branco no início " -"ou no final. Consequentemente, separar uma string vazia ou uma string que " -"consiste apenas de espaços em branco com o separador ``None``, retorna " -"``[]``." - -#: ../../library/stdtypes.rst:2136 +"separação é aplicado: ocorrências consecutivas de :meth:`espaços em branco " +"` são consideradas como um separador único, e o resultado não " +"conterá strings vazias no início ou no final, se a string tiver espaços em " +"branco no início ou no final. Consequentemente, separar uma string vazia ou " +"uma string que consiste apenas de espaços em branco com o separador " +"``None``, retorna ``[]``." + +#: ../../builtins/stdtypes.rst:2503 +msgid "" +">>> '1 2 3'.split()\n" +"['1', '2', '3']\n" +">>> '1 2 3'.split(maxsplit=1)\n" +"['1', '2 3']\n" +">>> ' 1 2 3 '.split()\n" +"['1', '2', '3']" +msgstr "" +">>> '1 2 3'.split()\n" +"['1', '2', '3']\n" +">>> '1 2 3'.split(maxsplit=1)\n" +"['1', '2 3']\n" +">>> ' 1 2 3 '.split()\n" +"['1', '2', '3']" + +#: ../../builtins/stdtypes.rst:2512 +msgid "" +"If *sep* is not specified or is ``None`` and *maxsplit* is ``0``, only " +"leading runs of consecutive whitespace are considered." +msgstr "" +"Se *sep* não for especificado ou for ``None`` e *maxsplit* for ``0``, " +"somente as sequências iniciais de espaços em branco consecutivos serão " +"consideradas." + +#: ../../builtins/stdtypes.rst:2517 +msgid "" +">>> \"\".split(None, 0)\n" +"[]\n" +">>> \" \".split(None, 0)\n" +"[]\n" +">>> \" foo \".split(maxsplit=0)\n" +"['foo ']" +msgstr "" +">>> \"\".split(None, 0)\n" +"[]\n" +">>> \" \".split(None, 0)\n" +"[]\n" +">>> \" foo \".split(maxsplit=0)\n" +"['foo ']" + +#: ../../builtins/stdtypes.rst:2526 +msgid "See also :meth:`join` and :meth:`rsplit`." +msgstr "Veja também :meth:`join` e :meth:`rsplit`." + +#: ../../builtins/stdtypes.rst:2534 msgid "" "Return a list of the lines in the string, breaking at line boundaries. Line " "breaks are not included in the resulting list unless *keepends* is given and " @@ -3469,7 +4509,7 @@ msgstr "" "cada linha. Quebras de linhas não são incluídas na lista resultante a não " "ser que *keepends* seja fornecido e seja verdadeiro." -#: ../../library/stdtypes.rst:2140 +#: ../../builtins/stdtypes.rst:2538 msgid "" "This method splits on the following line boundaries. In particular, the " "boundaries are a superset of :term:`universal newlines`." @@ -3478,107 +4518,130 @@ msgstr "" "limites são um superconjunto de :term:`novas linhas universais `." -#: ../../library/stdtypes.rst:2144 +#: ../../builtins/stdtypes.rst:2542 msgid "Representation" msgstr "Representação" -#: ../../library/stdtypes.rst:2144 +#: ../../builtins/stdtypes.rst:2542 msgid "Description" msgstr "Descrição" -#: ../../library/stdtypes.rst:2146 +#: ../../builtins/stdtypes.rst:2544 msgid "``\\n``" msgstr "``\\n``" -#: ../../library/stdtypes.rst:2146 +#: ../../builtins/stdtypes.rst:2544 msgid "Line Feed" msgstr "Feed de linha" -#: ../../library/stdtypes.rst:2148 +#: ../../builtins/stdtypes.rst:2546 msgid "``\\r``" msgstr "``\\r``" -#: ../../library/stdtypes.rst:2148 +#: ../../builtins/stdtypes.rst:2546 msgid "Carriage Return" msgstr "Retorno de Carro" -#: ../../library/stdtypes.rst:2150 +#: ../../builtins/stdtypes.rst:2548 msgid "``\\r\\n``" msgstr "``\\r\\n``" -#: ../../library/stdtypes.rst:2150 +#: ../../builtins/stdtypes.rst:2548 msgid "Carriage Return + Line Feed" msgstr "Retorno do Carro + Feed da Linha" -#: ../../library/stdtypes.rst:2152 +#: ../../builtins/stdtypes.rst:2550 msgid "``\\v`` or ``\\x0b``" msgstr "``\\v`` ou ``\\x0b``" -#: ../../library/stdtypes.rst:2152 +#: ../../builtins/stdtypes.rst:2550 msgid "Line Tabulation" msgstr "Tabulação de Linha" -#: ../../library/stdtypes.rst:2154 +#: ../../builtins/stdtypes.rst:2552 msgid "``\\f`` or ``\\x0c``" msgstr "``\\f`` ou ``\\x0c``" -#: ../../library/stdtypes.rst:2154 +#: ../../builtins/stdtypes.rst:2552 msgid "Form Feed" msgstr "Formulário de Feed" -#: ../../library/stdtypes.rst:2156 +#: ../../builtins/stdtypes.rst:2554 msgid "``\\x1c``" msgstr "``\\x1c``" -#: ../../library/stdtypes.rst:2156 +#: ../../builtins/stdtypes.rst:2554 msgid "File Separator" msgstr "Separador de Arquivos" -#: ../../library/stdtypes.rst:2158 +#: ../../builtins/stdtypes.rst:2556 msgid "``\\x1d``" msgstr "``\\x1d``" -#: ../../library/stdtypes.rst:2158 +#: ../../builtins/stdtypes.rst:2556 msgid "Group Separator" msgstr "Separador de Grupo" -#: ../../library/stdtypes.rst:2160 +#: ../../builtins/stdtypes.rst:2558 msgid "``\\x1e``" msgstr "``\\x1e``" -#: ../../library/stdtypes.rst:2160 +#: ../../builtins/stdtypes.rst:2558 msgid "Record Separator" msgstr "Separador de Registro" -#: ../../library/stdtypes.rst:2162 +#: ../../builtins/stdtypes.rst:2560 msgid "``\\x85``" msgstr "``\\x85``" -#: ../../library/stdtypes.rst:2162 +#: ../../builtins/stdtypes.rst:2560 msgid "Next Line (C1 Control Code)" msgstr "Próxima Linha (C1 Control Code)" -#: ../../library/stdtypes.rst:2164 +#: ../../builtins/stdtypes.rst:2562 msgid "``\\u2028``" msgstr "``\\u2028``" -#: ../../library/stdtypes.rst:2164 +#: ../../builtins/stdtypes.rst:2562 msgid "Line Separator" msgstr "Separador de Linha" -#: ../../library/stdtypes.rst:2166 +#: ../../builtins/stdtypes.rst:2564 msgid "``\\u2029``" msgstr "``\\u2029``" -#: ../../library/stdtypes.rst:2166 +#: ../../builtins/stdtypes.rst:2564 msgid "Paragraph Separator" msgstr "Separador de Parágrafo" -#: ../../library/stdtypes.rst:2171 +#: ../../builtins/stdtypes.rst:2569 msgid "``\\v`` and ``\\f`` added to list of line boundaries." msgstr "``\\v`` e ``\\f`` adicionado à lista de limites de linha." -#: ../../library/stdtypes.rst:2180 +#: ../../builtins/stdtypes.rst:2571 ../../builtins/stdtypes.rst:2677 +#: ../../builtins/stdtypes.rst:3752 ../../builtins/stdtypes.rst:3771 +#: ../../builtins/stdtypes.rst:3862 ../../builtins/stdtypes.rst:3878 +#: ../../builtins/stdtypes.rst:3903 ../../builtins/stdtypes.rst:3917 +#: ../../builtins/stdtypes.rst:3945 ../../builtins/stdtypes.rst:3959 +#: ../../builtins/stdtypes.rst:3977 ../../builtins/stdtypes.rst:4004 +#: ../../builtins/stdtypes.rst:4027 ../../builtins/stdtypes.rst:4054 +#: ../../builtins/stdtypes.rst:4096 ../../builtins/stdtypes.rst:4120 +msgid "For example::" +msgstr "Por exemplo::" + +#: ../../builtins/stdtypes.rst:2573 +msgid "" +">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" +"['ab c', '', 'de fg', 'kl']\n" +">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" +"['ab c\\n', '\\n', 'de fg\\r', 'kl\\r\\n']" +msgstr "" +">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" +"['ab c', '', 'de fg', 'kl']\n" +">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" +"['ab c\\n', '\\n', 'de fg\\r', 'kl\\r\\n']" + +#: ../../builtins/stdtypes.rst:2578 msgid "" "Unlike :meth:`~str.split` when a delimiter string *sep* is given, this " "method returns an empty list for the empty string, and a terminal line break " @@ -3588,11 +4651,35 @@ msgstr "" "*sep* é fornecido, este método retorna uma lista vazia para a uma String " "vazia e uma quebra de linha de terminal não resulta numa linha extra::" -#: ../../library/stdtypes.rst:2189 +#: ../../builtins/stdtypes.rst:2582 +msgid "" +">>> \"\".splitlines()\n" +"[]\n" +">>> \"One line\\n\".splitlines()\n" +"['One line']" +msgstr "" +">>> \"\".splitlines()\n" +"[]\n" +">>> \"Uma linha\\n\".splitlines()\n" +"['Uma linha']" + +#: ../../builtins/stdtypes.rst:2587 msgid "For comparison, ``split('\\n')`` gives::" msgstr "Para comparação, temos ``split('\\n')``::" -#: ../../library/stdtypes.rst:2199 +#: ../../builtins/stdtypes.rst:2589 +msgid "" +">>> ''.split('\\n')\n" +"['']\n" +">>> 'Two lines\\n'.split('\\n')\n" +"['Two lines', '']" +msgstr "" +">>> ''.split('\\n')\n" +"['']\n" +">>> 'Duas linhas\\n'.split('\\n')\n" +"['Duas linhas', '']" + +#: ../../builtins/stdtypes.rst:2597 msgid "" "Return ``True`` if string starts with the *prefix*, otherwise return " "``False``. *prefix* can also be a tuple of prefixes to look for. With " @@ -3604,44 +4691,120 @@ msgstr "" "procurados. Com *start* opcional, a String de teste começa nessa posição. " "Com *fim* opcional, interrompe a comparação de String nessa posição." -#: ../../library/stdtypes.rst:2207 +#: ../../builtins/stdtypes.rst:2604 +msgid "" +">>> 'Python'.startswith('Py')\n" +"True\n" +">>> 'a tuple of prefixes'.startswith(('at', 'a'))\n" +"True\n" +">>> 'Python is amazing'.startswith('is', 7)\n" +"True" +msgstr "" +">>> 'Python'.startswith('Py')\n" +"True\n" +">>> 'uma tupla de prefixos'.startswith(('em', 'uma'))\n" +"True\n" +">>> 'Python é fantástico'.startswith('é', 7)\n" +"True" + +#: ../../builtins/stdtypes.rst:2613 +msgid "See also :meth:`endswith` and :meth:`removeprefix`." +msgstr "Veja também :meth:`endswith` e :meth:`removeprefix`." + +#: ../../builtins/stdtypes.rst:2618 msgid "" "Return a copy of the string with the leading and trailing characters " "removed. The *chars* argument is a string specifying the set of characters " "to be removed. If omitted or ``None``, the *chars* argument defaults to " "removing whitespace. The *chars* argument is not a prefix or suffix; rather, " -"all combinations of its values are stripped::" +"all combinations of its values are stripped." msgstr "" "Retorna uma cópia da string com caracteres no início e no final removidos. O " "argumento *chars* é uma string que especifica o conjunto de caracteres a " "serem removidos. Se for omitido ou for ``None``, o argumento *chars* irá " "remover por padrão os caracteres em branco. O argumento *chars* não é um " "prefixo, nem um sufixo; ao contrário disso, todas as combinações dos seus " -"seus valores são removidas::" +"seus valores são removidas" -#: ../../library/stdtypes.rst:2218 +#: ../../builtins/stdtypes.rst:2624 +msgid "Whitespace characters are defined by :meth:`str.isspace`." +msgstr "Caracteres de espaço em branco são definidos por :meth:`str.isspace`." + +#: ../../builtins/stdtypes.rst:2628 +msgid "" +">>> ' spacious '.strip()\n" +"'spacious'\n" +">>> 'www.example.com'.strip('cmowz.')\n" +"'example'" +msgstr "" +">>> ' spacious '.strip()\n" +"'spacious'\n" +">>> 'www.example.com'.strip('cmowz.')\n" +"'example'" + +#: ../../builtins/stdtypes.rst:2635 msgid "" "The outermost leading and trailing *chars* argument values are stripped from " "the string. Characters are removed from the leading end until reaching a " "string character that is not contained in the set of characters in *chars*. " -"A similar action takes place on the trailing end. For example::" +"A similar action takes place on the trailing end." msgstr "" "Os valores do argumento *chars* são removidos dos extremos inicial e final " "da string. Caracteres são removidos do extremo inicial até atingir um " "caractere da string que não está contido no conjunto de caracteres em " -"*chars*. Uma ação similar acontece no extremo final da string. Por exemplo::" +"*chars*. Uma ação similar acontece no extremo final da string." + +#: ../../builtins/stdtypes.rst:2642 +msgid "" +">>> comment_string = '#....... Section 3.2.1 Issue #32 .......'\n" +">>> comment_string.strip('.#! ')\n" +"'Section 3.2.1 Issue #32'" +msgstr "" +">>> comment_string = '#....... Section 3.2.1 Issue #32 .......'\n" +">>> comment_string.strip('.#! ')\n" +"'Section 3.2.1 Issue #32'" + +#: ../../builtins/stdtypes.rst:2648 +msgid "See also :meth:`rstrip`." +msgstr "Veja também :meth:`rstrip`." -#: ../../library/stdtypes.rst:2231 +#: ../../builtins/stdtypes.rst:2653 msgid "" "Return a copy of the string with uppercase characters converted to lowercase " -"and vice versa. Note that it is not necessarily true that ``s.swapcase()." -"swapcase() == s``." +"and vice versa. For example:" msgstr "" "Retorna uma cópia da string com caracteres maiúsculos convertidos para " -"minúsculos e vice-versa. Perceba que não é necessariamente verdade que ``s." -"swapcase().swapcase() == s``." +"letras minúsculas, e vice-versa. Por exemplo:" + +#: ../../builtins/stdtypes.rst:2656 +msgid "" +">>> 'Hello World'.swapcase()\n" +"'hELLO wORLD'" +msgstr "" +">>> 'Olá Mundo'.swapcase()\n" +"'oLÁ mUNDO'" + +#: ../../builtins/stdtypes.rst:2661 +msgid "" +"Note that it is not necessarily true that ``s.swapcase().swapcase() == s``. " +"For example:" +msgstr "" +"Observe que não é necessariamente verdade que ``s.swapcase().swapcase() == " +"s``. Por exemplo:" -#: ../../library/stdtypes.rst:2238 +#: ../../builtins/stdtypes.rst:2664 +msgid "" +">>> 'straße'.swapcase().swapcase()\n" +"'strasse'" +msgstr "" +">>> 'straße'.swapcase().swapcase()\n" +"'strasse'" + +#: ../../builtins/stdtypes.rst:2669 +msgid "See also :meth:`str.lower` and :meth:`str.upper`." +msgstr "Veja também :meth:`str.lower` e :meth:`str.upper`." + +#: ../../builtins/stdtypes.rst:2674 msgid "" "Return a titlecased version of the string where words start with an " "uppercase character and the remaining characters are lowercase." @@ -3650,7 +4813,15 @@ msgstr "" "caractere com letra maiúscula e os caracteres restantes são em letras " "minúsculas." -#: ../../library/stdtypes.rst:2246 ../../library/stdtypes.rst:3472 +#: ../../builtins/stdtypes.rst:2679 +msgid "" +">>> 'Hello world'.title()\n" +"'Hello World'" +msgstr "" +">>> 'Olá mundo'.title()\n" +"'Olá mundo'" + +#: ../../builtins/stdtypes.rst:2682 ../../builtins/stdtypes.rst:4064 msgid "" "The algorithm uses a simple language-independent definition of a word as " "groups of consecutive letters. The definition works in many contexts but it " @@ -3659,10 +4830,18 @@ msgid "" msgstr "" "O algoritmo usa uma definição simples independente de idioma para uma " "palavra, como grupos de letras consecutivas. A definição funciona em muitos " -"contextos, mas isso significa que apóstrofes em contradições e possessivos " +"contextos, mas isso significa que apóstrofes em contrações e possessivos " "formam limites de palavras, os quais podem não ser o resultado desejado::" -#: ../../library/stdtypes.rst:2254 +#: ../../builtins/stdtypes.rst:2687 +msgid "" +">>> \"they're bill's friends from the UK\".title()\n" +"\"They'Re Bill'S Friends From The Uk\"" +msgstr "" +">>> \"a caixa d'água do joe's bar está vazia\".title()\n" +"\"A Caixa D'Água Do Joe'S Bar Está Vazia\"" + +#: ../../builtins/stdtypes.rst:2690 msgid "" "The :func:`string.capwords` function does not have this problem, as it " "splits words on spaces only." @@ -3670,7 +4849,7 @@ msgstr "" "A função :func:`string.capwords` não tem esse problema, pois ela divide " "palavras apenas em espaços." -#: ../../library/stdtypes.rst:2257 +#: ../../builtins/stdtypes.rst:2693 msgid "" "Alternatively, a workaround for apostrophes can be constructed using regular " "expressions::" @@ -3678,28 +4857,52 @@ msgstr "" "Alternativamente, uma solução alternativa para os apóstrofes pode ser " "construída usando expressões regulares::" -#: ../../library/stdtypes.rst:2272 +#: ../../builtins/stdtypes.rst:2696 +msgid "" +">>> import re\n" +">>> def titlecase(s):\n" +"... return re.sub(r\"[A-Za-z]+('[A-Za-z]+)?\",\n" +"... lambda mo: mo.group(0).capitalize(),\n" +"... s)\n" +"...\n" +">>> titlecase(\"they're bill's friends.\")\n" +"\"They're Bill's Friends.\"" +msgstr "" +">>> import re\n" +">>> def titlecase(s):\n" +"... return re.sub(r\"[A-Za-z]+('[A-Za-z]+)?\",\n" +"... lambda mo: mo.group(0).capitalize(),\n" +"... s)\n" +"...\n" +">>> titlecase(\"o joe's bar está aberto\")\n" +"\"O Joe's Bar Está Aberto\"" + +#: ../../builtins/stdtypes.rst:2705 +msgid "See also :meth:`istitle`." +msgstr "Veja também :meth:`istitle`." + +#: ../../builtins/stdtypes.rst:2710 msgid "" "Return a copy of the string in which each character has been mapped through " "the given translation table. The table must be an object that implements " -"indexing via :meth:`~object.__getitem__`, typically a :term:`mapping` or :" -"term:`sequence`. When indexed by a Unicode ordinal (an integer), the table " -"object can do any of the following: return a Unicode ordinal or a string, to " -"map the character to one or more other characters; return ``None``, to " -"delete the character from the return string; or raise a :exc:`LookupError` " -"exception, to map the character to itself." +"indexing via :meth:`~object.__getitem__`, typically a :term:`mapping` " +"or :term:`sequence`. When indexed by a Unicode ordinal (an integer), the " +"table object can do any of the following: return a Unicode ordinal or a " +"string, to map the character to one or more other characters; return " +"``None``, to delete the character from the return string; or raise " +"a :exc:`LookupError` exception, to map the character to itself." msgstr "" "Retorna uma cópia da string na qual cada caractere foi mapeado através da " "tabela de tradução fornecida. A tabela deve ser um objeto que implementa " -"indexação através de :meth:`~object.__getitem__`, tipicamente um :term:" -"`mapeamento ` ou uma :term:`sequência `. Quando indexada " -"por um ordinal unicode (um inteiro), o objeto tabela pode fazer qualquer uma " -"das seguintes ações: retornar um ordinal unicode ou uma string, para mapear " -"o caractere para um ou mais caracteres; retornar ``None``, para deletar o " -"caractere da string de retorno; ou levantar uma exceção :exc:`LookupError`, " -"para mapear o caractere para si mesmo." +"indexação através de :meth:`~object.__getitem__`, tipicamente " +"um :term:`mapeamento ` ou uma :term:`sequência `. Quando " +"indexada por um ordinal unicode (um inteiro), o objeto tabela pode fazer " +"qualquer uma das seguintes ações: retornar um ordinal unicode ou uma string, " +"para mapear o caractere para um ou mais caracteres; retornar ``None``, para " +"deletar o caractere da string de retorno; ou levantar uma " +"exceção :exc:`LookupError`, para mapear o caractere para si mesmo." -#: ../../library/stdtypes.rst:2281 +#: ../../builtins/stdtypes.rst:2719 msgid "" "You can use :meth:`str.maketrans` to create a translation map from character-" "to-character mappings in different formats." @@ -3707,7 +4910,7 @@ msgstr "" "Você pode usar :meth:`str.maketrans` para criar um mapa de tradução com " "mapeamentos caractere para caractere em diferentes formatos." -#: ../../library/stdtypes.rst:2284 +#: ../../builtins/stdtypes.rst:2722 msgid "" "See also the :mod:`codecs` module for a more flexible approach to custom " "character mappings." @@ -3715,7 +4918,7 @@ msgstr "" "Veja também o módulo :mod:`codecs` para uma abordagem mais flexível para " "mapeamento de caractere customizado." -#: ../../library/stdtypes.rst:2290 +#: ../../builtins/stdtypes.rst:2728 msgid "" "Return a copy of the string with all the cased characters [4]_ converted to " "uppercase. Note that ``s.upper().isupper()`` might be ``False`` if ``s`` " @@ -3724,13 +4927,13 @@ msgid "" "titlecase)." msgstr "" "Retorna uma cópia da string com todos os caracteres que permitem maiúsculo e " -"minúsculo [4]_ convertidos para letras maiúsculas. Perceba que ``s.upper()." -"isupper()`` pode ser ``False`` se ``s`` contiver caracteres que não possuem " -"maiúsculas e minúsculas, ou se a categoria Unicode do(s) caractere(s) " -"resultante(s) não for \"Lu\" (Letra maiúscula), mas por ex \"Lt\" (Letra em " -"titlecase)." +"minúsculo [4]_ convertidos para letras maiúsculas. Perceba que " +"``s.upper().isupper()`` pode ser ``False`` se ``s`` contiver caracteres que " +"não possuem maiúsculas e minúsculas, ou se a categoria Unicode do(s) " +"caractere(s) resultante(s) não for \"Lu\" (Letra maiúscula), mas por ex " +"\"Lt\" (Letra em titlecase)." -#: ../../library/stdtypes.rst:2296 +#: ../../builtins/stdtypes.rst:2734 msgid "" "The uppercasing algorithm used is `described in section 3.13 'Default Case " "Folding' of the Unicode Standard `__." -#: ../../library/stdtypes.rst:2303 +#: ../../builtins/stdtypes.rst:2741 msgid "" "Return a copy of the string left filled with ASCII ``'0'`` digits to make a " "string of length *width*. A leading sign prefix (``'+'``/``'-'``) is handled " @@ -3753,11 +4956,275 @@ msgstr "" "caractere de sinal em vez de antes. A String original será retornada se o " "*width* for menor ou igual a ``len(s)``." -#: ../../library/stdtypes.rst:2321 +#: ../../builtins/stdtypes.rst:2749 +msgid "" +">>> \"42\".zfill(5)\n" +"'00042'\n" +">>> \"-42\".zfill(5)\n" +"'-0042'" +msgstr "" +">>> \"42\".zfill(5)\n" +"'00042'\n" +">>> \"-42\".zfill(5)\n" +"'-0042'" + +#: ../../builtins/stdtypes.rst:2774 +msgid "Formatted String Literals (f-strings)" +msgstr "Strings literais formatadas (f-strings)" + +#: ../../builtins/stdtypes.rst:2777 +msgid "" +"The :keyword:`await` and :keyword:`async for` can be used in expressions " +"within f-strings." +msgstr "" +":keyword:`await` e :keyword:`async for` podem ser usados em expressões " +"dentro de f-strings." + +#: ../../builtins/stdtypes.rst:2780 +msgid "Added the debugging operator (``=``)" +msgstr "Adicionado o operador de depuração (``=``)" + +#: ../../builtins/stdtypes.rst:2782 +msgid "" +"Many restrictions on expressions within f-strings have been removed. " +"Notably, nested strings, comments, and backslashes are now permitted." +msgstr "" +"Muitas restrições a expressões dentro de f-strings foram removidas. " +"Notavelmente, strings aninhadas, comentários e contrabarras agora são " +"permitidos." + +#: ../../builtins/stdtypes.rst:2786 +msgid "" +"An :dfn:`f-string` (formally a :dfn:`formatted string literal`) is a string " +"literal that is prefixed with ``f`` or ``F``. This type of string literal " +"allows embedding arbitrary Python expressions within *replacement fields*, " +"which are delimited by curly brackets (``{}``). These expressions are " +"evaluated at runtime, similarly to :meth:`str.format`, and are converted " +"into regular :class:`str` objects. For example:" +msgstr "" +"Uma :dfn:`f-string` (formalmente uma :dfn:`literal de string formatada`) é " +"uma literal de string prefixada com ``f`` ou ``F``. Esse tipo de literal de " +"string permite incorporar expressões Python arbitrárias dentro de *campos de " +"substituição*, delimitados por chaves (``{}``). Essas expressões são " +"avaliadas em tempo de execução, de forma semelhante a :meth:`str.format`, e " +"convertidas em objetos :class:`str` regulares. Por exemplo:" + +#: ../../builtins/stdtypes.rst:2794 +msgid "" +">>> who = 'nobody'\n" +">>> nationality = 'Spanish'\n" +">>> f'{who.title()} expects the {nationality} Inquisition!'\n" +"'Nobody expects the Spanish Inquisition!'" +msgstr "" +">>> who = 'Ninguém'\n" +">>> nationality = 'Espanhola'\n" +">>> f'{who.title()} está à espera da Inquisição {nationality}!'\n" +"'Ninguém está à espera da Inquisição Espanhola!'" + +#: ../../builtins/stdtypes.rst:2801 +msgid "It is also possible to use a multi line f-string:" +msgstr "Também é possível usar uma f-string de várias linhas:" + +#: ../../builtins/stdtypes.rst:2803 +msgid "" +">>> f'''This is a string\n" +"... on two lines'''\n" +"'This is a string\\non two lines'" +msgstr "" +">>> f'''Esta é uma string\n" +"... em duas linhas'''\n" +"'Esta é uma string\\nem duas linhas'" + +#: ../../builtins/stdtypes.rst:2809 +msgid "" +"A single opening curly bracket, ``'{'``, marks a *replacement field* that " +"can contain any Python expression:" +msgstr "" +"Uma única chave de abertura, ``'{'``, marca um *campo de substituição* que " +"pode conter qualquer expressão Python:" + +#: ../../builtins/stdtypes.rst:2812 +msgid "" +">>> nationality = 'Spanish'\n" +">>> f'The {nationality} Inquisition!'\n" +"'The Spanish Inquisition!'" +msgstr "" +">>> nationality = 'Espanhola'\n" +">>> f'A Inquisição {nationality}!'\n" +"'A Inquisição Espanhola!'" + +#: ../../builtins/stdtypes.rst:2818 +msgid "To include a literal ``{`` or ``}``, use a double bracket:" +msgstr "Para incluir um literal ``{`` ou ``}``, use chaves duplas:" + +#: ../../builtins/stdtypes.rst:2820 +msgid "" +">>> x = 42\n" +">>> f'{{x}} is {x}'\n" +"'{x} is 42'" +msgstr "" +">>> x = 42\n" +">>> f'{{x}} is {x}'\n" +"'{x} is 42'" + +#: ../../builtins/stdtypes.rst:2826 +msgid "" +"Functions can also be used, and :ref:`format specifiers `:" +msgstr "" +"Funções também podem ser usadas, como :ref:`especificadores de formato " +"`:" + +#: ../../builtins/stdtypes.rst:2828 +msgid "" +">>> from math import sqrt\n" +">>> f'√2 \\N{ALMOST EQUAL TO} {sqrt(2):.5f}'\n" +"'√2 ≈ 1.41421'" +msgstr "" +">>> from math import sqrt\n" +">>> f'√2 \\N{ALMOST EQUAL TO} {sqrt(2):.5f}'\n" +"'√2 ≈ 1.41421'" + +#: ../../builtins/stdtypes.rst:2834 +msgid "Any non-string expression is converted using :func:`str`, by default:" +msgstr "" +"Qualquer expressão que não seja string é convertida usando :func:`str`, por " +"padrão:" + +#: ../../builtins/stdtypes.rst:2836 +msgid "" +">>> from fractions import Fraction\n" +">>> f'{Fraction(1, 3)}'\n" +"'1/3'" +msgstr "" +">>> from fractions import Fraction\n" +">>> f'{Fraction(1, 3)}'\n" +"'1/3'" + +#: ../../builtins/stdtypes.rst:2842 +msgid "" +"To use an explicit conversion, use the ``!`` (exclamation mark) operator, " +"followed by any of the valid formats, which are:" +msgstr "" +"Para usar uma conversão explícita, use o operador ``!`` (ponto de " +"exclamação), seguido por qualquer um dos formatos válidos, que são:" + +#: ../../builtins/stdtypes.rst:2846 ../../builtins/stdtypes.rst:3014 +#: ../../builtins/stdtypes.rst:4243 +msgid "Conversion" +msgstr "Conversão" + +#: ../../builtins/stdtypes.rst:2848 +msgid "``!a``" +msgstr "``!a``" + +#: ../../builtins/stdtypes.rst:2848 +msgid ":func:`ascii`" +msgstr ":func:`ascii`" + +#: ../../builtins/stdtypes.rst:2849 +msgid "``!r``" +msgstr "``!r``" + +#: ../../builtins/stdtypes.rst:2849 +msgid ":func:`repr`" +msgstr ":func:`repr`" + +#: ../../builtins/stdtypes.rst:2850 +msgid "``!s``" +msgstr "``!s``" + +#: ../../builtins/stdtypes.rst:2850 +msgid ":func:`str`" +msgstr ":func:`str`" + +#: ../../builtins/stdtypes.rst:2855 +msgid "" +">>> from fractions import Fraction\n" +">>> f'{Fraction(1, 3)!s}'\n" +"'1/3'\n" +">>> f'{Fraction(1, 3)!r}'\n" +"'Fraction(1, 3)'\n" +">>> question = '¿Dónde está el Presidente?'\n" +">>> print(f'{question!a}')\n" +"'\\xbfD\\xf3nde est\\xe1 el Presidente?'" +msgstr "" +">>> from fractions import Fraction\n" +">>> f'{Fraction(1, 3)!s}'\n" +"'1/3'\n" +">>> f'{Fraction(1, 3)!r}'\n" +"'Fraction(1, 3)'\n" +">>> question = '¿Dónde está el Presidente?'\n" +">>> print(f'{question!a}')\n" +"'\\xbfD\\xf3nde est\\xe1 el Presidente?'" + +#: ../../builtins/stdtypes.rst:2866 +msgid "" +"While debugging it may be helpful to see both the expression and its value, " +"by using the equals sign (``=``) after the expression. This preserves spaces " +"within the brackets, and can be used with a converter. By default, the " +"debugging operator uses the :func:`repr` (``!r``) conversion. For example:" +msgstr "" +"Durante a depuração, pode ser útil visualizar tanto a expressão quanto seu " +"valor, usando o sinal de igual (``=``) após a expressão. Isso preserva os " +"espaços entre chaves e pode ser usado com um conversor. Por padrão, o " +"operador de depuração usa a conversão :func:`repr` (``!r``). Por exemplo:" + +#: ../../builtins/stdtypes.rst:2872 +msgid "" +">>> from fractions import Fraction\n" +">>> calculation = Fraction(1, 3)\n" +">>> f'{calculation=}'\n" +"'calculation=Fraction(1, 3)'\n" +">>> f'{calculation = }'\n" +"'calculation = Fraction(1, 3)'\n" +">>> f'{calculation = !s}'\n" +"'calculation = 1/3'" +msgstr "" +">>> from fractions import Fraction\n" +">>> calculation = Fraction(1, 3)\n" +">>> f'{calculation=}'\n" +"'calculation=Fraction(1, 3)'\n" +">>> f'{calculation = }'\n" +"'calculation = Fraction(1, 3)'\n" +">>> f'{calculation = !s}'\n" +"'calculation = 1/3'" + +#: ../../builtins/stdtypes.rst:2883 +msgid "" +"Once the output has been evaluated, it can be formatted using a :ref:`format " +"specifier ` following a colon (``':'``). After the expression " +"has been evaluated, and possibly converted to a string, the :meth:`!" +"__format__` method of the result is called with the format specifier, or the " +"empty string if no format specifier is given. The formatted result is then " +"used as the final value for the replacement field. For example:" +msgstr "" +"Após a avaliação da saída, ela pode ser formatada usando " +"um :ref:`especificador de formato ` seguido de dois pontos " +"(``':'``). Após a avaliação da expressão e sua possível conversão para uma " +"string, o método :meth:`!__format__` do resultado é chamado com o " +"especificador de formato, ou a string vazia, caso nenhum especificador de " +"formato seja fornecido. O resultado formatado é então usado como o valor " +"final para o campo de substituição. Por exemplo:" + +#: ../../builtins/stdtypes.rst:2891 +msgid "" +">>> from fractions import Fraction\n" +">>> f'{Fraction(1, 7):.6f}'\n" +"'0.142857'\n" +">>> f'{Fraction(1, 7):_^+10}'\n" +"'___+1/7___'" +msgstr "" +">>> from fractions import Fraction\n" +">>> f'{Fraction(1, 7):.6f}'\n" +"'0.142857'\n" +">>> f'{Fraction(1, 7):_^+10}'\n" +"'___+1/7___'" + +#: ../../builtins/stdtypes.rst:2903 msgid "``printf``-style String Formatting" -msgstr "Formatação de String no Formato no estilo ``printf``" +msgstr "Formatação de string no estilo ``printf``" -#: ../../library/stdtypes.rst:2334 +#: ../../builtins/stdtypes.rst:2916 msgid "" "The formatting operations described here exhibit a variety of quirks that " "lead to a number of common errors (such as failing to display tuples and " @@ -3770,12 +5237,12 @@ msgstr "" "As operações de formatação descritas aqui exibem uma variedade de " "peculiaridades que levam a diversos erros comuns (tais como não conseguir " "exibir tuplas e dicionários corretamente). Usar o novo :ref:`formatador de " -"string literal (f-strings) `, a interface :meth:`str.format`, ou :" -"ref:`templates de strings ` pode ajudar a evitar esses " +"string literal (f-strings) `, a interface :meth:`str.format`, " +"ou :ref:`templates de strings ` pode ajudar a evitar esses " "erros. Cada uma dessas alternativas fornece seus próprios custos e " "benefícios de simplicidade, flexibilidade, e/ou extensibilidade." -#: ../../library/stdtypes.rst:2342 +#: ../../builtins/stdtypes.rst:2924 msgid "" "String objects have one unique built-in operation: the ``%`` operator " "(modulo). This is also known as the string *formatting* or *interpolation* " @@ -3788,10 +5255,18 @@ msgstr "" "(módulo). O mesmo também é conhecido como o operador de *formatação* ou " "*interpolação*. Dado ``format % values`` (onde *format* é uma string), as " "especificações de conversão ``%`` em *format* são substituídas por zero ou " -"mais elementos de *values*. O efeito é semelhante ao uso da função :c:func:" -"`sprintf` na linguagem C. Por exemplo:" +"mais elementos de *values*. O efeito é semelhante ao uso da " +"função :c:func:`sprintf` na linguagem C. Por exemplo:" -#: ../../library/stdtypes.rst:2354 +#: ../../builtins/stdtypes.rst:2931 +msgid "" +">>> print('%s has %d quote types.' % ('Python', 2))\n" +"Python has 2 quote types." +msgstr "" +">>> print('%s tem %d tipos de aspas.' % ('Python', 2))\n" +"Python tem 2 tipos de aspas." + +#: ../../builtins/stdtypes.rst:2936 msgid "" "If *format* requires a single argument, *values* may be a single non-tuple " "object. [5]_ Otherwise, *values* must be a tuple with exactly the number of " @@ -3804,7 +5279,7 @@ msgstr "" "string de formatação, ou um único mapa de objetos (por exemplo, um " "dicionário)." -#: ../../library/stdtypes.rst:2364 ../../library/stdtypes.rst:3583 +#: ../../builtins/stdtypes.rst:2946 ../../builtins/stdtypes.rst:4175 msgid "" "A conversion specifier contains two or more characters and has the following " "components, which must occur in this order:" @@ -3812,19 +5287,19 @@ msgstr "" "Um especificador de conversão contém dois ou mais caracteres e tem os " "seguintes componentes, que devem aparecer nesta ordem:" -#: ../../library/stdtypes.rst:2367 ../../library/stdtypes.rst:3586 +#: ../../builtins/stdtypes.rst:2949 ../../builtins/stdtypes.rst:4178 msgid "The ``'%'`` character, which marks the start of the specifier." msgstr "O caractere ``'%'``, que determina o início do especificador." -#: ../../library/stdtypes.rst:2369 ../../library/stdtypes.rst:3588 +#: ../../builtins/stdtypes.rst:2951 ../../builtins/stdtypes.rst:4180 msgid "" "Mapping key (optional), consisting of a parenthesised sequence of characters " "(for example, ``(somename)``)." msgstr "" -"Mapeamento de Chaves (opcional), consistindo de uma sequência entre " +"Mapeamento de chaves (opcional), consistindo de uma sequência entre " "parênteses de caracteres (por exemplo, ``(algumnome)``)." -#: ../../library/stdtypes.rst:2372 ../../library/stdtypes.rst:3591 +#: ../../builtins/stdtypes.rst:2954 ../../builtins/stdtypes.rst:4183 msgid "" "Conversion flags (optional), which affect the result of some conversion " "types." @@ -3832,18 +5307,18 @@ msgstr "" "Flags de conversão (opcional), que afetam o resultado de alguns tipos de " "conversão." -#: ../../library/stdtypes.rst:2375 ../../library/stdtypes.rst:3594 +#: ../../builtins/stdtypes.rst:2957 ../../builtins/stdtypes.rst:4186 msgid "" "Minimum field width (optional). If specified as an ``'*'`` (asterisk), the " "actual width is read from the next element of the tuple in *values*, and the " "object to convert comes after the minimum field width and optional precision." msgstr "" -"Largura mínima do Campo(opcional). Se for especificado por ``'*'`` " +"Largura mínima do campo (opcional). Se for especificado como um ``'*'`` " "(asterisco), a largura real será lida a partir do próximo elemento da tupla " "em *values* e o objeto a converter virá após a largura mínima do campo e a " "precisão que é opcional." -#: ../../library/stdtypes.rst:2379 ../../library/stdtypes.rst:3598 +#: ../../builtins/stdtypes.rst:2961 ../../builtins/stdtypes.rst:4190 msgid "" "Precision (optional), given as a ``'.'`` (dot) followed by the precision. " "If specified as ``'*'`` (an asterisk), the actual precision is read from the " @@ -3855,15 +5330,15 @@ msgstr "" "será lida a partir do próximo elemento da tupla em *values*, e o valor a " "converter virá após a precisão." -#: ../../library/stdtypes.rst:2384 ../../library/stdtypes.rst:3603 +#: ../../builtins/stdtypes.rst:2966 ../../builtins/stdtypes.rst:4195 msgid "Length modifier (optional)." -msgstr "Modificador de Comprimento(opcional)." +msgstr "Modificador de comprimento (opcional)." -#: ../../library/stdtypes.rst:2386 ../../library/stdtypes.rst:3605 +#: ../../builtins/stdtypes.rst:2968 ../../builtins/stdtypes.rst:4197 msgid "Conversion type." -msgstr "Tipos de Conversão" +msgstr "Tipo de conversão." -#: ../../library/stdtypes.rst:2388 +#: ../../builtins/stdtypes.rst:2970 msgid "" "When the right argument is a dictionary (or other mapping type), then the " "formats in the string *must* include a parenthesised mapping key into that " @@ -3876,7 +5351,7 @@ msgstr "" "A key de mapeamento seleciona o valor a ser formatado a partir do " "mapeamento. Por exemplo:" -#: ../../library/stdtypes.rst:2397 ../../library/stdtypes.rst:3616 +#: ../../builtins/stdtypes.rst:2979 ../../builtins/stdtypes.rst:4208 msgid "" "In this case no ``*`` specifiers may occur in a format (since they require a " "sequential parameter list)." @@ -3884,38 +5359,38 @@ msgstr "" "Nesse caso, nenhum especificador ``*`` poderá ocorrer num formato (uma vez " "que eles exigem uma lista de parâmetros sequenciais)." -#: ../../library/stdtypes.rst:2400 ../../library/stdtypes.rst:3619 +#: ../../builtins/stdtypes.rst:2982 ../../builtins/stdtypes.rst:4211 msgid "The conversion flag characters are:" msgstr "Os caracteres flags de conversão são:" -#: ../../library/stdtypes.rst:2409 ../../library/stdtypes.rst:3628 +#: ../../builtins/stdtypes.rst:2991 ../../builtins/stdtypes.rst:4220 msgid "Flag" msgstr "Sinalizador" -#: ../../library/stdtypes.rst:2411 ../../library/stdtypes.rst:3630 +#: ../../builtins/stdtypes.rst:2993 ../../builtins/stdtypes.rst:4222 msgid "``'#'``" msgstr "``'#'``" -#: ../../library/stdtypes.rst:2411 ../../library/stdtypes.rst:3630 +#: ../../builtins/stdtypes.rst:2993 ../../builtins/stdtypes.rst:4222 msgid "" "The value conversion will use the \"alternate form\" (where defined below)." msgstr "" -"A conversão de valor usará o \"formulário alternativo\" (em que definimos " +"A conversão de valor usará o \"formulário alternativo\" (conforme definido " "abaixo)." -#: ../../library/stdtypes.rst:2414 ../../library/stdtypes.rst:3633 +#: ../../builtins/stdtypes.rst:2996 ../../builtins/stdtypes.rst:4225 msgid "``'0'``" msgstr "``'0'``" -#: ../../library/stdtypes.rst:2414 ../../library/stdtypes.rst:3633 +#: ../../builtins/stdtypes.rst:2996 ../../builtins/stdtypes.rst:4225 msgid "The conversion will be zero padded for numeric values." msgstr "A conversão será preenchida por zeros para valores numéricos." -#: ../../library/stdtypes.rst:2416 ../../library/stdtypes.rst:3635 +#: ../../builtins/stdtypes.rst:2998 ../../builtins/stdtypes.rst:4227 msgid "``'-'``" msgstr "``'-'``" -#: ../../library/stdtypes.rst:2416 ../../library/stdtypes.rst:3635 +#: ../../builtins/stdtypes.rst:2998 ../../builtins/stdtypes.rst:4227 msgid "" "The converted value is left adjusted (overrides the ``'0'`` conversion if " "both are given)." @@ -3923,190 +5398,198 @@ msgstr "" "O valor convertido será ajustado à esquerda (substitui a conversão ``'0'`` " "se ambos forem fornecidos)." -#: ../../library/stdtypes.rst:2419 ../../library/stdtypes.rst:3638 +#: ../../builtins/stdtypes.rst:3001 ../../builtins/stdtypes.rst:4230 msgid "``' '``" msgstr "``' '``" -#: ../../library/stdtypes.rst:2419 ../../library/stdtypes.rst:3638 +#: ../../builtins/stdtypes.rst:3001 ../../builtins/stdtypes.rst:4230 msgid "" "(a space) A blank should be left before a positive number (or empty string) " "produced by a signed conversion." msgstr "" "(um espaço) Um espaço em branco deverá ser deixado antes de um número " -"positivo (ou uma String vazia) produzido por uma conversão assinada." +"positivo (ou uma string vazia) produzido por uma conversão assinada." -#: ../../library/stdtypes.rst:2422 ../../library/stdtypes.rst:3641 +#: ../../builtins/stdtypes.rst:3004 ../../builtins/stdtypes.rst:4233 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/stdtypes.rst:2422 ../../library/stdtypes.rst:3641 +#: ../../builtins/stdtypes.rst:3004 ../../builtins/stdtypes.rst:4233 msgid "" "A sign character (``'+'`` or ``'-'``) will precede the conversion (overrides " "a \"space\" flag)." msgstr "" -"Um sinal de caractere (``'+'`` ou ``'-'``) precedera a conversão " -"(substituindo o sinalizador \"space\")." +"Um sinal de caractere (``'+'`` ou ``'-'``) precederá a conversão " +"(substituindo o sinalizador de \"espaço\")." -#: ../../library/stdtypes.rst:2426 ../../library/stdtypes.rst:3645 +#: ../../builtins/stdtypes.rst:3008 ../../builtins/stdtypes.rst:4237 msgid "" "A length modifier (``h``, ``l``, or ``L``) may be present, but is ignored as " "it is not necessary for Python -- so e.g. ``%ld`` is identical to ``%d``." msgstr "" "Um modificador de comprimento (``h``, ``l``, ou ``L``) pode estar presente, " -"mas será ignorado, pois o mesmo não é necessário para o Python -- então por " -"exemplo ``%ld`` é idêntico a ``%d``." +"mas será ignorado, pois o mesmo não é necessário para o Python -- então, por " +"exemplo, ``%ld`` é idêntico a ``%d``." -#: ../../library/stdtypes.rst:2429 ../../library/stdtypes.rst:3648 +#: ../../builtins/stdtypes.rst:3011 ../../builtins/stdtypes.rst:4240 msgid "The conversion types are:" msgstr "Os tipos de conversão são:" -#: ../../library/stdtypes.rst:2432 ../../library/stdtypes.rst:3651 -msgid "Conversion" -msgstr "Conversão" - -#: ../../library/stdtypes.rst:2434 ../../library/stdtypes.rst:3653 +#: ../../builtins/stdtypes.rst:3016 ../../builtins/stdtypes.rst:4245 msgid "``'d'``" msgstr "``'d'``" -#: ../../library/stdtypes.rst:2434 ../../library/stdtypes.rst:2436 -#: ../../library/stdtypes.rst:3653 ../../library/stdtypes.rst:3655 +#: ../../builtins/stdtypes.rst:3016 ../../builtins/stdtypes.rst:3018 +#: ../../builtins/stdtypes.rst:4245 ../../builtins/stdtypes.rst:4247 msgid "Signed integer decimal." msgstr "Número decimal inteiro sinalizador." -#: ../../library/stdtypes.rst:2436 ../../library/stdtypes.rst:3655 +#: ../../builtins/stdtypes.rst:3018 ../../builtins/stdtypes.rst:4247 msgid "``'i'``" msgstr "``'i'``" -#: ../../library/stdtypes.rst:2438 ../../library/stdtypes.rst:3657 +#: ../../builtins/stdtypes.rst:3020 ../../builtins/stdtypes.rst:4249 msgid "``'o'``" msgstr "``'o'``" -#: ../../library/stdtypes.rst:2438 ../../library/stdtypes.rst:3657 +#: ../../builtins/stdtypes.rst:3020 ../../builtins/stdtypes.rst:4249 msgid "Signed octal value." msgstr "Valor octal sinalizador." -#: ../../library/stdtypes.rst:2440 ../../library/stdtypes.rst:3659 +#: ../../builtins/stdtypes.rst:3022 ../../builtins/stdtypes.rst:4251 msgid "``'u'``" msgstr "``'u'``" -#: ../../library/stdtypes.rst:2440 ../../library/stdtypes.rst:3659 +#: ../../builtins/stdtypes.rst:3022 ../../builtins/stdtypes.rst:4251 msgid "Obsolete type -- it is identical to ``'d'``." msgstr "Tipo obsoleto -- é idêntico a ``'d'``." -#: ../../library/stdtypes.rst:2442 ../../library/stdtypes.rst:3661 +#: ../../builtins/stdtypes.rst:3024 ../../builtins/stdtypes.rst:4253 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/stdtypes.rst:2442 ../../library/stdtypes.rst:3661 +#: ../../builtins/stdtypes.rst:3024 ../../builtins/stdtypes.rst:4253 msgid "Signed hexadecimal (lowercase)." -msgstr "Sinalizador hexadecimal (minúsculas)." +msgstr "Hexadecimal com sinal (minúsculo)." -#: ../../library/stdtypes.rst:2444 ../../library/stdtypes.rst:3663 +#: ../../builtins/stdtypes.rst:3026 ../../builtins/stdtypes.rst:4255 msgid "``'X'``" msgstr "``'X'``" -#: ../../library/stdtypes.rst:2444 ../../library/stdtypes.rst:3663 +#: ../../builtins/stdtypes.rst:3026 ../../builtins/stdtypes.rst:4255 msgid "Signed hexadecimal (uppercase)." -msgstr "Sinalizador hexadecimal (maiúscula)." +msgstr "Hexadecimal com sinal (maiúsculo)." -#: ../../library/stdtypes.rst:2446 ../../library/stdtypes.rst:3665 +#: ../../builtins/stdtypes.rst:3028 ../../builtins/stdtypes.rst:4257 msgid "``'e'``" msgstr "``'e'``" -#: ../../library/stdtypes.rst:2446 ../../library/stdtypes.rst:3665 +#: ../../builtins/stdtypes.rst:3028 ../../builtins/stdtypes.rst:4257 msgid "Floating-point exponential format (lowercase)." -msgstr "Formato exponencial de ponto flutuante (minúsculas)." +msgstr "Formato exponencial de ponto flutuante (minúsculo)." -#: ../../library/stdtypes.rst:2448 ../../library/stdtypes.rst:3667 +#: ../../builtins/stdtypes.rst:3030 ../../builtins/stdtypes.rst:4259 msgid "``'E'``" msgstr "``'E'``" -#: ../../library/stdtypes.rst:2448 ../../library/stdtypes.rst:3667 +#: ../../builtins/stdtypes.rst:3030 ../../builtins/stdtypes.rst:4259 msgid "Floating-point exponential format (uppercase)." -msgstr "Formato exponencial de ponto flutuante (maiúscula)." +msgstr "Formato exponencial de ponto flutuante (maiúsculo)." -#: ../../library/stdtypes.rst:2450 ../../library/stdtypes.rst:3669 +#: ../../builtins/stdtypes.rst:3032 ../../builtins/stdtypes.rst:4261 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/stdtypes.rst:2450 ../../library/stdtypes.rst:2452 -#: ../../library/stdtypes.rst:3669 ../../library/stdtypes.rst:3671 +#: ../../builtins/stdtypes.rst:3032 ../../builtins/stdtypes.rst:3034 +#: ../../builtins/stdtypes.rst:4261 ../../builtins/stdtypes.rst:4263 msgid "Floating-point decimal format." msgstr "Formato decimal de ponto flutuante." -#: ../../library/stdtypes.rst:2452 ../../library/stdtypes.rst:3671 +#: ../../builtins/stdtypes.rst:3034 ../../builtins/stdtypes.rst:4263 msgid "``'F'``" msgstr "``'F'``" -#: ../../library/stdtypes.rst:2454 ../../library/stdtypes.rst:3673 +#: ../../builtins/stdtypes.rst:3036 ../../builtins/stdtypes.rst:4265 msgid "``'g'``" msgstr "``'g'``" -#: ../../library/stdtypes.rst:2454 ../../library/stdtypes.rst:3673 +#: ../../builtins/stdtypes.rst:3036 ../../builtins/stdtypes.rst:4265 msgid "" "Floating-point format. Uses lowercase exponential format if exponent is less " "than -4 or not less than precision, decimal format otherwise." msgstr "" -"O formato de ponto flutuante. Usa o formato exponencial em minúsculas se o " +"O formato de ponto flutuante. Usa o formato exponencial em minúsculo se o " "expoente for inferior a -4 ou não inferior a precisão, formato decimal, caso " "contrário." -#: ../../library/stdtypes.rst:2458 ../../library/stdtypes.rst:3677 +#: ../../builtins/stdtypes.rst:3040 ../../builtins/stdtypes.rst:4269 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/stdtypes.rst:2458 ../../library/stdtypes.rst:3677 +#: ../../builtins/stdtypes.rst:3040 ../../builtins/stdtypes.rst:4269 msgid "" "Floating-point format. Uses uppercase exponential format if exponent is less " "than -4 or not less than precision, decimal format otherwise." msgstr "" -"Formato de ponto flutuante. Usa o formato exponencial em maiúsculas se o " +"Formato de ponto flutuante. Usa o formato exponencial em maiúsculo se o " "expoente for inferior a -4 ou não inferior que a precisão, formato decimal, " "caso contrário." -#: ../../library/stdtypes.rst:2462 ../../library/stdtypes.rst:3681 +#: ../../builtins/stdtypes.rst:3044 ../../builtins/stdtypes.rst:4273 msgid "``'c'``" msgstr "``'c'``" -#: ../../library/stdtypes.rst:2462 +#: ../../builtins/stdtypes.rst:3044 msgid "Single character (accepts integer or single character string)." -msgstr "Caráter único (aceita inteiro ou um único caractere String)." +msgstr "Caractere único (aceita inteiro ou um único caractere string)." -#: ../../library/stdtypes.rst:2465 ../../library/stdtypes.rst:3694 +#: ../../builtins/stdtypes.rst:3047 ../../builtins/stdtypes.rst:4286 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/stdtypes.rst:2465 +#: ../../builtins/stdtypes.rst:3047 msgid "String (converts any Python object using :func:`repr`)." msgstr "String (converte qualquer objeto Python usando a função :func:`repr`)." -#: ../../library/stdtypes.rst:2468 ../../library/stdtypes.rst:3688 +#: ../../builtins/stdtypes.rst:3050 ../../builtins/stdtypes.rst:4280 msgid "``'s'``" msgstr "``'s'``" -#: ../../library/stdtypes.rst:2468 +#: ../../builtins/stdtypes.rst:3050 msgid "String (converts any Python object using :func:`str`)." msgstr "String (converte qualquer objeto Python usando a função :func:`str`)." -#: ../../library/stdtypes.rst:2471 ../../library/stdtypes.rst:3691 +#: ../../builtins/stdtypes.rst:3053 ../../builtins/stdtypes.rst:4283 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/stdtypes.rst:2471 +#: ../../builtins/stdtypes.rst:3053 msgid "String (converts any Python object using :func:`ascii`)." msgstr "" "String (converte qualquer objeto Python usando a função :func:`ascii`)." -#: ../../library/stdtypes.rst:2474 ../../library/stdtypes.rst:3697 +#: ../../builtins/stdtypes.rst:3056 ../../builtins/stdtypes.rst:4289 msgid "``'%'``" msgstr "``'%'``" -#: ../../library/stdtypes.rst:2474 ../../library/stdtypes.rst:3697 +#: ../../builtins/stdtypes.rst:3056 ../../builtins/stdtypes.rst:4289 msgid "No argument is converted, results in a ``'%'`` character in the result." msgstr "" -"Nenhum argumento é convertido, resultando um caractere ``''%'`` no resultado." +"Nenhum argumento é convertido, resultando em um caractere ``'%'`` no " +"resultado." -#: ../../library/stdtypes.rst:2481 ../../library/stdtypes.rst:3704 +#: ../../builtins/stdtypes.rst:3060 +msgid "" +"For floating-point formats, the result should be correctly rounded to a " +"given precision ``p`` of digits after the decimal point. The rounding mode " +"matches that of the :func:`round` builtin." +msgstr "" +"Para formatos de ponto flutuante, o resultado deve ser arredondado " +"corretamente para uma determinada precisão ``p`` de dígitos após o ponto " +"decimal. O modo de arredondamento corresponde ao da função " +"embutida :func:`round`." + +#: ../../builtins/stdtypes.rst:3067 ../../builtins/stdtypes.rst:4296 msgid "" "The alternate form causes a leading octal specifier (``'0o'``) to be " "inserted before the first digit." @@ -4114,7 +5597,7 @@ msgstr "" "A forma alternativa faz com que um especificador octal principal (``'0o'``) " "seja inserido antes do primeiro dígito." -#: ../../library/stdtypes.rst:2485 ../../library/stdtypes.rst:3708 +#: ../../builtins/stdtypes.rst:3071 ../../builtins/stdtypes.rst:4300 msgid "" "The alternate form causes a leading ``'0x'`` or ``'0X'`` (depending on " "whether the ``'x'`` or ``'X'`` format was used) to be inserted before the " @@ -4124,7 +5607,7 @@ msgstr "" "formato ``'x'`` or ``'X'`` foi usado) para ser inserido antes do primeiro " "dígito." -#: ../../library/stdtypes.rst:2489 ../../library/stdtypes.rst:3712 +#: ../../builtins/stdtypes.rst:3075 ../../builtins/stdtypes.rst:4304 msgid "" "The alternate form causes the result to always contain a decimal point, even " "if no digits follow it." @@ -4132,14 +5615,14 @@ msgstr "" "A forma alternativa faz com que o resultado sempre contenha um ponto " "decimal, mesmo que nenhum dígito o siga." -#: ../../library/stdtypes.rst:2492 ../../library/stdtypes.rst:3715 +#: ../../builtins/stdtypes.rst:3078 ../../builtins/stdtypes.rst:4307 msgid "" "The precision determines the number of digits after the decimal point and " "defaults to 6." msgstr "" "A precisão determina o número de dígitos após o ponto decimal e o padrão é 6." -#: ../../library/stdtypes.rst:2496 ../../library/stdtypes.rst:3719 +#: ../../builtins/stdtypes.rst:3082 ../../builtins/stdtypes.rst:4311 msgid "" "The alternate form causes the result to always contain a decimal point, and " "trailing zeroes are not removed as they would otherwise be." @@ -4147,31 +5630,31 @@ msgstr "" "A forma alternativa faz com que o resultado sempre contenha um ponto decimal " "e os zeros à direita não sejam removidos, como de outra forma seriam." -#: ../../library/stdtypes.rst:2499 ../../library/stdtypes.rst:3722 +#: ../../builtins/stdtypes.rst:3085 ../../builtins/stdtypes.rst:4314 msgid "" "The precision determines the number of significant digits before and after " "the decimal point and defaults to 6." msgstr "" "A precisão determina o número de dígitos significativos antes e depois do " -"ponto decimal e o padrão é 6." +"ponto decimal e o padrão seja 6." -#: ../../library/stdtypes.rst:2503 ../../library/stdtypes.rst:3726 +#: ../../builtins/stdtypes.rst:3089 ../../builtins/stdtypes.rst:4318 msgid "If precision is ``N``, the output is truncated to ``N`` characters." -msgstr "Se a precisão for ``N``, a saída será truncada em caracteres ``N``." +msgstr "Se a precisão for ``N``, a saída será truncada em ``N`` caracteres." -#: ../../library/stdtypes.rst:2506 ../../library/stdtypes.rst:3735 +#: ../../builtins/stdtypes.rst:3092 ../../builtins/stdtypes.rst:4327 msgid "See :pep:`237`." msgstr "Veja :pep:`237`." -#: ../../library/stdtypes.rst:2508 +#: ../../builtins/stdtypes.rst:3094 msgid "" "Since Python strings have an explicit length, ``%s`` conversions do not " "assume that ``'\\0'`` is the end of the string." msgstr "" -"Como as Strings do Python possuem comprimento explícito, ``%s`` as " -"conversões não presumem que ``'\\0'`` é o fim da string." +"Como as strings no Python possuem comprimento explícito, conversões de " +"``%s`` não presumem que ``'\\0'`` seja o fim da string." -#: ../../library/stdtypes.rst:2513 +#: ../../builtins/stdtypes.rst:3099 msgid "" "``%f`` conversions for numbers whose absolute value is over 1e50 are no " "longer replaced by ``%g`` conversions." @@ -4179,40 +5662,41 @@ msgstr "" "``%f`` as conversões para números cujo valor absoluto é superior a 1e50 não " "são mais substituídas pela conversão ``%g``." -#: ../../library/stdtypes.rst:2524 +#: ../../builtins/stdtypes.rst:3110 msgid "" -"Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:" -"`memoryview`" +"Binary Sequence Types " +"--- :class:`bytes`, :class:`bytearray`, :class:`memoryview`" msgstr "" -"Tipos de Sequência Binária --- :class:`bytes`, :class:`bytearray`, :class:" -"`memoryview`" +"Tipos de sequência binária " +"--- :class:`bytes`, :class:`bytearray`, :class:`memoryview`" -#: ../../library/stdtypes.rst:2532 +#: ../../builtins/stdtypes.rst:3118 msgid "" -"The core built-in types for manipulating binary data are :class:`bytes` and :" -"class:`bytearray`. They are supported by :class:`memoryview` which uses the :" -"ref:`buffer protocol ` to access the memory of other binary " -"objects without needing to make a copy." +"The core built-in types for manipulating binary data are :class:`bytes` " +"and :class:`bytearray`. They are supported by :class:`memoryview` which uses " +"the :ref:`buffer protocol ` to access the memory of other " +"binary objects without needing to make a copy." msgstr "" -"Os principais tipos embutidos para manipular dados binários são :class:" -"`bytes` e :class:`bytearray`. Eles são suportados por :class:`memoryview` a " -"qual usa o :ref:`buffer protocol ` para acessar a memória de " -"outros objetos binários sem precisar fazer uma cópia." +"Os principais tipos embutidos para manipular dados binários " +"são :class:`bytes` e :class:`bytearray`. Eles são suportados " +"por :class:`memoryview` a qual usa o :ref:`protocolo buffer ` " +"para acessar a memória de outros objetos binários sem precisar fazer uma " +"cópia." -#: ../../library/stdtypes.rst:2537 +#: ../../builtins/stdtypes.rst:3123 msgid "" "The :mod:`array` module supports efficient storage of basic data types like " "32-bit integers and IEEE754 double-precision floating values." msgstr "" -"O módulo :mod:`array` suporta armazenamento eficiente de tipos de dados " -"básicos como inteiros de 32 bits e valores de ponto-flutuante com precisão " -"dupla IEEE754." +"O módulo :mod:`array` provê suporte a um armazenamento eficiente de tipos de " +"dados básicos como inteiros de 32 bits e valores de ponto flutuante com " +"precisão dupla IEEE754." -#: ../../library/stdtypes.rst:2543 +#: ../../builtins/stdtypes.rst:3129 msgid "Bytes Objects" msgstr "Objetos Bytes" -#: ../../library/stdtypes.rst:2547 +#: ../../builtins/stdtypes.rst:3133 msgid "" "Bytes objects are immutable sequences of single bytes. Since many major " "binary protocols are based on the ASCII text encoding, bytes objects offer " @@ -4225,51 +5709,51 @@ msgstr "" "trabalhamos com dados compatíveis com ASCII, e são proximamente relacionados " "com objetos string em uma variedade de outros sentidos." -#: ../../library/stdtypes.rst:2554 +#: ../../builtins/stdtypes.rst:3141 msgid "" "Firstly, the syntax for bytes literals is largely the same as that for " "string literals, except that a ``b`` prefix is added:" msgstr "" "Em primeiro lugar, a sintaxe para literais de bytes é em grande parte a " -"mesma para literais de String, exceto que um prefixo ``b`` é adicionado:" +"mesma para literais de string, exceto que um prefixo ``b`` é adicionado:" -#: ../../library/stdtypes.rst:2557 +#: ../../builtins/stdtypes.rst:3144 msgid "Single quotes: ``b'still allows embedded \"double\" quotes'``" -msgstr "Aspas simples: ``b'still allows embedded \"double\" quotes'``" +msgstr "Aspas simples: ``b'ainda permite aspas \"duplas\" dentro'``" -#: ../../library/stdtypes.rst:2558 +#: ../../builtins/stdtypes.rst:3145 msgid "Double quotes: ``b\"still allows embedded 'single' quotes\"``" -msgstr "Aspas duplas: ``b\"still allows embedded 'single' quotes\"``" +msgstr "Aspas duplas: ``b\"ainda permite aspas 'simples' dentro\"``" -#: ../../library/stdtypes.rst:2559 +#: ../../builtins/stdtypes.rst:3146 msgid "" "Triple quoted: ``b'''3 single quotes'''``, ``b\"\"\"3 double quotes\"\"\"``" msgstr "" -"Aspas triplas: ``b'''3 single quotes'''``, ``b\"\"\"3 double quotes\"\"\"``" +"Aspas triplas: ``b'''3 aspas simples'''``, ``b\"\"\"3 aspas duplas\"\"\"``" -#: ../../library/stdtypes.rst:2561 +#: ../../builtins/stdtypes.rst:3148 msgid "" "Only ASCII characters are permitted in bytes literals (regardless of the " "declared source code encoding). Any binary values over 127 must be entered " "into bytes literals using the appropriate escape sequence." msgstr "" "Apenas caracteres ASCII são permitidos em literais de bytes " -"(independentemente da codificação declarada). Qualquer valor binário " -"superior a 127 deverá ser inserido em literais de bytes usando a sequência " -"de escape apropriada." +"(independentemente da codificação declarada no código-fonte). Qualquer valor " +"binário superior a 127 deverá ser inserido em literais de bytes usando a " +"sequência de escape apropriada." -#: ../../library/stdtypes.rst:2565 +#: ../../builtins/stdtypes.rst:3152 msgid "" "As with string literals, bytes literals may also use a ``r`` prefix to " "disable processing of escape sequences. See :ref:`strings` for more about " "the various forms of bytes literal, including supported escape sequences." msgstr "" "Assim como string literais, bytes literais também podem usar um prefixo " -"``r`` para desabilitar o processamento de sequências de escape. Veja :ref:" -"`strings` para mais sobre as várias formas de bytes literais, incluindo " -"suporte a sequências de escape." +"``r`` para desabilitar o processamento de sequências de escape. " +"Veja :ref:`strings` para mais sobre as várias formas de bytes literais, " +"incluindo suporte a sequências de escape." -#: ../../library/stdtypes.rst:2569 +#: ../../builtins/stdtypes.rst:3156 msgid "" "While bytes literals and representations are based on ASCII text, bytes " "objects actually behave like immutable sequences of integers, with each " @@ -4292,7 +5776,7 @@ msgstr "" "cegamente em formatos de dados binários que não são compatíveis com ASCII " "irá usualmente resultar em dados corrompidos)." -#: ../../library/stdtypes.rst:2579 +#: ../../builtins/stdtypes.rst:3166 msgid "" "In addition to the literal forms, bytes objects can be created in a number " "of other ways:" @@ -4300,27 +5784,27 @@ msgstr "" "Além das formas literais, os objetos bytes podem ser criados de várias " "outras maneiras:" -#: ../../library/stdtypes.rst:2582 +#: ../../builtins/stdtypes.rst:3169 msgid "A zero-filled bytes object of a specified length: ``bytes(10)``" msgstr "" "Um bytes preenchido com objetos zero com um comprimento especificado: " "``bytes(10)``" -#: ../../library/stdtypes.rst:2583 +#: ../../builtins/stdtypes.rst:3170 msgid "From an iterable of integers: ``bytes(range(20))``" msgstr "De um iterável de inteiros: ``bytes(range(20))``" -#: ../../library/stdtypes.rst:2584 +#: ../../builtins/stdtypes.rst:3171 msgid "Copying existing binary data via the buffer protocol: ``bytes(obj)``" msgstr "" "Copiando dados binários existentes através do protocolo de Buffer: " "``bytes(obj)``" -#: ../../library/stdtypes.rst:2586 +#: ../../builtins/stdtypes.rst:3173 msgid "Also see the :ref:`bytes ` built-in." msgstr "Veja também os embutidos :ref:`bytes `." -#: ../../library/stdtypes.rst:2588 +#: ../../builtins/stdtypes.rst:3175 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -4332,7 +5816,7 @@ msgstr "" "binários. Portanto, o tipo bytes tem um método de classe adicional para ler " "dados nesse formato:" -#: ../../library/stdtypes.rst:2594 +#: ../../builtins/stdtypes.rst:3181 msgid "" "This :class:`bytes` class method returns a bytes object, decoding the given " "string object. The string must contain two hexadecimal digits per byte, " @@ -4342,7 +5826,7 @@ msgstr "" "decodificando o objeto string fornecido. A string deve conter dois dígitos " "hexadecimais por byte, com espaço em branco ASCII sendo ignorado." -#: ../../library/stdtypes.rst:2601 +#: ../../builtins/stdtypes.rst:3188 msgid "" ":meth:`bytes.fromhex` now skips all ASCII whitespace in the string, not just " "spaces." @@ -4350,7 +5834,7 @@ msgstr "" ":meth:`bytes.fromhex` agora ignora todos os espaços em branco em ASCII na " "string, não apenas espaços." -#: ../../library/stdtypes.rst:2605 +#: ../../builtins/stdtypes.rst:3192 msgid "" "A reverse conversion function exists to transform a bytes object into its " "hexadecimal representation." @@ -4358,7 +5842,7 @@ msgstr "" "Uma função de conversão reversa existe para transformar um objeto bytes na " "sua representação hexadecimal." -#: ../../library/stdtypes.rst:2610 ../../library/stdtypes.rst:2695 +#: ../../builtins/stdtypes.rst:3198 ../../builtins/stdtypes.rst:3285 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the instance." @@ -4366,7 +5850,7 @@ msgstr "" "Retorna um objeto string contendo dois dígitos hexadecimais para cada byte " "na instância." -#: ../../library/stdtypes.rst:2616 +#: ../../builtins/stdtypes.rst:3204 msgid "" "If you want to make the hex string easier to read, you can specify a single " "character separator *sep* parameter to include in the output. By default, " @@ -4381,7 +5865,7 @@ msgstr "" "Valores positivos calculam a posição do separador a partir da direita, " "valores negativos calculam a partir da esquerda." -#: ../../library/stdtypes.rst:2633 +#: ../../builtins/stdtypes.rst:3221 msgid "" ":meth:`bytes.hex` now supports optional *sep* and *bytes_per_sep* parameters " "to insert separators between bytes in the hex output." @@ -4389,7 +5873,7 @@ msgstr "" ":meth:`bytes.hex` agora suporta os parâmetros opcionais *sep* e " "*bytes_per_sep* para inserir separadores entre bytes na saída hexadecimal." -#: ../../library/stdtypes.rst:2637 +#: ../../builtins/stdtypes.rst:3225 msgid "" "Since bytes objects are sequences of integers (akin to a tuple), for a bytes " "object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytes " @@ -4402,7 +5886,7 @@ msgstr "" "strings de texto, onde tanto o uso por índice quanto por fatiamento irão " "produzir uma string de comprimento 1)" -#: ../../library/stdtypes.rst:2642 +#: ../../builtins/stdtypes.rst:3230 msgid "" "The representation of bytes objects uses the literal format (``b'...'``) " "since it is often more useful than e.g. ``bytes([46, 46, 46])``. You can " @@ -4413,19 +5897,19 @@ msgstr "" "46])``. Você sempre pode converter um objeto bytes em uma lista de inteiros " "usando ``list(b)``." -#: ../../library/stdtypes.rst:2650 +#: ../../builtins/stdtypes.rst:3238 msgid "Bytearray Objects" msgstr "Objetos Bytearray" -#: ../../library/stdtypes.rst:2654 +#: ../../builtins/stdtypes.rst:3242 msgid "" ":class:`bytearray` objects are a mutable counterpart to :class:`bytes` " "objects." msgstr "" -"Objetos :class:`bytearray` são mutáveis, em contrapartida a objetos :class:" -"`bytes`." +"Objetos :class:`bytearray` são mutáveis, em contrapartida a " +"objetos :class:`bytes`." -#: ../../library/stdtypes.rst:2659 +#: ../../builtins/stdtypes.rst:3248 msgid "" "There is no dedicated literal syntax for bytearray objects, instead they are " "always created by calling the constructor:" @@ -4433,28 +5917,28 @@ msgstr "" "Não existe sintaxe literal dedicada para objetos de bytearray, ao invés " "disso eles sempre são criados através da chamada do construtor:" -#: ../../library/stdtypes.rst:2662 +#: ../../builtins/stdtypes.rst:3251 msgid "Creating an empty instance: ``bytearray()``" msgstr "Criando uma instância vazia: ``bytearray()``" -#: ../../library/stdtypes.rst:2663 +#: ../../builtins/stdtypes.rst:3252 msgid "Creating a zero-filled instance with a given length: ``bytearray(10)``" msgstr "" "Criando uma instância cheia de zero com um determinado comprimento: " "``bytearray(10)``" -#: ../../library/stdtypes.rst:2664 +#: ../../builtins/stdtypes.rst:3253 msgid "From an iterable of integers: ``bytearray(range(20))``" msgstr "A partir de inteiros iteráveis: ``bytearray(range(20))``" -#: ../../library/stdtypes.rst:2665 +#: ../../builtins/stdtypes.rst:3254 msgid "" "Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')``" msgstr "" "Copiando dados binários existentes através do protocolo de buffer: " "``bytearray(b'Hi!')``" -#: ../../library/stdtypes.rst:2667 +#: ../../builtins/stdtypes.rst:3256 msgid "" "As bytearray objects are mutable, they support the :ref:`mutable ` sequence operations in addition to the common bytes and bytearray " @@ -4464,11 +5948,11 @@ msgstr "" "sequência :ref:`mutable ` além das operações comuns de " "bytes e bytearray descritas em :ref:`bytes-methods`." -#: ../../library/stdtypes.rst:2671 +#: ../../builtins/stdtypes.rst:3260 msgid "Also see the :ref:`bytearray ` built-in." msgstr "Veja também o tipo embutido :ref:`bytearray `." -#: ../../library/stdtypes.rst:2673 +#: ../../builtins/stdtypes.rst:3262 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -4480,10 +5964,10 @@ msgstr "" "dados binários. Consequentemente, o tipo de bytearray tem um método de " "classe adicional para ler dados nesse formato:" -#: ../../library/stdtypes.rst:2679 +#: ../../builtins/stdtypes.rst:3268 msgid "" -"This :class:`bytearray` class method returns bytearray object, decoding the " -"given string object. The string must contain two hexadecimal digits per " +"This :class:`bytearray` class method returns a bytearray object, decoding " +"the given string object. The string must contain two hexadecimal digits per " "byte, with ASCII whitespace being ignored." msgstr "" "Este método de classe da classe :class:`bytearray` retorna um objeto " @@ -4491,7 +5975,7 @@ msgstr "" "dois dígitos hexadecimais por byte, com espaços em branco ASCII sendo " "ignorados." -#: ../../library/stdtypes.rst:2686 +#: ../../builtins/stdtypes.rst:3275 msgid "" ":meth:`bytearray.fromhex` now skips all ASCII whitespace in the string, not " "just spaces." @@ -4499,7 +5983,7 @@ msgstr "" ":meth:`bytearray.fromhex` agora ignora todos os espaços em branco em ASCII " "na string, não apenas espaços." -#: ../../library/stdtypes.rst:2690 +#: ../../builtins/stdtypes.rst:3279 msgid "" "A reverse conversion function exists to transform a bytearray object into " "its hexadecimal representation." @@ -4507,7 +5991,7 @@ msgstr "" "Existe uma função de conversão reversa para transformar um objeto bytearray " "em sua representação hexadecimal." -#: ../../library/stdtypes.rst:2703 +#: ../../builtins/stdtypes.rst:3293 msgid "" "Similar to :meth:`bytes.hex`, :meth:`bytearray.hex` now supports optional " "*sep* and *bytes_per_sep* parameters to insert separators between bytes in " @@ -4517,7 +6001,7 @@ msgstr "" "parâmetros opcionais *sep* e *bytes_per_sep* para inserir separadores entre " "bytes na saída hexadecimal." -#: ../../library/stdtypes.rst:2708 +#: ../../builtins/stdtypes.rst:3298 msgid "" "Since bytearray objects are sequences of integers (akin to a list), for a " "bytearray object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be " @@ -4530,7 +6014,7 @@ msgstr "" "Strings de texto, onde tanto a indexação como o fatiamento produzirão " "sequências de comprimento 1)" -#: ../../library/stdtypes.rst:2713 +#: ../../builtins/stdtypes.rst:3303 msgid "" "The representation of bytearray objects uses the bytes literal format " "(``bytearray(b'...')``) since it is often more useful than e.g. " @@ -4542,11 +6026,11 @@ msgstr "" "exemplo, ``bytearray([46, 46, 46])``. Você sempre pode converter um objeto " "bytearray em uma lista de inteiros usando ``list(b)``." -#: ../../library/stdtypes.rst:2722 +#: ../../builtins/stdtypes.rst:3312 msgid "Bytes and Bytearray Operations" msgstr "Operações com Bytes e Bytearray" -#: ../../library/stdtypes.rst:2727 +#: ../../builtins/stdtypes.rst:3317 msgid "" "Both bytes and bytearray objects support the :ref:`common ` " "sequence operations. They interoperate not just with operands of the same " @@ -4554,14 +6038,14 @@ msgid "" "can be freely mixed in operations without causing errors. However, the " "return type of the result may depend on the order of operands." msgstr "" -"Ambos os tipos, bytes e os objetos bytearray suportam as operações de " -"sequências :ref:`comuns `. Os mesmo interagem não apenas " -"com operandos do mesmo tipo, mas com qualquer :term:`objeto byte ou similar " -"`. Devido a esta flexibilidade, os mesmos podem ser " -"misturados livremente em operações sem causar erros. No entanto, o tipo de " -"retorno do resultado pode depender da ordem dos operandos." +"Ambos os tipos, bytes e objetos do tipo bytearray, aceitam as operações de " +"sequências :ref:`comuns `. Os mesmos interagem não apenas " +"com operandos do mesmo tipo, mas também com qualquer :term:`objeto bytes ou " +"similar `. Devido a esta flexibilidade, os mesmos podem " +"ser misturados livremente em operações sem causar erros. No entanto, o tipo " +"de retorno do resultado pode depender da ordem dos operandos." -#: ../../library/stdtypes.rst:2735 +#: ../../builtins/stdtypes.rst:3325 msgid "" "The methods on bytes and bytearray objects don't accept strings as their " "arguments, just as the methods on strings don't accept bytes as their " @@ -4571,11 +6055,27 @@ msgstr "" "assim como os métodos de Strings não aceitam bytes como argumentos. Por " "exemplo, devemos escrever::" -#: ../../library/stdtypes.rst:2742 +#: ../../builtins/stdtypes.rst:3329 +msgid "" +"a = \"abc\"\n" +"b = a.replace(\"a\", \"f\")" +msgstr "" +"a = \"abc\"\n" +"b = a.replace(\"a\", \"f\")" + +#: ../../builtins/stdtypes.rst:3332 msgid "and::" msgstr "e::" -#: ../../library/stdtypes.rst:2747 +#: ../../builtins/stdtypes.rst:3334 +msgid "" +"a = b\"abc\"\n" +"b = a.replace(b\"a\", b\"f\")" +msgstr "" +"a = b\"abc\"\n" +"b = a.replace(b\"a\", b\"f\")" + +#: ../../builtins/stdtypes.rst:3337 msgid "" "Some bytes and bytearray operations assume the use of ASCII compatible " "binary formats, and hence should be avoided when working with arbitrary " @@ -4585,7 +6085,7 @@ msgstr "" "compatíveis com ASCII e, portanto, devem ser evitados ao trabalhar com dados " "binários arbitrários. Essas restrições são abordadas a seguir." -#: ../../library/stdtypes.rst:2752 +#: ../../builtins/stdtypes.rst:3342 msgid "" "Using these ASCII based operations to manipulate binary data that is not " "stored in an ASCII based format may lead to data corruption." @@ -4594,7 +6094,7 @@ msgstr "" "não são armazenados num formato baseado em ASCII poderá resultar na " "corrupção de dados." -#: ../../library/stdtypes.rst:2755 +#: ../../builtins/stdtypes.rst:3345 msgid "" "The following methods on bytes and bytearray objects can be used with " "arbitrary binary data." @@ -4602,7 +6102,7 @@ msgstr "" "Os métodos a seguir em Bytes e Bytearray podem ser usados com dados binários " "arbitrários." -#: ../../library/stdtypes.rst:2761 +#: ../../builtins/stdtypes.rst:3351 msgid "" "Return the number of non-overlapping occurrences of subsequence *sub* in the " "range [*start*, *end*]. Optional arguments *start* and *end* are " @@ -4612,17 +6112,17 @@ msgstr "" "intervalo [*start*, *end*]. Os argumentos opcionais *start* e *end* são " "interpretados como na notação de fatiamento." -#: ../../library/stdtypes.rst:2765 ../../library/stdtypes.rst:2870 -#: ../../library/stdtypes.rst:2892 ../../library/stdtypes.rst:2958 -#: ../../library/stdtypes.rst:2971 +#: ../../builtins/stdtypes.rst:3355 ../../builtins/stdtypes.rst:3460 +#: ../../builtins/stdtypes.rst:3482 ../../builtins/stdtypes.rst:3548 +#: ../../builtins/stdtypes.rst:3561 msgid "" "The subsequence to search for may be any :term:`bytes-like object` or an " "integer in the range 0 to 255." msgstr "" -"A subsequência a ser procurada poderá ser qualquer :term:`objeto byte ou " -"similar ` ou um inteiro no intervalo de 0 a 255." +"A subsequência a ser procurada poderá ser qualquer :term:`objeto bytes ou " +"similar` ou um inteiro no intervalo de 0 a 255." -#: ../../library/stdtypes.rst:2768 +#: ../../builtins/stdtypes.rst:3358 msgid "" "If *sub* is empty, returns the number of empty slices between characters " "which is the length of the bytes object plus one." @@ -4630,14 +6130,14 @@ msgstr "" "Se *sub* estiver vazio, retorna o número de fatias vazias entre os " "caracteres, que é o comprimento do objeto bytes mais um." -#: ../../library/stdtypes.rst:2771 ../../library/stdtypes.rst:2882 -#: ../../library/stdtypes.rst:2895 ../../library/stdtypes.rst:2961 -#: ../../library/stdtypes.rst:2974 +#: ../../builtins/stdtypes.rst:3361 ../../builtins/stdtypes.rst:3472 +#: ../../builtins/stdtypes.rst:3485 ../../builtins/stdtypes.rst:3551 +#: ../../builtins/stdtypes.rst:3564 msgid "Also accept an integer in the range 0 to 255 as the subsequence." msgstr "" "Também aceita um número inteiro no intervalo de 0 a 255 como subsequência." -#: ../../library/stdtypes.rst:2778 +#: ../../builtins/stdtypes.rst:3368 msgid "" "If the binary data starts with the *prefix* string, return " "``bytes[len(prefix):]``. Otherwise, return a copy of the original binary " @@ -4647,21 +6147,31 @@ msgstr "" "``bytes[len(prefix):]``. Caso contrário, retorna uma cópia dos dados " "binários originais::" -#: ../../library/stdtypes.rst:2787 -msgid "The *prefix* may be any :term:`bytes-like object`." +#: ../../builtins/stdtypes.rst:3372 +msgid "" +">>> b'TestHook'.removeprefix(b'Test')\n" +"b'Hook'\n" +">>> b'BaseTestCase'.removeprefix(b'Test')\n" +"b'BaseTestCase'" msgstr "" -"O *prefix* pode ser qualquer :term:`objeto byte ou similar `." +">>> b'TestHook'.removeprefix(b'Test')\n" +"b'Hook'\n" +">>> b'BaseTestCase'.removeprefix(b'Test')\n" +"b'BaseTestCase'" -#: ../../library/stdtypes.rst:2791 ../../library/stdtypes.rst:2813 -#: ../../library/stdtypes.rst:2946 ../../library/stdtypes.rst:3039 -#: ../../library/stdtypes.rst:3053 ../../library/stdtypes.rst:3084 -#: ../../library/stdtypes.rst:3098 ../../library/stdtypes.rst:3140 -#: ../../library/stdtypes.rst:3211 ../../library/stdtypes.rst:3229 -#: ../../library/stdtypes.rst:3257 ../../library/stdtypes.rst:3396 -#: ../../library/stdtypes.rst:3451 ../../library/stdtypes.rst:3494 -#: ../../library/stdtypes.rst:3515 ../../library/stdtypes.rst:3537 -#: ../../library/stdtypes.rst:3739 +#: ../../builtins/stdtypes.rst:3377 +msgid "The *prefix* may be any :term:`bytes-like object`." +msgstr "O *prefix* pode ser qualquer :term:`objeto bytes ou similar`." + +#: ../../builtins/stdtypes.rst:3381 ../../builtins/stdtypes.rst:3403 +#: ../../builtins/stdtypes.rst:3536 ../../builtins/stdtypes.rst:3629 +#: ../../builtins/stdtypes.rst:3643 ../../builtins/stdtypes.rst:3674 +#: ../../builtins/stdtypes.rst:3688 ../../builtins/stdtypes.rst:3731 +#: ../../builtins/stdtypes.rst:3803 ../../builtins/stdtypes.rst:3821 +#: ../../builtins/stdtypes.rst:3849 ../../builtins/stdtypes.rst:3988 +#: ../../builtins/stdtypes.rst:4043 ../../builtins/stdtypes.rst:4086 +#: ../../builtins/stdtypes.rst:4107 ../../builtins/stdtypes.rst:4129 +#: ../../builtins/stdtypes.rst:4331 msgid "" "The bytearray version of this method does *not* operate in place - it always " "produces a new object, even if no changes were made." @@ -4669,7 +6179,7 @@ msgstr "" "A versão Bytearray deste método *não* opera no local -- o mesmo sempre " "produz um novo objeto, mesmo que não tenha sido feitas alterações." -#: ../../library/stdtypes.rst:2800 +#: ../../builtins/stdtypes.rst:3390 msgid "" "If the binary data ends with the *suffix* string and that *suffix* is not " "empty, return ``bytes[:-len(suffix)]``. Otherwise, return a copy of the " @@ -4679,22 +6189,32 @@ msgstr "" "estiver vazia, retorna ``bytes[:-len(suffix)]``. Caso contrário, retorna uma " "cópia dos dados binários originais::" -#: ../../library/stdtypes.rst:2809 -msgid "The *suffix* may be any :term:`bytes-like object`." +#: ../../builtins/stdtypes.rst:3394 +msgid "" +">>> b'MiscTests'.removesuffix(b'Tests')\n" +"b'Misc'\n" +">>> b'TmpDirMixin'.removesuffix(b'Tests')\n" +"b'TmpDirMixin'" msgstr "" -"O *suffix* pode ser qualquer :term:`objeto byte ou similar `." +">>> b'MiscTests'.removesuffix(b'Tests')\n" +"b'Misc'\n" +">>> b'TmpDirMixin'.removesuffix(b'Tests')\n" +"b'TmpDirMixin'" -#: ../../library/stdtypes.rst:2822 +#: ../../builtins/stdtypes.rst:3399 +msgid "The *suffix* may be any :term:`bytes-like object`." +msgstr "O *suffix* pode ser qualquer :term:`objeto bytes ou similar`." + +#: ../../builtins/stdtypes.rst:3412 msgid "Return the bytes decoded to a :class:`str`." msgstr "Retorna os bytes decodificados para uma :class:`str`." -#: ../../library/stdtypes.rst:2827 +#: ../../builtins/stdtypes.rst:3417 msgid "" "*errors* controls how decoding errors are handled. If ``'strict'`` (the " "default), a :exc:`UnicodeError` exception is raised. Other possible values " -"are ``'ignore'``, ``'replace'``, and any other name registered via :func:" -"`codecs.register_error`. See :ref:`error-handlers` for details." +"are ``'ignore'``, ``'replace'``, and any other name registered " +"via :func:`codecs.register_error`. See :ref:`error-handlers` for details." msgstr "" "*errors* controla como os erros de decodificação são tratados. Se " "``'strict'`` (o padrão), uma exceção :exc:`UnicodeError` é levantada. Outros " @@ -4702,28 +6222,28 @@ msgstr "" "registrado via :func:`codecs.register_error`. Veja :ref:`error-handlers` " "para detalhes." -#: ../../library/stdtypes.rst:2833 +#: ../../builtins/stdtypes.rst:3423 msgid "" "For performance reasons, the value of *errors* is not checked for validity " -"unless a decoding error actually occurs, :ref:`devmode` is enabled or a :ref:" -"`debug build ` is used." +"unless a decoding error actually occurs, :ref:`devmode` is enabled or " +"a :ref:`debug build ` is used." msgstr "" "Por motivos de desempenho, o valor de *errors* não é verificado quanto à " -"validade, a menos que um erro de decodificação realmente ocorra, :ref:" -"`devmode` esteja ativado ou uma :ref:`construção de depuração ` " -"seja usada." +"validade, a menos que um erro de decodificação realmente " +"ocorra, :ref:`devmode` esteja ativado ou uma :ref:`construção de depuração " +"` seja usada." -#: ../../library/stdtypes.rst:2839 +#: ../../builtins/stdtypes.rst:3429 msgid "" -"Passing the *encoding* argument to :class:`str` allows decoding any :term:" -"`bytes-like object` directly, without needing to make a temporary :class:`!" -"bytes` or :class:`!bytearray` object." +"Passing the *encoding* argument to :class:`str` allows decoding " +"any :term:`bytes-like object` directly, without needing to make a " +"temporary :class:`!bytes` or :class:`!bytearray` object." msgstr "" "Passar o argumento *encoding* para :class:`str` permite decodificar qualquer " -"objeto :term:`objeto byte ou similar` diretamente, sem a necessidade de " +"objeto :term:`objeto bytes ou similar` diretamente, sem a necessidade de " "criar um objeto :class:`!bytes` ou :class:`!bytearray` temporário." -#: ../../library/stdtypes.rst:2854 +#: ../../builtins/stdtypes.rst:3444 msgid "" "Return ``True`` if the binary data ends with the specified *suffix*, " "otherwise return ``False``. *suffix* can also be a tuple of suffixes to " @@ -4736,13 +6256,13 @@ msgstr "" "começa naquela posição. Com o parâmetro opcional *end*, o método encerra a " "comparação na posição fornecida." -#: ../../library/stdtypes.rst:2859 +#: ../../builtins/stdtypes.rst:3449 msgid "The suffix(es) to search for may be any :term:`bytes-like object`." msgstr "" -"O sufixo(es) para buscas pode ser qualquer termos :term:`objeto byte ou " -"similar `." +"O sufixo(es) para buscas pode ser qualquer termos :term:`objeto bytes ou " +"similar`." -#: ../../library/stdtypes.rst:2865 +#: ../../builtins/stdtypes.rst:3455 msgid "" "Return the lowest index in the data where the subsequence *sub* is found, " "such that *sub* is contained in the slice ``s[start:end]``. Optional " @@ -4754,17 +6274,25 @@ msgstr "" "opcionais *start* e *end* são interpretados como na notação de fatiamento. " "Retorna ``-1`` se *sub* não for localizada." -#: ../../library/stdtypes.rst:2875 +#: ../../builtins/stdtypes.rst:3465 msgid "" "The :meth:`~bytes.find` method should be used only if you need to know the " -"position of *sub*. To check if *sub* is a substring or not, use the :" -"keyword:`in` operator::" +"position of *sub*. To check if *sub* is a substring or not, use " +"the :keyword:`in` operator::" msgstr "" "O método :meth:`~bytes.find` deve ser usado apenas se você precisa saber a " "posição de *sub*. Para verificar se *sub* é uma substring ou não, use o " "operador :keyword:`in`::" -#: ../../library/stdtypes.rst:2889 +#: ../../builtins/stdtypes.rst:3469 +msgid "" +">>> b'Py' in b'Python'\n" +"True" +msgstr "" +">>> b'Py' in b'Python'\n" +"True" + +#: ../../builtins/stdtypes.rst:3479 msgid "" "Like :meth:`~bytes.find`, but raise :exc:`ValueError` when the subsequence " "is not found." @@ -4772,7 +6300,7 @@ msgstr "" "Como :meth:`~bytes.find`, mas levanta a exceção :exc:`ValueError` quando a " "subsequência não for encontrada." -#: ../../library/stdtypes.rst:2902 +#: ../../builtins/stdtypes.rst:3492 msgid "" "Return a bytes or bytearray object which is the concatenation of the binary " "data sequences in *iterable*. A :exc:`TypeError` will be raised if there " @@ -4782,25 +6310,26 @@ msgid "" "method." msgstr "" "Retorna um objeto bytes ou bytearray que é a concatenação das sequências de " -"dados binários no *iterável*. Um :exc:`TypeError` será levantado se " -"existirem quaisquer valores que não sejam :term:`objeto byte ou similar " -"`, no *iterável*, incluindo objetos :class:`str`. O " -"separador entre elementos é o conteúdo do objeto bytes ou bytearray que está " +"dados binários no iterável *iterable*. Uma exceção :exc:`TypeError` será " +"levantada se existirem quaisquer valores que não sejam :term:`objeto bytes " +"ou similar`, no *iterable*, incluindo objetos :class:`str`. O separador " +"entre elementos é o conteúdo do objeto bytes ou bytearray que está " "fornecendo este método." -#: ../../library/stdtypes.rst:2913 +#: ../../builtins/stdtypes.rst:3503 msgid "" -"This static method returns a translation table usable for :meth:`bytes." -"translate` that will map each character in *from* into the character at the " -"same position in *to*; *from* and *to* must both be :term:`bytes-like " -"objects ` and have the same length." +"This static method returns a translation table usable " +"for :meth:`bytes.translate` that will map each character in *from* into the " +"character at the same position in *to*; *from* and *to* must both " +"be :term:`bytes-like objects ` and have the same length." msgstr "" -"Este método estático retorna uma tabela de tradução usável para :meth:`bytes." -"translate`, que irá mapear cada caractere em *from* no caractere na mesma " -"posição em *to*; *from* e *to* devem ambos ser :term:`objeto byte ou similar " -"` e ter o mesmo comprimento." +"Este método estático retorna uma tabela de tradução usável " +"para :meth:`bytes.translate`, que irá mapear cada caractere em *from* no " +"caractere na mesma posição em *to*; *from* e *to* devem ambos " +"ser :term:`objetos bytes ou similares ` e ter o mesmo " +"comprimento." -#: ../../library/stdtypes.rst:2924 +#: ../../builtins/stdtypes.rst:3514 msgid "" "Split the sequence at the first occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself or its " @@ -4814,13 +6343,12 @@ msgstr "" "com 3 elementos contendo uma cópia da sequência original, seguido de dois " "bytes ou objetos bytearray vazios." -#: ../../library/stdtypes.rst:2931 ../../library/stdtypes.rst:2988 +#: ../../builtins/stdtypes.rst:3521 ../../builtins/stdtypes.rst:3578 msgid "The separator to search for may be any :term:`bytes-like object`." msgstr "" -"O separador para buscar pode ser qualquer termos :term:`objeto byte ou " -"similar `." +"O separador para buscar pode ser qualquer :term:`objeto bytes ou similar`." -#: ../../library/stdtypes.rst:2937 +#: ../../builtins/stdtypes.rst:3527 msgid "" "Return a copy of the sequence with all occurrences of subsequence *old* " "replaced by *new*. If the optional argument *count* is given, only the " @@ -4830,15 +6358,15 @@ msgstr "" "*antigas* substituídas por *novo*. Se o argumento opcional *count* for " "fornecido, apenas as primeiras ocorrências de *count* serão substituídas." -#: ../../library/stdtypes.rst:2941 +#: ../../builtins/stdtypes.rst:3531 msgid "" "The subsequence to search for and its replacement may be any :term:`bytes-" "like object`." msgstr "" -"A subsequência para buscar e substituição pode ser qualquer termos :term:" -"`objeto byte ou similar `." +"A subsequência para buscar e substituição pode ser qualquer " +"termos :term:`objeto bytes ou similar`." -#: ../../library/stdtypes.rst:2953 +#: ../../builtins/stdtypes.rst:3543 msgid "" "Return the highest index in the sequence where the subsequence *sub* is " "found, such that *sub* is contained within ``s[start:end]``. Optional " @@ -4850,7 +6378,7 @@ msgstr "" "argumentos opcionais *start* e *end* são interpretados como na notação de " "fatiamento. Caso ocorra algum problema será retornado ``-1``." -#: ../../library/stdtypes.rst:2968 +#: ../../builtins/stdtypes.rst:3558 msgid "" "Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence " "*sub* is not found." @@ -4858,7 +6386,7 @@ msgstr "" "Semelhante a :meth:`~bytes.rfind` mas levanta :exc:`ValueError` quando a " "subsequência *sub* não é encontrada." -#: ../../library/stdtypes.rst:2981 +#: ../../builtins/stdtypes.rst:3571 msgid "" "Split the sequence at the last occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself or its " @@ -4872,7 +6400,7 @@ msgstr "" "com 3 elementos contendo dois bytes ou objetos bytearray vazios, seguido por " "uma cópia da sequência original." -#: ../../library/stdtypes.rst:2994 +#: ../../builtins/stdtypes.rst:3584 msgid "" "Return ``True`` if the binary data starts with the specified *prefix*, " "otherwise return ``False``. *prefix* can also be a tuple of prefixes to " @@ -4885,13 +6413,13 @@ msgstr "" "na posição indicada. Com o parâmetro opcional *end*, encerra a procura na " "posição indicada." -#: ../../library/stdtypes.rst:2999 +#: ../../builtins/stdtypes.rst:3589 msgid "The prefix(es) to search for may be any :term:`bytes-like object`." msgstr "" -"Os prefixos para pesquisar podem ser qualquer :term:`objeto byte ou similar " -"`." +"Os prefixos para pesquisar podem ser qualquer :term:`objeto bytes ou " +"similar`." -#: ../../library/stdtypes.rst:3005 +#: ../../builtins/stdtypes.rst:3595 msgid "" "Return a copy of the bytes or bytearray object where all bytes occurring in " "the optional argument *delete* are removed, and the remaining bytes have " @@ -4903,14 +6431,14 @@ msgstr "" "foram mapeados através da tabela de tradução fornecida, a qual deve ser um " "objeto bytes de comprimento 256." -#: ../../library/stdtypes.rst:3010 +#: ../../builtins/stdtypes.rst:3600 msgid "" "You can use the :func:`bytes.maketrans` method to create a translation table." msgstr "" "Você pode usar o método :func:`bytes.maketrans` para criar uma tabela de " "tradução." -#: ../../library/stdtypes.rst:3013 +#: ../../builtins/stdtypes.rst:3603 msgid "" "Set the *table* argument to ``None`` for translations that only delete " "characters::" @@ -4918,11 +6446,19 @@ msgstr "" "Define o argumento *table* como ``None`` para traduções que excluem apenas " "caracteres::" -#: ../../library/stdtypes.rst:3019 +#: ../../builtins/stdtypes.rst:3606 +msgid "" +">>> b'read this short text'.translate(None, b'aeiou')\n" +"b'rd ths shrt txt'" +msgstr "" +">>> b'leia este curto texto'.translate(None, b'aeiou')\n" +"b'l st crt txt'" + +#: ../../builtins/stdtypes.rst:3609 msgid "*delete* is now supported as a keyword argument." msgstr "*delete* agora é suportado como um argumento nomeado." -#: ../../library/stdtypes.rst:3023 +#: ../../builtins/stdtypes.rst:3613 msgid "" "The following methods on bytes and bytearray objects have default behaviours " "that assume the use of ASCII compatible binary formats, but can still be " @@ -4936,7 +6472,7 @@ msgstr "" "argumentos apropriados. Perceba que todos os métodos de bytearray nesta " "seção *não* alteram os argumentos, e ao invés disso produzem novos objetos." -#: ../../library/stdtypes.rst:3032 +#: ../../builtins/stdtypes.rst:3622 msgid "" "Return a copy of the object centered in a sequence of length *width*. " "Padding is done using the specified *fillbyte* (default is an ASCII space). " @@ -4948,7 +6484,7 @@ msgstr "" "um espaço ASCII). Para objetos :class:`bytes`, a sequência original é " "retornada se *width* é menor que ou igual a ``len(s)``." -#: ../../library/stdtypes.rst:3046 +#: ../../builtins/stdtypes.rst:3636 msgid "" "Return a copy of the object left justified in a sequence of length *width*. " "Padding is done using the specified *fillbyte* (default is an ASCII space). " @@ -4960,35 +6496,58 @@ msgstr "" "(o padrão é um espaço ASCII). Para objetos :class:`bytes`, a sequência " "original é retornada se *width* é menor que ou igual a ``len(s)``." -#: ../../library/stdtypes.rst:3060 +#: ../../builtins/stdtypes.rst:3650 msgid "" "Return a copy of the sequence with specified leading bytes removed. The " -"*chars* argument is a binary sequence specifying the set of byte values to " -"be removed - the name refers to the fact this method is usually used with " -"ASCII characters. If omitted or ``None``, the *chars* argument defaults to " -"removing ASCII whitespace. The *chars* argument is not a prefix; rather, " -"all combinations of its values are stripped::" -msgstr "" -"Retorna uma cópia da sequência com bytes especificados no início removidos. " -"O argumento *chars* é uma sequência binária que especifica o conjunto de " -"bytes a serem removidos - o nome refere-se ao fato de este método é " -"usualmente utilizado com caracteres ASCII. Se for omitido ou for ``None``, o " -"argumento *chars* irá remover por padrão os espaços em branco ASCII. O " -"argumento *chars* não é um prefixo; ao contrário disso, todas as combinações " -"dos seus seus valores são removidas::" - -#: ../../library/stdtypes.rst:3072 +"*bytes* argument is a binary sequence specifying the set of byte values to " +"be removed. If omitted or ``None``, the *bytes* argument defaults to " +"removing :meth:`ASCII whitespace `. The *bytes* argument is " +"not a prefix; rather, all combinations of its values are stripped::" +msgstr "" +"Retorna uma cópia da sequência com bytes iniciais especificados removidos. O " +"argumento *bytes* é uma sequência binária que especifica o conjunto de " +"valores de bytes a serem removidos. Se for omitido ou se for ``None``, o " +"argumento *bytes* será considerado como :meth:`espaço em branco ASCII " +"` por padrão para a remoção. O argumento *bytes* não é um " +"prefixo; ao invés disso, todas as combinações dos seus valores são " +"removidas::" + +#: ../../builtins/stdtypes.rst:3657 +msgid "" +">>> b' spacious '.lstrip()\n" +"b'spacious '\n" +">>> b'www.example.com'.lstrip(b'cmowz.')\n" +"b'example.com'" +msgstr "" +">>> b' spacious '.lstrip()\n" +"b'spacious '\n" +">>> b'www.example.com'.lstrip(b'cmowz.')\n" +"b'example.com'" + +#: ../../builtins/stdtypes.rst:3662 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`. See :meth:`~bytes.removeprefix` for a method that will remove a " "single prefix string rather than all of a set of characters. For example::" msgstr "" -"A sequência binária de valores de bytes a serem removidos pode ser :term:" -"`objeto byte ou similar `. Consulte :meth:`~bytes." -"removeprefix` para um método que removerá uma única string de prefixo em vez " -"de todo um conjunto de caracteres. Por exemplo::" +"A sequência binária de valores de bytes a serem removidos pode " +"ser :term:`objeto bytes ou similar`. Consulte :meth:`~bytes.removeprefix` " +"para um método que removerá uma única string de prefixo em vez de todo um " +"conjunto de caracteres. Por exemplo::" -#: ../../library/stdtypes.rst:3091 +#: ../../builtins/stdtypes.rst:3667 +msgid "" +">>> b'Arthur: three!'.lstrip(b'Arthur: ')\n" +"b'ee!'\n" +">>> b'Arthur: three!'.removeprefix(b'Arthur: ')\n" +"b'three!'" +msgstr "" +">>> b'Arthur: three!'.lstrip(b'Arthur: ')\n" +"b'ee!'\n" +">>> b'Arthur: three!'.removeprefix(b'Arthur: ')\n" +"b'three!'" + +#: ../../builtins/stdtypes.rst:3681 msgid "" "Return a copy of the object right justified in a sequence of length *width*. " "Padding is done using the specified *fillbyte* (default is an ASCII space). " @@ -5000,52 +6559,74 @@ msgstr "" "(o padrão é um espaço ASCII). Para objetos :class:`bytes`, a sequência " "original é retornada se *width* é menor que ou igual a ``len(s)``." -#: ../../library/stdtypes.rst:3105 +#: ../../builtins/stdtypes.rst:3695 msgid "" "Split the binary sequence into subsequences of the same type, using *sep* as " "the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are " "done, the *rightmost* ones. If *sep* is not specified or ``None``, any " -"subsequence consisting solely of ASCII whitespace is a separator. Except for " -"splitting from the right, :meth:`rsplit` behaves like :meth:`split` which is " -"described in detail below." +"subsequence consisting solely of :meth:`ASCII whitespace ` is " +"a separator. Except for splitting from the right, :meth:`rsplit` behaves " +"like :meth:`split` which is described in detail below." msgstr "" "Divide a sequência binária em subsequência do mesmo tipo, usando *sep* como " "um delimitador de string. Se *maxsplit* é fornecido, no máximo *maxsplit* " "divisões são feitas, aquelas que estão *mais à direita*. Se *sep* não é " -"especificado ou é ``None``, qualquer subsequência consistindo unicamente de " -"espaço em branco ASCII é um separador. Exceto por dividir pela direita, :" -"meth:`rsplit` comporta-se como :meth:`split`, o qual é descrito em detalhes " -"abaixo." +"especificado ou é ``None``, qualquer subsequência consistindo unicamente " +"de :meth:`espaço em branco ASCII ` é um separador. Exceto por " +"dividir pela direita, :meth:`rsplit` comporta-se como :meth:`split`, o qual " +"é descrito em detalhes abaixo." -#: ../../library/stdtypes.rst:3116 +#: ../../builtins/stdtypes.rst:3707 msgid "" "Return a copy of the sequence with specified trailing bytes removed. The " -"*chars* argument is a binary sequence specifying the set of byte values to " -"be removed - the name refers to the fact this method is usually used with " -"ASCII characters. If omitted or ``None``, the *chars* argument defaults to " -"removing ASCII whitespace. The *chars* argument is not a suffix; rather, " -"all combinations of its values are stripped::" -msgstr "" -"Retorna uma cópia da sequência com bytes especificados no final removidos. O " -"argumento *chars* é uma sequência binária que especifica o conjunto de bytes " -"a serem removidos - o nome refere-se ao fato de este método é usualmente " -"utilizado com caracteres ASCII. Se for omitido ou for ``None``, o argumento " -"*chars* irá remover por padrão os espaços em branco ASCII. O argumento " -"*chars* não é um sufixo; ao contrário disso, todas as combinações dos seus " -"seus valores são removidas::" - -#: ../../library/stdtypes.rst:3128 +"*bytes* argument is a binary sequence specifying the set of byte values to " +"be removed. If omitted or ``None``, the *bytes* argument defaults to " +"removing :meth:`ASCII whitespace `. The *bytes* argument is " +"not a suffix; rather, all combinations of its values are stripped::" +msgstr "" +"Retorna uma cópia da sequência com bytes ao final especificados removidos. O " +"argumento *bytes* é uma sequência binária que especifica o conjunto de " +"valores de bytes a serem removidos. Se for omitido ou se for ``None``, o " +"argumento *bytes* será considerado como :meth:`espaço em branco ASCII " +"` por padrão para a remoção. O argumento *bytes* não é um " +"sufixo; ao invés disso, todas as combinações dos seus valores são removidas::" + +#: ../../builtins/stdtypes.rst:3714 +msgid "" +">>> b' spacious '.rstrip()\n" +"b' spacious'\n" +">>> b'mississippi'.rstrip(b'ipz')\n" +"b'mississ'" +msgstr "" +">>> b' spacious '.rstrip()\n" +"b' spacious'\n" +">>> b'mississippi'.rstrip(b'ipz')\n" +"b'mississ'" + +#: ../../builtins/stdtypes.rst:3719 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`. See :meth:`~bytes.removesuffix` for a method that will remove a " "single suffix string rather than all of a set of characters. For example::" msgstr "" -"A sequência binária de valores de bytes a serem removidos pode ser :term:" -"`objeto byte ou similar `. Consulte :meth:`~bytes." -"removesuffix` para um método que removerá uma única string de sufixo em vez " -"de todo um conjunto de caracteres. Por exemplo::" +"A sequência binária de valores de bytes a serem removidos pode " +"ser :term:`objeto bytes ou similar`. Consulte :meth:`~bytes.removesuffix` " +"para um método que removerá uma única string de sufixo em vez de todo um " +"conjunto de caracteres. Por exemplo::" + +#: ../../builtins/stdtypes.rst:3724 +msgid "" +">>> b'Monty Python'.rstrip(b' Python')\n" +"b'M'\n" +">>> b'Monty Python'.removesuffix(b' Python')\n" +"b'Monty'" +msgstr "" +">>> b'Monty Python'.rstrip(b' Python')\n" +"b'M'\n" +">>> b'Monty Python'.removesuffix(b' Python')\n" +"b'Monty'" -#: ../../library/stdtypes.rst:3147 +#: ../../builtins/stdtypes.rst:3738 msgid "" "Split the binary sequence into subsequences of the same type, using *sep* as " "the delimiter string. If *maxsplit* is given and non-negative, at most " @@ -5059,7 +6640,7 @@ msgstr "" "elementos). Se *maxsplit* não é especificado ou é ``-1``, então não existe " "limite no número de divisões (todas as divisões possíveis são feitas)." -#: ../../library/stdtypes.rst:3153 +#: ../../builtins/stdtypes.rst:3744 msgid "" "If *sep* is given, consecutive delimiters are not grouped together and are " "deemed to delimit empty subsequences (for example, ``b'1,,2'.split(b',')`` " @@ -5070,57 +6651,105 @@ msgid "" "like object`." msgstr "" "Se *sep* é fornecido, delimitadores consecutivos não são agrupados juntos e " -"eles são destinados para delimitar strings vazias (por exemplo, ``b'1,,2'." -"split(b',')`` retorna ``[b'1', b'', b'2']``). O argumento *sep* pode " -"consistir de uma sequência de múltiplos bytes como um único delimitador. " -"Separar uma sequência vazia com um separador especificado retorna ``[b'']`` " -"ou ``[bytearray(b'')]`` dependendo do tipo do objeto que está sendo " -"separado. O argumento *sep* pode ser qualquer :term:`objeto byte ou similar " -"`." - -#: ../../library/stdtypes.rst:3172 +"eles são destinados para delimitar strings vazias (por exemplo, " +"``b'1,,2'.split(b',')`` retorna ``[b'1', b'', b'2']``). O argumento *sep* " +"pode consistir de uma sequência de múltiplos bytes como um único " +"delimitador. Separar uma sequência vazia com um separador especificado " +"retorna ``[b'']`` ou ``[bytearray(b'')]`` dependendo do tipo do objeto que " +"está sendo separado. O argumento *sep* pode ser qualquer :term:`objeto bytes " +"ou similar`." + +#: ../../builtins/stdtypes.rst:3754 +msgid "" +">>> b'1,2,3'.split(b',')\n" +"[b'1', b'2', b'3']\n" +">>> b'1,2,3'.split(b',', maxsplit=1)\n" +"[b'1', b'2,3']\n" +">>> b'1,2,,3,'.split(b',')\n" +"[b'1', b'2', b'', b'3', b'']\n" +">>> b'1<>2<>3<4'.split(b'<>')\n" +"[b'1', b'2', b'3<4']" +msgstr "" +">>> b'1,2,3'.split(b',')\n" +"[b'1', b'2', b'3']\n" +">>> b'1,2,3'.split(b',', maxsplit=1)\n" +"[b'1', b'2,3']\n" +">>> b'1,2,,3,'.split(b',')\n" +"[b'1', b'2', b'', b'3', b'']\n" +">>> b'1<>2<>3<4'.split(b'<>')\n" +"[b'1', b'2', b'3<4']" + +#: ../../builtins/stdtypes.rst:3763 msgid "" "If *sep* is not specified or is ``None``, a different splitting algorithm is " -"applied: runs of consecutive ASCII whitespace are regarded as a single " -"separator, and the result will contain no empty strings at the start or end " -"if the sequence has leading or trailing whitespace. Consequently, splitting " -"an empty sequence or a sequence consisting solely of ASCII whitespace " -"without a specified separator returns ``[]``." +"applied: runs of consecutive :meth:`ASCII whitespace ` are " +"regarded as a single separator, and the result will contain no empty strings " +"at the start or end if the sequence has leading or trailing whitespace. " +"Consequently, splitting an empty sequence or a sequence consisting solely of " +"ASCII whitespace without a specified separator returns ``[]``." msgstr "" "Se *sep* não for especificado ou for ``None``, um algoritmo diferente de " -"separação é aplicado: ocorrências consecutivas de espaços em branco ASCII " -"são consideradas como um separador único, e o resultado não conterá strings " -"vazias no início ou no final, se a sequência tiver espaços em branco no " -"início ou no final. Consequentemente, separar uma sequência vazia ou uma " -"sequência que consiste apenas de espaços em branco ASCII sem um separador " -"especificado, retorna ``[]``." - -#: ../../library/stdtypes.rst:3193 +"separação é aplicado: ocorrências consecutivas de :meth:`espaços em branco " +"ASCII ` são consideradas como um separador único, e o " +"resultado não conterá strings vazias no início ou no final, se a sequência " +"tiver espaços em branco no início ou no final. Consequentemente, separar uma " +"sequência vazia ou uma sequência que consiste apenas de espaços em branco " +"ASCII sem um separador especificado, retorna ``[]``." + +#: ../../builtins/stdtypes.rst:3774 +msgid "" +">>> b'1 2 3'.split()\n" +"[b'1', b'2', b'3']\n" +">>> b'1 2 3'.split(maxsplit=1)\n" +"[b'1', b'2 3']\n" +">>> b' 1 2 3 '.split()\n" +"[b'1', b'2', b'3']" +msgstr "" +">>> b'1 2 3'.split()\n" +"[b'1', b'2', b'3']\n" +">>> b'1 2 3'.split(maxsplit=1)\n" +"[b'1', b'2 3']\n" +">>> b' 1 2 3 '.split()\n" +"[b'1', b'2', b'3']" + +#: ../../builtins/stdtypes.rst:3785 msgid "" "Return a copy of the sequence with specified leading and trailing bytes " -"removed. The *chars* argument is a binary sequence specifying the set of " -"byte values to be removed - the name refers to the fact this method is " -"usually used with ASCII characters. If omitted or ``None``, the *chars* " -"argument defaults to removing ASCII whitespace. The *chars* argument is not " -"a prefix or suffix; rather, all combinations of its values are stripped::" -msgstr "" -"Retorna uma cópia da sequência com os bytes especificados no início e no " -"final removidos. O argumento *chars* é uma sequência binária que especifica " -"o conjunto de bytes a serem removidos - o nome refere-se ao fato que este " -"método é normalmente utilizado com caracteres ASCII. Se for omitido ou for " -"``None``, o argumento *chars* irá remover por padrão os espaços em branco " -"ASCII. O argumento *chars* não é um prefixo, nem um sufixo; ao contrário " -"disso, todas as combinações dos seus seus valores são removidas::" - -#: ../../library/stdtypes.rst:3206 +"removed. The *bytes* argument is a binary sequence specifying the set of " +"byte values to be removed. If omitted or ``None``, the *bytes* argument " +"defaults to removing :meth:`ASCII whitespace `. The *bytes* " +"argument is not a prefix or suffix; rather, all combinations of its values " +"are stripped::" +msgstr "" +"Retorna uma cópia da sequência com bytes iniciais e ao final especificados " +"removidos. O argumento *bytes* é uma sequência binária que especifica o " +"conjunto de valores de bytes a serem removidos. Se for omitido ou se for " +"``None``, o argumento *bytes* será considerado como :meth:`espaço em branco " +"ASCII ` por padrão para a remoção. O argumento *bytes* não é " +"um prefixo e sufixo; ao invés disso, todas as combinações dos seus valores " +"são removidas::" + +#: ../../builtins/stdtypes.rst:3793 +msgid "" +">>> b' spacious '.strip()\n" +"b'spacious'\n" +">>> b'www.example.com'.strip(b'cmowz.')\n" +"b'example'" +msgstr "" +">>> b' spacious '.strip()\n" +"b'spacious'\n" +">>> b'www.example.com'.strip(b'cmowz.')\n" +"b'example'" + +#: ../../builtins/stdtypes.rst:3798 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`." msgstr "" -"A sequência binária de valores de bytes a serem removidos pode ser qualquer :" -"term:`objeto byte ou similar `." +"A sequência binária de valores de bytes a serem removidos pode ser " +"qualquer :term:`objeto bytes ou similar`." -#: ../../library/stdtypes.rst:3215 +#: ../../builtins/stdtypes.rst:3807 msgid "" "The following methods on bytes and bytearray objects assume the use of ASCII " "compatible binary formats and should not be applied to arbitrary binary " @@ -5132,7 +6761,7 @@ msgstr "" "arbitrários. Perceba que todos os métodos de bytearray nesta seção *não* " "alteram os argumentos, e ao invés disso produzem novos objetos." -#: ../../library/stdtypes.rst:3223 +#: ../../builtins/stdtypes.rst:3815 msgid "" "Return a copy of the sequence with each byte interpreted as an ASCII " "character, and the first byte capitalized and the rest lowercased. Non-ASCII " @@ -5142,7 +6771,7 @@ msgstr "" "ASCII, e o primeiro byte em letra maiúscula e o resto em letras minúsculas. " "Valores de bytes que não são ASCII são passados adiante sem mudanças." -#: ../../library/stdtypes.rst:3236 +#: ../../builtins/stdtypes.rst:3828 msgid "" "Return a copy of the sequence where all ASCII tab characters are replaced by " "one or more ASCII spaces, depending on the current column and the given tab " @@ -5172,7 +6801,19 @@ msgstr "" "incrementada em uma unidade independentemente de como o byte é representado " "quanto é impresso::" -#: ../../library/stdtypes.rst:3264 +#: ../../builtins/stdtypes.rst:3842 +msgid "" +">>> b'01\\t012\\t0123\\t01234'.expandtabs()\n" +"b'01 012 0123 01234'\n" +">>> b'01\\t012\\t0123\\t01234'.expandtabs(4)\n" +"b'01 012 0123 01234'" +msgstr "" +">>> b'01\\t012\\t0123\\t01234'.expandtabs()\n" +"b'01 012 0123 01234'\n" +">>> b'01\\t012\\t0123\\t01234'.expandtabs(4)\n" +"b'01 012 0123 01234'" + +#: ../../builtins/stdtypes.rst:3856 msgid "" "Return ``True`` if all bytes in the sequence are alphabetical ASCII " "characters or ASCII decimal digits and the sequence is not empty, ``False`` " @@ -5187,7 +6828,19 @@ msgstr "" "Dígitos decimais ASCII são aqueles valores de byte na sequência " "``b'0123456789'``." -#: ../../library/stdtypes.rst:3281 +#: ../../builtins/stdtypes.rst:3864 +msgid "" +">>> b'ABCabc1'.isalnum()\n" +"True\n" +">>> b'ABC abc1'.isalnum()\n" +"False" +msgstr "" +">>> b'ABCabc1'.isalnum()\n" +"True\n" +">>> b'ABC abc1'.isalnum()\n" +"False" + +#: ../../builtins/stdtypes.rst:3873 msgid "" "Return ``True`` if all bytes in the sequence are alphabetic ASCII characters " "and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII " @@ -5199,7 +6852,19 @@ msgstr "" "alfabéticos ASCII são aqueles cujo valor dos bytes estão na sequência " "``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``." -#: ../../library/stdtypes.rst:3297 +#: ../../builtins/stdtypes.rst:3880 +msgid "" +">>> b'ABCabc'.isalpha()\n" +"True\n" +">>> b'ABCabc1'.isalpha()\n" +"False" +msgstr "" +">>> b'ABCabc'.isalpha()\n" +"True\n" +">>> b'ABCabc1'.isalpha()\n" +"False" + +#: ../../builtins/stdtypes.rst:3889 msgid "" "Return ``True`` if the sequence is empty or all bytes in the sequence are " "ASCII, ``False`` otherwise. ASCII bytes are in the range 0-0x7F." @@ -5207,7 +6872,7 @@ msgstr "" "Retorna ``True`` se a sequência é vazia ou todos os bytes na sequência são " "ASCII, ``False`` caso contrário. Bytes ASCII estão no intervalo 0-0x7F." -#: ../../library/stdtypes.rst:3307 +#: ../../builtins/stdtypes.rst:3899 msgid "" "Return ``True`` if all bytes in the sequence are ASCII decimal digits and " "the sequence is not empty, ``False`` otherwise. ASCII decimal digits are " @@ -5217,7 +6882,19 @@ msgstr "" "a sequência não é vazia, ``False`` caso contrário. Dígitos decimais ASCII " "são aqueles cujos valores dos bytes estão na sequência ``b'0123456789'``." -#: ../../library/stdtypes.rst:3322 +#: ../../builtins/stdtypes.rst:3905 +msgid "" +">>> b'1234'.isdigit()\n" +"True\n" +">>> b'1.23'.isdigit()\n" +"False" +msgstr "" +">>> b'1234'.isdigit()\n" +"True\n" +">>> b'1.23'.isdigit()\n" +"False" + +#: ../../builtins/stdtypes.rst:3914 msgid "" "Return ``True`` if there is at least one lowercase ASCII character in the " "sequence and no uppercase ASCII characters, ``False`` otherwise." @@ -5225,9 +6902,21 @@ msgstr "" "Retorna ``True`` se existe pelo menos um caractere minúsculo ASCII na " "sequência e nenhum caractere maiúsculo ASCII, ``False`` caso contrário." -#: ../../library/stdtypes.rst:3332 ../../library/stdtypes.rst:3374 -#: ../../library/stdtypes.rst:3390 ../../library/stdtypes.rst:3440 -#: ../../library/stdtypes.rst:3509 +#: ../../builtins/stdtypes.rst:3919 +msgid "" +">>> b'hello world'.islower()\n" +"True\n" +">>> b'Hello world'.islower()\n" +"False" +msgstr "" +">>> b'hello world'.islower()\n" +"True\n" +">>> b'Hello world'.islower()\n" +"False" + +#: ../../builtins/stdtypes.rst:3924 ../../builtins/stdtypes.rst:3966 +#: ../../builtins/stdtypes.rst:3982 ../../builtins/stdtypes.rst:4032 +#: ../../builtins/stdtypes.rst:4101 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " @@ -5238,7 +6927,7 @@ msgstr "" "aqueles cujos valores de bytes estão na sequência " "``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``." -#: ../../library/stdtypes.rst:3340 +#: ../../builtins/stdtypes.rst:3932 msgid "" "Return ``True`` if all bytes in the sequence are ASCII whitespace and the " "sequence is not empty, ``False`` otherwise. ASCII whitespace characters are " @@ -5251,7 +6940,7 @@ msgstr "" "\\t\\n\\r\\x0b\\f'`` (espaço, tabulação, nova linha, retorno do cursor, " "tabulação vertical, formulário de entrada)." -#: ../../library/stdtypes.rst:3349 +#: ../../builtins/stdtypes.rst:3941 msgid "" "Return ``True`` if the sequence is ASCII titlecase and the sequence is not " "empty, ``False`` otherwise. See :meth:`bytes.title` for more details on the " @@ -5261,7 +6950,19 @@ msgstr "" "vazia, ``False`` caso contrário. Veja :meth:`bytes.title` para mais detalhes " "sobre a definição de \"titlecased\"." -#: ../../library/stdtypes.rst:3364 +#: ../../builtins/stdtypes.rst:3947 +msgid "" +">>> b'Hello World'.istitle()\n" +"True\n" +">>> b'Hello world'.istitle()\n" +"False" +msgstr "" +">>> b'Hello World'.istitle()\n" +"True\n" +">>> b'Hello world'.istitle()\n" +"False" + +#: ../../builtins/stdtypes.rst:3956 msgid "" "Return ``True`` if there is at least one uppercase alphabetic ASCII " "character in the sequence and no lowercase ASCII characters, ``False`` " @@ -5271,7 +6972,19 @@ msgstr "" "ASCII na sequência e nenhum caractere minúsculo ASCII, ``False`` caso " "contrário." -#: ../../library/stdtypes.rst:3382 +#: ../../builtins/stdtypes.rst:3961 +msgid "" +">>> b'HELLO WORLD'.isupper()\n" +"True\n" +">>> b'Hello world'.isupper()\n" +"False" +msgstr "" +">>> b'HELLO WORLD'.isupper()\n" +"True\n" +">>> b'Hello world'.isupper()\n" +"False" + +#: ../../builtins/stdtypes.rst:3974 msgid "" "Return a copy of the sequence with all the uppercase ASCII characters " "converted to their corresponding lowercase counterpart." @@ -5279,7 +6992,15 @@ msgstr "" "Retorna uma cópia da sequência com todos os caracteres maiúsculos ASCII " "convertidos para os seus correspondentes caracteres minúsculos." -#: ../../library/stdtypes.rst:3407 +#: ../../builtins/stdtypes.rst:3979 +msgid "" +">>> b'Hello World'.lower()\n" +"b'hello world'" +msgstr "" +">>> b'Hello World'.lower()\n" +"b'hello world'" + +#: ../../builtins/stdtypes.rst:3999 msgid "" "Return a list of the lines in the binary sequence, breaking at ASCII line " "boundaries. This method uses the :term:`universal newlines` approach to " @@ -5292,7 +7013,19 @@ msgstr "" "não são incluídas na lista resultante a não ser que *keepends* seja " "fornecido e verdadeiro." -#: ../../library/stdtypes.rst:3419 +#: ../../builtins/stdtypes.rst:4006 +msgid "" +">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" +"[b'ab c', b'', b'de fg', b'kl']\n" +">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" +"[b'ab c\\n', b'\\n', b'de fg\\r', b'kl\\r\\n']" +msgstr "" +">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" +"[b'ab c', b'', b'de fg', b'kl']\n" +">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" +"[b'ab c\\n', b'\\n', b'de fg\\r', b'kl\\r\\n']" + +#: ../../builtins/stdtypes.rst:4011 msgid "" "Unlike :meth:`~bytes.split` when a delimiter string *sep* is given, this " "method returns an empty list for the empty string, and a terminal line break " @@ -5302,7 +7035,19 @@ msgstr "" "fornecida, este método retorna uma lista vazia para a string vazia, e uma " "quebra de linha terminal não resulta em uma linha extra::" -#: ../../library/stdtypes.rst:3432 +#: ../../builtins/stdtypes.rst:4015 +msgid "" +">>> b\"\".split(b'\\n'), b\"Two lines\\n\".split(b'\\n')\n" +"([b''], [b'Two lines', b''])\n" +">>> b\"\".splitlines(), b\"One line\\n\".splitlines()\n" +"([], [b'One line'])" +msgstr "" +">>> b\"\".split(b'\\n'), b\"Two lines\\n\".split(b'\\n')\n" +"([b''], [b'Two lines', b''])\n" +">>> b\"\".splitlines(), b\"One line\\n\".splitlines()\n" +"([], [b'One line'])" + +#: ../../builtins/stdtypes.rst:4024 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart and vice-versa." @@ -5310,19 +7055,27 @@ msgstr "" "Retorna uma cópia da sequência com todos os caracteres minúsculos ASCII " "convertidos para caracteres maiúsculos correspondentes, e vice-versa." -#: ../../library/stdtypes.rst:3444 +#: ../../builtins/stdtypes.rst:4029 +msgid "" +">>> b'Hello World'.swapcase()\n" +"b'hELLO wORLD'" +msgstr "" +">>> b'Hello World'.swapcase()\n" +"b'hELLO wORLD'" + +#: ../../builtins/stdtypes.rst:4036 msgid "" -"Unlike :func:`str.swapcase()`, it is always the case that ``bin.swapcase()." -"swapcase() == bin`` for the binary versions. Case conversions are " -"symmetrical in ASCII, even though that is not generally true for arbitrary " -"Unicode code points." +"Unlike :func:`str.swapcase`, it is always the case that " +"``bin.swapcase().swapcase() == bin`` for the binary versions. Case " +"conversions are symmetrical in ASCII, even though that is not generally true " +"for arbitrary Unicode code points." msgstr "" -"Ao contrário de :func:`str.swapcase()`, é sempre fato que ``bin.swapcase()." -"swapcase() == bin`` para as versões binárias. Conversões maiúsculas/" -"minúsculas são simétricas em ASCII, apesar que isso não é geralmente verdade " -"para pontos de codificação arbitrários Unicode." +"Ao contrário de :func:`str.swapcase`, é sempre fato que " +"``bin.swapcase().swapcase() == bin`` para as versões binárias. Conversões " +"maiúsculas/minúsculas são simétricas em ASCII, apesar que isso não é " +"geralmente verdade para pontos de código arbitrários Unicode." -#: ../../library/stdtypes.rst:3458 +#: ../../builtins/stdtypes.rst:4050 msgid "" "Return a titlecased version of the binary sequence where words start with an " "uppercase ASCII character and the remaining characters are lowercase. " @@ -5333,7 +7086,15 @@ msgstr "" "letras minúsculas. Bytes quem não possuem diferença entre maiúscula/" "minúscula não são alterados." -#: ../../library/stdtypes.rst:3467 +#: ../../builtins/stdtypes.rst:4056 +msgid "" +">>> b'Hello world'.title()\n" +"b'Hello World'" +msgstr "" +">>> b'Hello world'.title()\n" +"b'Hello World'" + +#: ../../builtins/stdtypes.rst:4059 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " @@ -5346,14 +7107,44 @@ msgstr "" "``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``. Todos os outros valores de bytes ignoram " "maiúsculas/minúsculas." -#: ../../library/stdtypes.rst:3480 +#: ../../builtins/stdtypes.rst:4069 +msgid "" +">>> b\"they're bill's friends from the UK\".title()\n" +"b\"They'Re Bill'S Friends From The Uk\"" +msgstr "" +">>> b\"they're bill's friends from the UK\".title()\n" +"b\"They'Re Bill'S Friends From The Uk\"" + +#: ../../builtins/stdtypes.rst:4072 msgid "" "A workaround for apostrophes can be constructed using regular expressions::" msgstr "" "Uma solução alternativa para os apóstrofes pode ser construída usando " "expressões regulares::" -#: ../../library/stdtypes.rst:3501 +#: ../../builtins/stdtypes.rst:4074 +msgid "" +">>> import re\n" +">>> def titlecase(s):\n" +"... return re.sub(rb\"[A-Za-z]+('[A-Za-z]+)?\",\n" +"... lambda mo: mo.group(0)[0:1].upper() +\n" +"... mo.group(0)[1:].lower(),\n" +"... s)\n" +"...\n" +">>> titlecase(b\"they're bill's friends.\")\n" +"b\"They're Bill's Friends.\"" +msgstr "" +">>> import re\n" +">>> def titlecase(s):\n" +"... return re.sub(rb\"[A-Za-z]+('[A-Za-z]+)?\",\n" +"... lambda mo: mo.group(0)[0:1].upper() +\n" +"... mo.group(0)[1:].lower(),\n" +"... s)\n" +"...\n" +">>> titlecase(b\"they're bill's friends.\")\n" +"b\"They're Bill's Friends.\"" + +#: ../../builtins/stdtypes.rst:4093 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart." @@ -5361,7 +7152,15 @@ msgstr "" "Retorna uma cópia da sequência com todos os caracteres minúsculos ASCII " "convertidos para sua contraparte maiúscula correspondente." -#: ../../library/stdtypes.rst:3522 +#: ../../builtins/stdtypes.rst:4098 +msgid "" +">>> b'Hello World'.upper()\n" +"b'HELLO WORLD'" +msgstr "" +">>> b'Hello World'.upper()\n" +"b'HELLO WORLD'" + +#: ../../builtins/stdtypes.rst:4114 msgid "" "Return a copy of the sequence left filled with ASCII ``b'0'`` digits to make " "a sequence of length *width*. A leading sign prefix (``b'+'``/ ``b'-'``) is " @@ -5376,11 +7175,23 @@ msgstr "" "objetos :class:`bytes`, a sequência original é retornada se *width* é menor " "que ou igual a ``len(seq)``." -#: ../../library/stdtypes.rst:3544 +#: ../../builtins/stdtypes.rst:4122 +msgid "" +">>> b\"42\".zfill(5)\n" +"b'00042'\n" +">>> b\"-42\".zfill(5)\n" +"b'-0042'" +msgstr "" +">>> b\"42\".zfill(5)\n" +"b'00042'\n" +">>> b\"-42\".zfill(5)\n" +"b'-0042'" + +#: ../../builtins/stdtypes.rst:4136 msgid "``printf``-style Bytes Formatting" msgstr "Estilo de Formatação de bytes ``printf``-style" -#: ../../library/stdtypes.rst:3561 +#: ../../builtins/stdtypes.rst:4153 msgid "" "The formatting operations described here exhibit a variety of quirks that " "lead to a number of common errors (such as failing to display tuples and " @@ -5392,23 +7203,23 @@ msgstr "" "exibição de Tuplas e Dicionários corretamente). Se o valor que está sendo " "impresso puder ser uma tupla ou dicionário, envolva-o numa tupla." -#: ../../library/stdtypes.rst:3566 +#: ../../builtins/stdtypes.rst:4158 msgid "" "Bytes objects (``bytes``/``bytearray``) have one unique built-in operation: " "the ``%`` operator (modulo). This is also known as the bytes *formatting* or " "*interpolation* operator. Given ``format % values`` (where *format* is a " "bytes object), ``%`` conversion specifications in *format* are replaced with " -"zero or more elements of *values*. The effect is similar to using the :c:" -"func:`sprintf` in the C language." +"zero or more elements of *values*. The effect is similar to using " +"the :c:func:`sprintf` function in the C language." msgstr "" -"Objetos Bytes (``bytes``/``bytearray``) possuem uma operação integrada " +"Objetos Bytes (``bytes``/``bytearray``) possuem uma operação embutida " "exclusiva: o operador ``%`` (modulo). Isso também é conhecido como o bytes " "de *formatação* ou o operador de *interpolação*. Dado ``format % values`` " "(onde *format* é um objeto bytes), as especificações de conversão ``%`` em " "*format* são substituídas por zero ou mais elementos de *values*. O efeito é " "semelhante ao uso da função :c:func:`sprintf` na linguagem C." -#: ../../library/stdtypes.rst:3573 +#: ../../builtins/stdtypes.rst:4165 msgid "" "If *format* requires a single argument, *values* may be a single non-tuple " "object. [5]_ Otherwise, *values* must be a tuple with exactly the number of " @@ -5420,7 +7231,7 @@ msgstr "" "o número de itens especificados pelo objeto de formatação de Bytes, ou um " "único objeto de mapeamento (por exemplo, um dicionário)." -#: ../../library/stdtypes.rst:3607 +#: ../../builtins/stdtypes.rst:4199 msgid "" "When the right argument is a dictionary (or other mapping type), then the " "formats in the bytes object *must* include a parenthesised mapping key into " @@ -5433,15 +7244,19 @@ msgstr "" "O mapeamento de chaves seleciona o valor a ser formatado a partir do " "mapeamento. Por exemplo:" -#: ../../library/stdtypes.rst:3681 +#: ../../builtins/stdtypes.rst:4251 +msgid "\\(8)" +msgstr "\\(8)" + +#: ../../builtins/stdtypes.rst:4273 msgid "Single byte (accepts integer or single byte objects)." msgstr "Byte simples (aceita objetos inteiros ou de byte único)." -#: ../../library/stdtypes.rst:3684 +#: ../../builtins/stdtypes.rst:4276 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/stdtypes.rst:3684 +#: ../../builtins/stdtypes.rst:4276 msgid "" "Bytes (any object that follows the :ref:`buffer protocol ` or " "has :meth:`~object.__bytes__`)." @@ -5449,7 +7264,7 @@ msgstr "" "Bytes (qualquer objeto que segue o :ref:`buffer protocol ` o " "que possui :meth:`~object.__bytes__`)." -#: ../../library/stdtypes.rst:3688 +#: ../../builtins/stdtypes.rst:4280 msgid "" "``'s'`` is an alias for ``'b'`` and should only be used for Python2/3 code " "bases." @@ -5457,7 +7272,7 @@ msgstr "" "``'s'`` é um alias para ``'b'`` e só deve ser usado para bases de código " "Python2/3." -#: ../../library/stdtypes.rst:3691 +#: ../../builtins/stdtypes.rst:4283 msgid "" "Bytes (converts any Python object using ``repr(obj).encode('ascii', " "'backslashreplace')``)." @@ -5465,7 +7280,7 @@ msgstr "" "Bytes (converte qualquer objeto Python usando ``repr(obj).encode('ascii', " "'backslashreplace')``)." -#: ../../library/stdtypes.rst:3694 +#: ../../builtins/stdtypes.rst:4286 msgid "" "``'r'`` is an alias for ``'a'`` and should only be used for Python2/3 code " "bases." @@ -5473,48 +7288,48 @@ msgstr "" "``'r'`` é um alias para ``'a'`` e só deve ser usado para bases de código " "Python2/3." -#: ../../library/stdtypes.rst:3694 +#: ../../builtins/stdtypes.rst:4286 msgid "\\(7)" msgstr "\\(7)" -#: ../../library/stdtypes.rst:3729 +#: ../../builtins/stdtypes.rst:4321 msgid "``b'%s'`` is deprecated, but will not be removed during the 3.x series." msgstr "" "``b'%s'`` está descontinuado, mas não será removido durante a versão 3.x." -#: ../../library/stdtypes.rst:3732 +#: ../../builtins/stdtypes.rst:4324 msgid "``b'%r'`` is deprecated, but will not be removed during the 3.x series." msgstr "``b'%r'`` entrou em desuso, mas não serão removidos na versão 3.x." -#: ../../library/stdtypes.rst:3744 +#: ../../builtins/stdtypes.rst:4336 msgid ":pep:`461` - Adding % formatting to bytes and bytearray" msgstr ":pep:`461` - Adicionar formatação % para to bytes e bytearray" -#: ../../library/stdtypes.rst:3751 +#: ../../builtins/stdtypes.rst:4343 msgid "Memory Views" -msgstr "Memory Views" +msgstr "Visões de memória" -#: ../../library/stdtypes.rst:3753 +#: ../../builtins/stdtypes.rst:4345 msgid "" ":class:`memoryview` objects allow Python code to access the internal data of " "an object that supports the :ref:`buffer protocol ` without " "copying." msgstr "" -"O objeto :class:`memoryview` permite que o código Python acesse os dados " -"internos de um objeto que suporte o :ref:`buffer protocol ` " -"sem copiá-lo." +"Objetos :class:`memoryview` permitem que código Python acesse os dados " +"internos de um objeto que implemente o :ref:`protocolo buffer " +"` sem copiá-lo." -#: ../../library/stdtypes.rst:3759 +#: ../../builtins/stdtypes.rst:4351 msgid "" "Create a :class:`memoryview` that references *object*. *object* must " "support the buffer protocol. Built-in objects that support the buffer " "protocol include :class:`bytes` and :class:`bytearray`." msgstr "" "Cria uma :class:`memoryview` que referencia *object*. *object* deve ter " -"suporte ao protocolo de buffer. Objetos embutidos que suportam o protocolo " -"de buffer incluem :class:`bytes` e :class:`bytearray`." +"suporte ao protocolo de buffer. Objetos embutidos com suporte ao protocolo " +"de buffer incluem: :class:`bytes` e :class:`bytearray`." -#: ../../library/stdtypes.rst:3763 +#: ../../builtins/stdtypes.rst:4355 msgid "" "A :class:`memoryview` has the notion of an *element*, which is the atomic " "memory unit handled by the originating *object*. For many simple types such " @@ -5527,17 +7342,14 @@ msgstr "" "único, mas outros tipos tais como :class:`array.array` podem ter elementos " "maiores." -#: ../../library/stdtypes.rst:3768 +#: ../../builtins/stdtypes.rst:4360 msgid "" "``len(view)`` is equal to the length of :class:`~memoryview.tolist`, which " -"is the nested list representation of the view. If ``view.ndim = 1``, this is " -"equal to the number of elements in the view." +"is the nested list representation of the view. If ``view.ndim == 1``, this " +"is equal to the number of elements in the view." msgstr "" -"``len(view)`` é igual ao comprimento de :class:`~memoryview.tolist`, que é a " -"representação de lista aninhada da view. Se ``view.ndim = 1``, isso é igual " -"ao número de elementos na visualização." -#: ../../library/stdtypes.rst:3772 +#: ../../builtins/stdtypes.rst:4364 msgid "" "If ``view.ndim == 0``, ``len(view)`` now raises :exc:`TypeError` instead of " "returning 1." @@ -5545,7 +7357,7 @@ msgstr "" "Se ``view.ndim == 0``, ``len(view)`` agora levanta :exc:`TypeError` em vez " "de retornar 1." -#: ../../library/stdtypes.rst:3775 +#: ../../builtins/stdtypes.rst:4367 msgid "" "The :class:`~memoryview.itemsize` attribute will give you the number of " "bytes in a single element." @@ -5553,7 +7365,7 @@ msgstr "" "O atributo :class:`~memoryview.itemsize` vai lhe dar um número de bytes em " "um único elemento." -#: ../../library/stdtypes.rst:3778 +#: ../../builtins/stdtypes.rst:4370 msgid "" "A :class:`memoryview` supports slicing and indexing to expose its data. One-" "dimensional slicing will result in a subview::" @@ -5561,7 +7373,29 @@ msgstr "" "Um :class:`memoryview` suporta fatiamento e indexação para expor seus dados. " "Fatiamento unidimensional irá resultar em uma subview::" -#: ../../library/stdtypes.rst:3791 +#: ../../builtins/stdtypes.rst:4373 +msgid "" +">>> v = memoryview(b'abcefg')\n" +">>> v[1]\n" +"98\n" +">>> v[-1]\n" +"103\n" +">>> v[1:4]\n" +"\n" +">>> bytes(v[1:4])\n" +"b'bce'" +msgstr "" +">>> v = memoryview(b'abcefg')\n" +">>> v[1]\n" +"98\n" +">>> v[-1]\n" +"103\n" +">>> v[1:4]\n" +"\n" +">>> bytes(v[1:4])\n" +"b'bce'" + +#: ../../builtins/stdtypes.rst:4383 msgid "" "If :class:`~memoryview.format` is one of the native format specifiers from " "the :mod:`struct` module, indexing with an integer or a tuple of integers is " @@ -5574,17 +7408,39 @@ msgstr "" "Se :class:`~memoryview.format` é um dos especificadores de formatação " "nativos do módulo :mod:`struct`, indexar com um inteiro ou uma tupla de " "inteiros também é suportado, e retorna um *element* único com o tipo " -"correto. Memoryviews unidimensionais podem ser indexadas com um inteiro ou " -"uma tupla contendo um inteiro. Memoryviews multi-dimensionais podem ser " -"indexadas com tuplas de exatamente *ndim* inteiros, onde *ndim* é o número " -"de dimensões. Memoryviews zero-dimensionais podem ser indexadas com uma " -"tupla vazia." +"correto. Visões de memória unidimensionais podem ser indexadas por um " +"inteiro ou por uma tupla contendo um inteiro. Visões de memória " +"multidimensionais podem ser indexadas por tuplas de exatamente *ndim* " +"inteiros, onde *ndim* é o número de dimensões. Visões de memória zero-" +"dimensionais podem ser indexadas por uma tupla vazia." -#: ../../library/stdtypes.rst:3800 +#: ../../builtins/stdtypes.rst:4392 msgid "Here is an example with a non-byte format::" msgstr "Aqui temos um exemplo usando um formato não-byte::" -#: ../../library/stdtypes.rst:3812 +#: ../../builtins/stdtypes.rst:4394 +msgid "" +">>> import array\n" +">>> a = array.array('l', [-11111111, 22222222, -33333333, 44444444])\n" +">>> m = memoryview(a)\n" +">>> m[0]\n" +"-11111111\n" +">>> m[-1]\n" +"44444444\n" +">>> m[::2].tolist()\n" +"[-11111111, -33333333]" +msgstr "" +">>> import array\n" +">>> a = array.array('l', [-11111111, 22222222, -33333333, 44444444])\n" +">>> m = memoryview(a)\n" +">>> m[0]\n" +"-11111111\n" +">>> m[-1]\n" +"44444444\n" +">>> m[::2].tolist()\n" +"[-11111111, -33333333]" + +#: ../../builtins/stdtypes.rst:4404 msgid "" "If the underlying object is writable, the memoryview supports one-" "dimensional slice assignment. Resizing is not allowed::" @@ -5592,44 +7448,102 @@ msgstr "" "Se o objeto subjacente é gravável, a memoryview suporta atribuição de fatias " "unidimensionais. Redimensionamento não é permitido::" -#: ../../library/stdtypes.rst:3833 +#: ../../builtins/stdtypes.rst:4407 +msgid "" +">>> data = bytearray(b'abcefg')\n" +">>> v = memoryview(data)\n" +">>> v.readonly\n" +"False\n" +">>> v[0] = ord(b'z')\n" +">>> data\n" +"bytearray(b'zbcefg')\n" +">>> v[1:4] = b'123'\n" +">>> data\n" +"bytearray(b'z123fg')\n" +">>> v[2:3] = b'spam'\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: memoryview assignment: lvalue and rvalue have different " +"structures\n" +">>> v[2:6] = b'spam'\n" +">>> data\n" +"bytearray(b'z1spam')" +msgstr "" +">>> data = bytearray(b'abcefg')\n" +">>> v = memoryview(data)\n" +">>> v.readonly\n" +"False\n" +">>> v[0] = ord(b'z')\n" +">>> data\n" +"bytearray(b'zbcefg')\n" +">>> v[1:4] = b'123'\n" +">>> data\n" +"bytearray(b'z123fg')\n" +">>> v[2:3] = b'spam'\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: memoryview assignment: lvalue and rvalue have different " +"structures\n" +">>> v[2:6] = b'spam'\n" +">>> data\n" +"bytearray(b'z1spam')" + +#: ../../builtins/stdtypes.rst:4425 msgid "" "One-dimensional memoryviews of :term:`hashable` (read-only) types with " "formats 'B', 'b' or 'c' are also hashable. The hash is defined as ``hash(m) " "== hash(m.tobytes())``::" msgstr "" -"Memoryviews unidimensionais de tipos :term:`hasheáveis ` (somente " -"leitura) com formatos 'B', 'b' ou 'c' também são hasheáveis. O hash é " -"definido como ``hash(m) == hash(m.tobytes())``::" +"Visões de memória unidimensionais de tipos :term:`hasheáveis ` " +"(somente leitura) com formatos 'B', 'b' ou 'c' também são hasheáveis. O hash " +"é definido como ``hash(m) == hash(m.tobytes())``::" + +#: ../../builtins/stdtypes.rst:4429 +msgid "" +">>> v = memoryview(b'abcefg')\n" +">>> hash(v) == hash(b'abcefg')\n" +"True\n" +">>> hash(v[2:4]) == hash(b'ce')\n" +"True\n" +">>> hash(v[::-2]) == hash(b'abcefg'[::-2])\n" +"True" +msgstr "" +">>> v = memoryview(b'abcefg')\n" +">>> hash(v) == hash(b'abcefg')\n" +"True\n" +">>> hash(v[2:4]) == hash(b'ce')\n" +"True\n" +">>> hash(v[::-2]) == hash(b'abcefg'[::-2])\n" +"True" -#: ../../library/stdtypes.rst:3845 +#: ../../builtins/stdtypes.rst:4437 msgid "" "One-dimensional memoryviews can now be sliced. One-dimensional memoryviews " "with formats 'B', 'b' or 'c' are now :term:`hashable`." msgstr "" -"Memoryviews unidimensionais agora podem ser fatiadas. Memoryviews " -"unidimensionais com formatos 'B', 'b' ou 'c' agora são :term:`hasheáveis " -"`." +"Visões de memória unidimensionais agora podem ser fatiadas. Visões de " +"memória unidimensionais com formatos 'B', 'b' ou 'c' agora " +"são :term:`hasheáveis `." -#: ../../library/stdtypes.rst:3849 +#: ../../builtins/stdtypes.rst:4441 msgid "" -"memoryview is now registered automatically with :class:`collections.abc." -"Sequence`" +"memoryview is now registered automatically " +"with :class:`collections.abc.Sequence`" msgstr "" -"O memoryview agora é registrado automaticamente como uma classe :class:" -"`collections.abc.Sequence`" +"O memoryview agora é registrado automaticamente como uma " +"classe :class:`collections.abc.Sequence`" -#: ../../library/stdtypes.rst:3853 -msgid "memoryviews can now be indexed with tuple of integers." +#: ../../builtins/stdtypes.rst:4445 +msgid "memoryviews can now be indexed with a tuple of integers." msgstr "" -"Atualmente, os memoryvies podem ser indexadas com uma tupla de números " +"Atualmente, os memoryviews podem ser indexadas com uma tupla de números " "inteiros." -#: ../../library/stdtypes.rst:3856 +#: ../../builtins/stdtypes.rst:4448 msgid ":class:`memoryview` has several methods:" msgstr ":class:`memoryview` possui vários métodos:" -#: ../../library/stdtypes.rst:3860 +#: ../../builtins/stdtypes.rst:4452 msgid "" "A memoryview and a :pep:`3118` exporter are equal if their shapes are " "equivalent and if all corresponding values are equal when the operands' " @@ -5640,26 +7554,87 @@ msgstr "" "códigos de formatação dos respectivos operadores são interpretados usando a " "sintaxe :mod:`struct`." -#: ../../library/stdtypes.rst:3864 +#: ../../builtins/stdtypes.rst:4456 msgid "" -"For the subset of :mod:`struct` format strings currently supported by :meth:" -"`tolist`, ``v`` and ``w`` are equal if ``v.tolist() == w.tolist()``::" +"For the subset of :mod:`struct` format strings currently supported " +"by :meth:`tolist`, ``v`` and ``w`` are equal if ``v.tolist() == " +"w.tolist()``::" msgstr "" "Para o subconjunto :mod:`struct` a formatação de Strings atualmente " -"suportadas por :meth:`tolist`, ``v`` e ``w`` são iguais se ``v.tolist() == w." -"tolist()``::" - -#: ../../library/stdtypes.rst:3883 +"suportadas por :meth:`tolist`, ``v`` e ``w`` são iguais se ``v.tolist() == " +"w.tolist()``::" + +#: ../../builtins/stdtypes.rst:4459 +msgid "" +">>> import array\n" +">>> a = array.array('I', [1, 2, 3, 4, 5])\n" +">>> b = array.array('d', [1.0, 2.0, 3.0, 4.0, 5.0])\n" +">>> c = array.array('b', [5, 3, 1])\n" +">>> x = memoryview(a)\n" +">>> y = memoryview(b)\n" +">>> x == a == y == b\n" +"True\n" +">>> x.tolist() == a.tolist() == y.tolist() == b.tolist()\n" +"True\n" +">>> z = y[::-2]\n" +">>> z == c\n" +"True\n" +">>> z.tolist() == c.tolist()\n" +"True" +msgstr "" +">>> import array\n" +">>> a = array.array('I', [1, 2, 3, 4, 5])\n" +">>> b = array.array('d', [1.0, 2.0, 3.0, 4.0, 5.0])\n" +">>> c = array.array('b', [5, 3, 1])\n" +">>> x = memoryview(a)\n" +">>> y = memoryview(b)\n" +">>> x == a == y == b\n" +"True\n" +">>> x.tolist() == a.tolist() == y.tolist() == b.tolist()\n" +"True\n" +">>> z = y[::-2]\n" +">>> z == c\n" +"True\n" +">>> z.tolist() == c.tolist()\n" +"True" + +#: ../../builtins/stdtypes.rst:4475 msgid "" "If either format string is not supported by the :mod:`struct` module, then " "the objects will always compare as unequal (even if the format strings and " "buffer contents are identical)::" msgstr "" -"Se qualquer string de formatação não for suportada pelo módulo :mod:" -"`struct`, então os objetos irão sempre comparar como diferentes (mesmo se as " -"strings de formatação e o conteúdo do buffer são idênticos)::" - -#: ../../library/stdtypes.rst:3899 +"Se qualquer string de formatação não for suportada pelo " +"módulo :mod:`struct`, então os objetos irão sempre comparar como diferentes " +"(mesmo se as strings de formatação e o conteúdo do buffer são idênticos)::" + +#: ../../builtins/stdtypes.rst:4479 +msgid "" +">>> from ctypes import BigEndianStructure, c_long\n" +">>> class BEPoint(BigEndianStructure):\n" +"... _fields_ = [(\"x\", c_long), (\"y\", c_long)]\n" +"...\n" +">>> point = BEPoint(100, 200)\n" +">>> a = memoryview(point)\n" +">>> b = memoryview(point)\n" +">>> a == point\n" +"False\n" +">>> a == b\n" +"False" +msgstr "" +">>> from ctypes import BigEndianStructure, c_long\n" +">>> class BEPoint(BigEndianStructure):\n" +"... _fields_ = [(\"x\", c_long), (\"y\", c_long)]\n" +"...\n" +">>> point = BEPoint(100, 200)\n" +">>> a = memoryview(point)\n" +">>> b = memoryview(point)\n" +">>> a == point\n" +"False\n" +">>> a == b\n" +"False" + +#: ../../builtins/stdtypes.rst:4491 msgid "" "Note that, as with floating-point numbers, ``v is w`` does *not* imply ``v " "== w`` for memoryview objects." @@ -5667,7 +7642,7 @@ msgstr "" "Perceba que, assim como com números de ponto flutuante, ``v is w`` *não* " "implica em ``v == w`` para objetos memoryview." -#: ../../library/stdtypes.rst:3902 +#: ../../builtins/stdtypes.rst:4494 msgid "" "Previous versions compared the raw memory disregarding the item format and " "the logical array structure." @@ -5675,7 +7650,7 @@ msgstr "" "Versões anteriores comparavam a memória bruta desconsiderando o formato do " "item e estrutura lógica do array." -#: ../../library/stdtypes.rst:3908 +#: ../../builtins/stdtypes.rst:4500 msgid "" "Return the data in the buffer as a bytestring. This is equivalent to " "calling the :class:`bytes` constructor on the memoryview. ::" @@ -5683,7 +7658,21 @@ msgstr "" "Retorna os dados no buffer como um bytestring. Isso é equivalente a chamar o " "construtor de :class:`bytes` na memoryview. ::" -#: ../../library/stdtypes.rst:3917 +#: ../../builtins/stdtypes.rst:4503 +msgid "" +">>> m = memoryview(b\"abc\")\n" +">>> m.tobytes()\n" +"b'abc'\n" +">>> bytes(m)\n" +"b'abc'" +msgstr "" +">>> m = memoryview(b\"abc\")\n" +">>> m.tobytes()\n" +"b'abc'\n" +">>> bytes(m)\n" +"b'abc'" + +#: ../../builtins/stdtypes.rst:4509 msgid "" "For non-contiguous arrays the result is equal to the flattened list " "representation with all elements converted to bytes. :meth:`tobytes` " @@ -5695,7 +7684,7 @@ msgstr "" "suporta todos os formatos de strings, incluindo aqueles que não estão na " "sintaxe do módulo :mod:`struct`." -#: ../../library/stdtypes.rst:3922 +#: ../../builtins/stdtypes.rst:4514 msgid "" "*order* can be {'C', 'F', 'A'}. When *order* is 'C' or 'F', the data of the " "original array is converted to C or Fortran order. For contiguous views, 'A' " @@ -5709,7 +7698,7 @@ msgstr "" "ordem de Fortran em memória é preservada. Para views não contígua, os dados " "são convertidos primeiro para C. *order=None* é o mesmo que *order='C'*." -#: ../../library/stdtypes.rst:3931 +#: ../../builtins/stdtypes.rst:4524 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the buffer. ::" @@ -5717,7 +7706,17 @@ msgstr "" "Retorna um objeto string contendo dois dígitos hexadecimais para cada byte " "no buffer. ::" -#: ../../library/stdtypes.rst:3940 +#: ../../builtins/stdtypes.rst:4527 +msgid "" +">>> m = memoryview(b\"abc\")\n" +">>> m.hex()\n" +"'616263'" +msgstr "" +">>> m = memoryview(b\"abc\")\n" +">>> m.hex()\n" +"'616263'" + +#: ../../builtins/stdtypes.rst:4533 msgid "" "Similar to :meth:`bytes.hex`, :meth:`memoryview.hex` now supports optional " "*sep* and *bytes_per_sep* parameters to insert separators between bytes in " @@ -5727,20 +7726,38 @@ msgstr "" "parâmetros opcionais *sep* e *bytes_per_sep* para inserir separadores entre " "bytes na saída hexadecimal." -#: ../../library/stdtypes.rst:3947 +#: ../../builtins/stdtypes.rst:4540 msgid "Return the data in the buffer as a list of elements. ::" msgstr "Retorna os dados no buffer como uma lista de elementos. ::" -#: ../../library/stdtypes.rst:3957 +#: ../../builtins/stdtypes.rst:4542 +msgid "" +">>> memoryview(b'abc').tolist()\n" +"[97, 98, 99]\n" +">>> import array\n" +">>> a = array.array('d', [1.1, 2.2, 3.3])\n" +">>> m = memoryview(a)\n" +">>> m.tolist()\n" +"[1.1, 2.2, 3.3]" +msgstr "" +">>> memoryview(b'abc').tolist()\n" +"[97, 98, 99]\n" +">>> import array\n" +">>> a = array.array('d', [1.1, 2.2, 3.3])\n" +">>> m = memoryview(a)\n" +">>> m.tolist()\n" +"[1.1, 2.2, 3.3]" + +#: ../../builtins/stdtypes.rst:4550 msgid "" -":meth:`tolist` now supports all single character native formats in :mod:" -"`struct` module syntax as well as multi-dimensional representations." +":meth:`tolist` now supports all single character native formats " +"in :mod:`struct` module syntax as well as multi-dimensional representations." msgstr "" ":meth:`tolist` agora suporta todos os formatos nativos de caracteres únicos " "na sintaxe do módulo :mod:`struct`, assim como representações multi-" "dimensionais." -#: ../../library/stdtypes.rst:3964 +#: ../../builtins/stdtypes.rst:4557 msgid "" "Return a readonly version of the memoryview object. The original memoryview " "object is unchanged. ::" @@ -5748,31 +7765,73 @@ msgstr "" "Retorna uma versão somente leitura do objeto memoryview. O objeto memoryview " "original não é alterado. ::" -#: ../../library/stdtypes.rst:3983 +#: ../../builtins/stdtypes.rst:4560 +msgid "" +">>> m = memoryview(bytearray(b'abc'))\n" +">>> mm = m.toreadonly()\n" +">>> mm.tolist()\n" +"[97, 98, 99]\n" +">>> mm[0] = 42\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: cannot modify read-only memory\n" +">>> m[0] = 43\n" +">>> mm.tolist()\n" +"[43, 98, 99]" +msgstr "" +">>> m = memoryview(bytearray(b'abc'))\n" +">>> mm = m.toreadonly()\n" +">>> mm.tolist()\n" +"[97, 98, 99]\n" +">>> mm[0] = 42\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: cannot modify read-only memory\n" +">>> m[0] = 43\n" +">>> mm.tolist()\n" +"[43, 98, 99]" + +#: ../../builtins/stdtypes.rst:4576 msgid "" "Release the underlying buffer exposed by the memoryview object. Many " -"objects take special actions when a view is held on them (for example, a :" -"class:`bytearray` would temporarily forbid resizing); therefore, calling " +"objects take special actions when a view is held on them (for example, " +"a :class:`bytearray` would temporarily forbid resizing); therefore, calling " "release() is handy to remove these restrictions (and free any dangling " "resources) as soon as possible." msgstr "" "Libera o buffer subjacente exposto pelo objeto memoryview. Muitos objetos " -"aceitam ações especiais quando a view é mantida com eles (por exemplo, um :" -"class:`bytearray` iria temporariamente proibir o redimensionamento); " +"aceitam ações especiais quando a view é mantida com eles (por exemplo, " +"um :class:`bytearray` iria temporariamente proibir o redimensionamento); " "portanto, chamar release() é útil para remover essas restrições (e liberar " "quaisquer recursos pendurados) o mais breve possível." -#: ../../library/stdtypes.rst:3989 +#: ../../builtins/stdtypes.rst:4582 msgid "" "After this method has been called, any further operation on the view raises " -"a :class:`ValueError` (except :meth:`release()` itself which can be called " +"a :class:`ValueError` (except :meth:`release` itself which can be called " "multiple times)::" msgstr "" "Depois que este método foi chamado, qualquer operação posterior na visão " -"levanta um :class:`ValueError` (exceto :meth:`release()`, o qual pode ser " +"levanta um :class:`ValueError` (exceto :meth:`release`, o qual pode ser " "chamado múltiplas vezes)::" -#: ../../library/stdtypes.rst:4000 +#: ../../builtins/stdtypes.rst:4586 +msgid "" +">>> m = memoryview(b'abc')\n" +">>> m.release()\n" +">>> m[0]\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: operation forbidden on released memoryview object" +msgstr "" +">>> m = memoryview(b'abc')\n" +">>> m.release()\n" +">>> m[0]\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: operation forbidden on released memoryview object" + +#: ../../builtins/stdtypes.rst:4593 msgid "" "The context management protocol can be used for a similar effect, using the " "``with`` statement::" @@ -5780,7 +7839,27 @@ msgstr "" "O protocolo de gerenciamento de contexto pode ser usado para efeitos " "similares, usando a instrução ``with``::" -#: ../../library/stdtypes.rst:4016 +#: ../../builtins/stdtypes.rst:4596 +msgid "" +">>> with memoryview(b'abc') as m:\n" +"... m[0]\n" +"...\n" +"97\n" +">>> m[0]\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: operation forbidden on released memoryview object" +msgstr "" +">>> with memoryview(b'abc') as m:\n" +"... m[0]\n" +"...\n" +"97\n" +">>> m[0]\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: operation forbidden on released memoryview object" + +#: ../../builtins/stdtypes.rst:4610 msgid "" "Cast a memoryview to a new format or shape. *shape* defaults to " "``[byte_length//new_itemsize]``, which means that the result view will be " @@ -5794,49 +7873,201 @@ msgstr "" "si mesmo não é copiado. Conversões suportadas são 1D -> C-:term:`contíguo " "` r C-contíguo -> 1D." -#: ../../library/stdtypes.rst:4022 +#: ../../builtins/stdtypes.rst:4616 msgid "" -"The destination format is restricted to a single element native format in :" -"mod:`struct` syntax. One of the formats must be a byte format ('B', 'b' or " -"'c'). The byte length of the result must be the same as the original length. " -"Note that all byte lengths may depend on the operating system." +"The destination format is restricted to a single element native format " +"in :mod:`struct` syntax. One of the formats must be a byte format ('B', 'b' " +"or 'c'). The byte length of the result must be the same as the original " +"length. Note that all byte lengths may depend on the operating system." msgstr "" -"O formato de destino é restrito a um elemento em formato nativo na sintaxe :" -"mod:`struct`. Um dos formatos deve ser um formato de byte ('B', 'b' ou 'c'). " -"O comprimento de bytes do resultado deve ser o mesmo que o comprimento " -"original. Observe que todos os comprimentos de bytes podem depender do " -"sistema operacional." +"O formato de destino é restrito a um elemento em formato nativo na " +"sintaxe :mod:`struct`. Um dos formatos deve ser um formato de byte ('B', 'b' " +"ou 'c'). O comprimento de bytes do resultado deve ser o mesmo que o " +"comprimento original. Observe que todos os comprimentos de bytes podem " +"depender do sistema operacional." -#: ../../library/stdtypes.rst:4028 +#: ../../builtins/stdtypes.rst:4622 msgid "Cast 1D/long to 1D/unsigned bytes::" msgstr "Converte de 1D/long para 1D/unsigned bytes::" -#: ../../library/stdtypes.rst:4051 +#: ../../builtins/stdtypes.rst:4624 +msgid "" +">>> import array\n" +">>> a = array.array('l', [1,2,3])\n" +">>> x = memoryview(a)\n" +">>> x.format\n" +"'l'\n" +">>> x.itemsize\n" +"8\n" +">>> len(x)\n" +"3\n" +">>> x.nbytes\n" +"24\n" +">>> y = x.cast('B')\n" +">>> y.format\n" +"'B'\n" +">>> y.itemsize\n" +"1\n" +">>> len(y)\n" +"24\n" +">>> y.nbytes\n" +"24" +msgstr "" +">>> import array\n" +">>> a = array.array('l', [1,2,3])\n" +">>> x = memoryview(a)\n" +">>> x.format\n" +"'l'\n" +">>> x.itemsize\n" +"8\n" +">>> len(x)\n" +"3\n" +">>> x.nbytes\n" +"24\n" +">>> y = x.cast('B')\n" +">>> y.format\n" +"'B'\n" +">>> y.itemsize\n" +"1\n" +">>> len(y)\n" +"24\n" +">>> y.nbytes\n" +"24" + +#: ../../builtins/stdtypes.rst:4645 msgid "Cast 1D/unsigned bytes to 1D/char::" msgstr "Converte de 1D/unsigned bytes para 1D/char::" -#: ../../library/stdtypes.rst:4064 +#: ../../builtins/stdtypes.rst:4647 +msgid "" +">>> b = bytearray(b'zyz')\n" +">>> x = memoryview(b)\n" +">>> x[0] = b'a'\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: memoryview: invalid type for format 'B'\n" +">>> y = x.cast('c')\n" +">>> y[0] = b'a'\n" +">>> b\n" +"bytearray(b'ayz')" +msgstr "" +">>> b = bytearray(b'zyz')\n" +">>> x = memoryview(b)\n" +">>> x[0] = b'a'\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: memoryview: invalid type for format 'B'\n" +">>> y = x.cast('c')\n" +">>> y[0] = b'a'\n" +">>> b\n" +"bytearray(b'ayz')" + +#: ../../builtins/stdtypes.rst:4658 msgid "Cast 1D/bytes to 3D/ints to 1D/signed char::" msgstr "Converte de 1D/bytes para 3D/ints para 1D/signed char::" -#: ../../library/stdtypes.rst:4090 +#: ../../builtins/stdtypes.rst:4660 +msgid "" +">>> import struct\n" +">>> buf = struct.pack(\"i\"*12, *list(range(12)))\n" +">>> x = memoryview(buf)\n" +">>> y = x.cast('i', shape=[2,2,3])\n" +">>> y.tolist()\n" +"[[[0, 1, 2], [3, 4, 5]], [[6, 7, 8], [9, 10, 11]]]\n" +">>> y.format\n" +"'i'\n" +">>> y.itemsize\n" +"4\n" +">>> len(y)\n" +"2\n" +">>> y.nbytes\n" +"48\n" +">>> z = y.cast('b')\n" +">>> z.format\n" +"'b'\n" +">>> z.itemsize\n" +"1\n" +">>> len(z)\n" +"48\n" +">>> z.nbytes\n" +"48" +msgstr "" +">>> import struct\n" +">>> buf = struct.pack(\"i\"*12, *list(range(12)))\n" +">>> x = memoryview(buf)\n" +">>> y = x.cast('i', shape=[2,2,3])\n" +">>> y.tolist()\n" +"[[[0, 1, 2], [3, 4, 5]], [[6, 7, 8], [9, 10, 11]]]\n" +">>> y.format\n" +"'i'\n" +">>> y.itemsize\n" +"4\n" +">>> len(y)\n" +"2\n" +">>> y.nbytes\n" +"48\n" +">>> z = y.cast('b')\n" +">>> z.format\n" +"'b'\n" +">>> z.itemsize\n" +"1\n" +">>> len(z)\n" +"48\n" +">>> z.nbytes\n" +"48" + +#: ../../builtins/stdtypes.rst:4684 msgid "Cast 1D/unsigned long to 2D/unsigned long::" msgstr "Converte 1D/unsigned long para 2D/unsigned long::" -#: ../../library/stdtypes.rst:4104 +#: ../../builtins/stdtypes.rst:4686 +msgid "" +">>> buf = struct.pack(\"L\"*6, *list(range(6)))\n" +">>> x = memoryview(buf)\n" +">>> y = x.cast('L', shape=[2,3])\n" +">>> len(y)\n" +"2\n" +">>> y.nbytes\n" +"48\n" +">>> y.tolist()\n" +"[[0, 1, 2], [3, 4, 5]]" +msgstr "" +">>> buf = struct.pack(\"L\"*6, *list(range(6)))\n" +">>> x = memoryview(buf)\n" +">>> y = x.cast('L', shape=[2,3])\n" +">>> len(y)\n" +"2\n" +">>> y.nbytes\n" +"48\n" +">>> y.tolist()\n" +"[[0, 1, 2], [3, 4, 5]]" + +#: ../../builtins/stdtypes.rst:4698 msgid "The source format is no longer restricted when casting to a byte view." msgstr "" "O formato fonte não é mais restrito ao converter para uma visão de byte." -#: ../../library/stdtypes.rst:4107 +#: ../../builtins/stdtypes.rst:4701 msgid "There are also several readonly attributes available:" msgstr "Existem também diversos atributos somente leitura disponíveis:" -#: ../../library/stdtypes.rst:4111 +#: ../../builtins/stdtypes.rst:4705 msgid "The underlying object of the memoryview::" msgstr "O objeto subjacente da memoryview::" -#: ../../library/stdtypes.rst:4122 +#: ../../builtins/stdtypes.rst:4707 +msgid "" +">>> b = bytearray(b'xyz')\n" +">>> m = memoryview(b)\n" +">>> m.obj is b\n" +"True" +msgstr "" +">>> b = bytearray(b'xyz')\n" +">>> m = memoryview(b)\n" +">>> m.obj is b\n" +"True" + +#: ../../builtins/stdtypes.rst:4716 msgid "" "``nbytes == product(shape) * itemsize == len(m.tobytes())``. This is the " "amount of space in bytes that the array would use in a contiguous " @@ -5846,15 +8077,71 @@ msgstr "" "quantidade de espaço em bytes que o array deve usar em uma representação " "contígua. Ela não é necessariamente igual a ``len(m)``::" -#: ../../library/stdtypes.rst:4141 +#: ../../builtins/stdtypes.rst:4720 +msgid "" +">>> import array\n" +">>> a = array.array('i', [1,2,3,4,5])\n" +">>> m = memoryview(a)\n" +">>> len(m)\n" +"5\n" +">>> m.nbytes\n" +"20\n" +">>> y = m[::2]\n" +">>> len(y)\n" +"3\n" +">>> y.nbytes\n" +"12\n" +">>> len(y.tobytes())\n" +"12" +msgstr "" +">>> import array\n" +">>> a = array.array('i', [1,2,3,4,5])\n" +">>> m = memoryview(a)\n" +">>> len(m)\n" +"5\n" +">>> m.nbytes\n" +"20\n" +">>> y = m[::2]\n" +">>> len(y)\n" +"3\n" +">>> y.nbytes\n" +"12\n" +">>> len(y.tobytes())\n" +"12" + +#: ../../builtins/stdtypes.rst:4735 msgid "Multi-dimensional arrays::" msgstr "Arrays Multi-dimensional::" -#: ../../library/stdtypes.rst:4158 +#: ../../builtins/stdtypes.rst:4737 +msgid "" +">>> import struct\n" +">>> buf = struct.pack(\"d\"*12, *[1.5*x for x in range(12)])\n" +">>> x = memoryview(buf)\n" +">>> y = x.cast('d', shape=[3,4])\n" +">>> y.tolist()\n" +"[[0.0, 1.5, 3.0, 4.5], [6.0, 7.5, 9.0, 10.5], [12.0, 13.5, 15.0, 16.5]]\n" +">>> len(y)\n" +"3\n" +">>> y.nbytes\n" +"96" +msgstr "" +">>> import struct\n" +">>> buf = struct.pack(\"d\"*12, *[1.5*x for x in range(12)])\n" +">>> x = memoryview(buf)\n" +">>> y = x.cast('d', shape=[3,4])\n" +">>> y.tolist()\n" +"[[0.0, 1.5, 3.0, 4.5], [6.0, 7.5, 9.0, 10.5], [12.0, 13.5, 15.0, 16.5]]\n" +">>> len(y)\n" +"3\n" +">>> y.nbytes\n" +"96" + +#: ../../builtins/stdtypes.rst:4752 msgid "A bool indicating whether the memory is read only." msgstr "Um bool que indica se a memória é somente leitura." -#: ../../library/stdtypes.rst:4162 +#: ../../builtins/stdtypes.rst:4756 msgid "" "A string containing the format (in :mod:`struct` module style) for each " "element in the view. A memoryview can be created from exporters with " @@ -5866,7 +8153,7 @@ msgstr "" "com strings de formato arbitrário, mas alguns métodos (ex: :meth:`tolist`) " "são restritos a formatos de elementos nativos." -#: ../../library/stdtypes.rst:4167 +#: ../../builtins/stdtypes.rst:4761 msgid "" "format ``'B'`` is now handled according to the struct module syntax. This " "means that ``memoryview(b'abc')[0] == b'abc'[0] == 97``." @@ -5874,11 +8161,31 @@ msgstr "" "formato ``'B'`` agora é tratado de acordo com a sintaxe do módulo struct. " "Isso significa que ``memoryview(b'abc')[0] == b'abc'[0] == 97``." -#: ../../library/stdtypes.rst:4173 +#: ../../builtins/stdtypes.rst:4767 msgid "The size in bytes of each element of the memoryview::" msgstr "O tamanho em Bytes de cada elemento do memoryview::" -#: ../../library/stdtypes.rst:4186 +#: ../../builtins/stdtypes.rst:4769 +msgid "" +">>> import array, struct\n" +">>> m = memoryview(array.array('H', [32000, 32001, 32002]))\n" +">>> m.itemsize\n" +"2\n" +">>> m[0]\n" +"32000\n" +">>> struct.calcsize('H') == m.itemsize\n" +"True" +msgstr "" +">>> import array, struct\n" +">>> m = memoryview(array.array('H', [32000, 32001, 32002]))\n" +">>> m.itemsize\n" +"2\n" +">>> m[0]\n" +"32000\n" +">>> struct.calcsize('H') == m.itemsize\n" +"True" + +#: ../../builtins/stdtypes.rst:4780 msgid "" "An integer indicating how many dimensions of a multi-dimensional array the " "memory represents." @@ -5886,7 +8193,7 @@ msgstr "" "Um número inteiro que indica quantas dimensões de uma matriz " "multidimensional a memória representa." -#: ../../library/stdtypes.rst:4191 +#: ../../builtins/stdtypes.rst:4785 msgid "" "A tuple of integers the length of :attr:`ndim` giving the shape of the " "memory as an N-dimensional array." @@ -5894,11 +8201,11 @@ msgstr "" "Uma tupla de inteiros de comprimento :attr:`ndim` dando a forma da memória " "como uma matriz N-dimensional." -#: ../../library/stdtypes.rst:4194 ../../library/stdtypes.rst:4202 +#: ../../builtins/stdtypes.rst:4788 ../../builtins/stdtypes.rst:4796 msgid "An empty tuple instead of ``None`` when ndim = 0." msgstr "Uma tupla vazia ao invés de ``None`` quando ndim = 0." -#: ../../library/stdtypes.rst:4199 +#: ../../builtins/stdtypes.rst:4793 msgid "" "A tuple of integers the length of :attr:`ndim` giving the size in bytes to " "access each element for each dimension of the array." @@ -5906,46 +8213,47 @@ msgstr "" "Uma tupla de inteiros de comprimento de :attr:`ndim` dando o tamanho em " "bytes para acessar cada elemento de cada dimensão da matriz." -#: ../../library/stdtypes.rst:4207 +#: ../../builtins/stdtypes.rst:4801 msgid "Used internally for PIL-style arrays. The value is informational only." msgstr "" "Usado internamente para estilos de Arrays PIL. O valor \\é apenas " "informativo." -#: ../../library/stdtypes.rst:4211 +#: ../../builtins/stdtypes.rst:4805 msgid "A bool indicating whether the memory is C-:term:`contiguous`." msgstr "Um bool que indica se a memória é :term:`contígua ` C." -#: ../../library/stdtypes.rst:4217 +#: ../../builtins/stdtypes.rst:4811 msgid "A bool indicating whether the memory is Fortran :term:`contiguous`." msgstr "" "Um bool que indica se a memória é :term:`contígua ` Fortran." -#: ../../library/stdtypes.rst:4223 +#: ../../builtins/stdtypes.rst:4817 msgid "A bool indicating whether the memory is :term:`contiguous`." msgstr "Um bool que indica se a memória é :term:`contígua `." -#: ../../library/stdtypes.rst:4231 +#: ../../builtins/stdtypes.rst:4825 msgid "Set Types --- :class:`set`, :class:`frozenset`" msgstr "Tipo conjuntos --- :class:`set`, :class:`frozenset`" -#: ../../library/stdtypes.rst:4235 +#: ../../builtins/stdtypes.rst:4829 msgid "" "A :dfn:`set` object is an unordered collection of distinct :term:`hashable` " "objects. Common uses include membership testing, removing duplicates from a " "sequence, and computing mathematical operations such as intersection, union, " "difference, and symmetric difference. (For other containers see the built-" -"in :class:`dict`, :class:`list`, and :class:`tuple` classes, and the :mod:" -"`collections` module.)" +"in :class:`dict`, :class:`list`, and :class:`tuple` classes, and " +"the :mod:`collections` module.)" msgstr "" -"Um objeto :dfn:`conjunto` é uma coleção não ordenada de objetos :term:" -"`hasheáveis ` distintos. Usos comuns incluem testes de associação, " -"remover duplicatas de uma sequência e computar operações matemáticas tais " -"como interseção, união, diferença e diferença simétrica. (Para outros tipos " -"de contêineres veja as classes embutidas :class:`dict`, :class:`list` e :" -"class:`tuple`, e o módulo :mod:`collections`.)" +"Um objeto :dfn:`conjunto` é uma coleção não ordenada de " +"objetos :term:`hasheáveis ` distintos. Usos comuns incluem testes " +"de associação, remover duplicatas de uma sequência e computar operações " +"matemáticas tais como interseção, união, diferença e diferença simétrica. " +"(Para outros tipos de contêineres veja as classes " +"embutidas :class:`dict`, :class:`list` e :class:`tuple`, e o " +"módulo :mod:`collections`.)" -#: ../../library/stdtypes.rst:4242 +#: ../../builtins/stdtypes.rst:4836 msgid "" "Like other collections, sets support ``x in set``, ``len(set)``, and ``for x " "in set``. Being an unordered collection, sets do not record element " @@ -5957,27 +8265,27 @@ msgstr "" "posição de elementos ou ordem de inserção. Portanto, conjuntos não suportam " "indexação, fatiamento ou outros comportamentos de sequências ou similares." -#: ../../library/stdtypes.rst:4247 +#: ../../builtins/stdtypes.rst:4841 msgid "" -"There are currently two built-in set types, :class:`set` and :class:" -"`frozenset`. The :class:`set` type is mutable --- the contents can be " -"changed using methods like :meth:`~set.add` and :meth:`~set.remove`. Since " -"it is mutable, it has no hash value and cannot be used as either a " +"There are currently two built-in set types, :class:`set` " +"and :class:`frozenset`. The :class:`set` type is mutable --- the contents " +"can be changed using methods like :meth:`~set.add` and :meth:`~set.remove`. " +"Since it is mutable, it has no hash value and cannot be used as either a " "dictionary key or as an element of another set. The :class:`frozenset` type " "is immutable and :term:`hashable` --- its contents cannot be altered after " "it is created; it can therefore be used as a dictionary key or as an element " "of another set." msgstr "" -"Existem atualmente dois tipos de conjuntos embutidos, :class:`set` e :class:" -"`frozenset`. O tipo :class:`set` é mutável -- o conteúdo pode ser alterado " -"usando métodos como :meth:`~set.add` e :meth:`~set.remove`. Como ele é " -"mutável, ele não tem valor hash e não pode ser usado como chave de " +"Existem atualmente dois tipos de conjuntos embutidos, :class:`set` " +"e :class:`frozenset`. O tipo :class:`set` é mutável -- o conteúdo pode ser " +"alterado usando métodos como :meth:`~set.add` e :meth:`~set.remove`. Como " +"ele é mutável, ele não tem valor hash e não pode ser usado como chave de " "dicionário ou um elemento de um outro conjunto. O tipo :class:`frozenset` é " "imutável e :term:`hasheável ` -- seu conteúdo não pode ser " "alterado depois de ter sido criado; ele pode então ser usado como chave de " "dicionário ou como um elemento de outro conjunto." -#: ../../library/stdtypes.rst:4255 +#: ../../builtins/stdtypes.rst:4849 msgid "" "Non-empty sets (not frozensets) can be created by placing a comma-separated " "list of elements within braces, for example: ``{'jack', 'sjoerd'}``, in " @@ -5987,11 +8295,11 @@ msgstr "" "posicionando uma lista de elementos separados por vírgula dentro de chaves, " "por exemplo: ``{'jack', 'sjoerd'}``, além do construtor :class:`set`." -#: ../../library/stdtypes.rst:4259 +#: ../../builtins/stdtypes.rst:4853 msgid "The constructors for both classes work the same:" msgstr "Os construtores de ambas as classes funcionam da mesma forma:" -#: ../../library/stdtypes.rst:4264 +#: ../../builtins/stdtypes.rst:4858 msgid "" "Return a new set or frozenset object whose elements are taken from " "*iterable*. The elements of a set must be :term:`hashable`. To represent " @@ -5999,38 +8307,38 @@ msgid "" "*iterable* is not specified, a new empty set is returned." msgstr "" "Retorna um novo objeto set ou frozenset, cujos elementos são obtidos a " -"partir de um *iterable*. Os elementos de um conjunto devem ser :term:" -"`hasheável `. Para representar conjuntos de sets, os sets internos " -"devem ser objetos :class:`frozenset`. Se *iterable* não for especificado, um " -"novo conjunto vazio é retornado." +"partir de um *iterable*. Os elementos de um conjunto devem " +"ser :term:`hasheáveis `. Para representar conjuntos de sets, os " +"sets internos devem ser objetos :class:`frozenset`. Se *iterable* não for " +"especificado, um novo conjunto vazio é retornado." -#: ../../library/stdtypes.rst:4270 +#: ../../builtins/stdtypes.rst:4864 msgid "Sets can be created by several means:" msgstr "Conjuntos podem ser criados de várias formas:" -#: ../../library/stdtypes.rst:4272 +#: ../../builtins/stdtypes.rst:4866 msgid "" "Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}``" msgstr "" "Usar uma lista de elementos separados por vírgulas entre chaves: ``{'jack', " "'sjoerd'}``" -#: ../../library/stdtypes.rst:4273 +#: ../../builtins/stdtypes.rst:4867 msgid "" "Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}``" msgstr "" "Usar uma compreensão de conjunto: ``{c for c in 'abracadabra' if c not in " "'abc'}``" -#: ../../library/stdtypes.rst:4274 +#: ../../builtins/stdtypes.rst:4868 msgid "" "Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', " "'foo'])``" msgstr "" -"Usar o construtor de tipo: ``set()``, ``set('foobar')``, ``set(['a', 'b', " +"Usar o construtor da classe: ``set()``, ``set('foobar')``, ``set(['a', 'b', " "'foo'])``" -#: ../../library/stdtypes.rst:4276 +#: ../../builtins/stdtypes.rst:4870 msgid "" "Instances of :class:`set` and :class:`frozenset` provide the following " "operations:" @@ -6038,19 +8346,19 @@ msgstr "" "Instâncias de :class:`set` e :class:`frozenset` fornecem as seguintes " "operações:" -#: ../../library/stdtypes.rst:4281 +#: ../../builtins/stdtypes.rst:4875 msgid "Return the number of elements in set *s* (cardinality of *s*)." msgstr "Retorna o número de elementos no set *s* (cardinalidade de *s*)." -#: ../../library/stdtypes.rst:4285 +#: ../../builtins/stdtypes.rst:4879 msgid "Test *x* for membership in *s*." msgstr "Testa se *x* pertence a *s*." -#: ../../library/stdtypes.rst:4289 +#: ../../builtins/stdtypes.rst:4883 msgid "Test *x* for non-membership in *s*." msgstr "Testa se *x* não pertence a *s*." -#: ../../library/stdtypes.rst:4293 +#: ../../builtins/stdtypes.rst:4888 msgid "" "Return ``True`` if the set has no elements in common with *other*. Sets are " "disjoint if and only if their intersection is the empty set." @@ -6058,11 +8366,11 @@ msgstr "" "Retorna ``True`` se o conjunto não tem elementos em comum com *other*. " "Conjuntos são disjuntos se e somente se a sua interseção é o conjunto vazio." -#: ../../library/stdtypes.rst:4299 +#: ../../builtins/stdtypes.rst:4895 msgid "Test whether every element in the set is in *other*." msgstr "Testa se cada elemento do conjunto está contido em *other*." -#: ../../library/stdtypes.rst:4303 +#: ../../builtins/stdtypes.rst:4899 msgid "" "Test whether the set is a proper subset of *other*, that is, ``set <= other " "and set != other``." @@ -6070,11 +8378,11 @@ msgstr "" "Testa se o conjunto é um subconjunto próprio de *other*, isto é, ``set <= " "other and set != other``." -#: ../../library/stdtypes.rst:4309 +#: ../../builtins/stdtypes.rst:4906 msgid "Test whether every element in *other* is in the set." msgstr "Testa se cada elemento em *other* está contido no conjunto." -#: ../../library/stdtypes.rst:4313 +#: ../../builtins/stdtypes.rst:4910 msgid "" "Test whether the set is a proper superset of *other*, that is, ``set >= " "other and set != other``." @@ -6082,51 +8390,52 @@ msgstr "" "Testa se o conjunto é um superconjunto próprio de *other*, isto é, ``set >= " "other and set != other``." -#: ../../library/stdtypes.rst:4319 +#: ../../builtins/stdtypes.rst:4917 msgid "Return a new set with elements from the set and all others." msgstr "" "Retorna um novo conjunto com elementos do conjunto e de todos os outros." -#: ../../library/stdtypes.rst:4324 +#: ../../builtins/stdtypes.rst:4923 msgid "Return a new set with elements common to the set and all others." msgstr "" "Retorna um novo conjunto com elementos comuns do conjunto e de todos os " "outros." -#: ../../library/stdtypes.rst:4329 +#: ../../builtins/stdtypes.rst:4929 msgid "Return a new set with elements in the set that are not in the others." msgstr "" "Retorna um novo conjunto com elementos no conjunto que não estão nos outros." -#: ../../library/stdtypes.rst:4334 +#: ../../builtins/stdtypes.rst:4935 msgid "" "Return a new set with elements in either the set or *other* but not both." msgstr "" "Retorna um novo conjunto com elementos estejam ou no conjunto ou em *other*, " "mas não em ambos." -#: ../../library/stdtypes.rst:4338 +#: ../../builtins/stdtypes.rst:4940 msgid "Return a shallow copy of the set." msgstr "Retorna uma cópia rasa do conjunto." -#: ../../library/stdtypes.rst:4341 +#: ../../builtins/stdtypes.rst:4943 msgid "" -"Note, the non-operator versions of :meth:`union`, :meth:`intersection`, :" -"meth:`difference`, :meth:`symmetric_difference`, :meth:`issubset`, and :meth:" -"`issuperset` methods will accept any iterable as an argument. In contrast, " -"their operator based counterparts require their arguments to be sets. This " -"precludes error-prone constructions like ``set('abc') & 'cbs'`` in favor of " -"the more readable ``set('abc').intersection('cbs')``." +"Note, the non-operator versions " +"of :meth:`~frozenset.union`, :meth:`~frozenset.intersection`, :meth:`~frozenset.difference`, :meth:`~frozenset.symmetric_difference`, :meth:`~frozenset.issubset`, " +"and :meth:`~frozenset.issuperset` methods will accept any iterable as an " +"argument. In contrast, their operator based counterparts require their " +"arguments to be sets. This precludes error-prone constructions like " +"``set('abc') & 'cbs'`` in favor of the more readable " +"``set('abc').intersection('cbs')``." msgstr "" -"Observe que, as versões não-operador dos métodos :meth:`union`, :meth:" -"`intersection`, :meth:`difference`, :meth:`symmetric_difference`, :meth:" -"`issubset`, e :meth:`issuperset` irão aceitar qualquer iterável como um " +"Observe que, as versões não-operador dos " +"métodos :meth:`~frozenset.union`, :meth:`~frozenset.intersection`, :meth:`~frozenset.difference`, :meth:`~frozenset.symmetric_difference`, :meth:`~frozenset.issubset` " +"e :meth:`~frozenset.issuperset` irão aceitar qualquer iterável como um " "argumento. Em contraste, suas contrapartes baseadas em operadores exigem que " "seus argumentos sejam conjuntos. Isso impede construções suscetíveis a erros " -"como ``set('abc') & 'cbs'`` e favorece a forma mais legível ``set('abc')." -"intersection('cbs')``." +"como ``set('abc') & 'cbs'`` e favorece a forma mais legível " +"``set('abc').intersection('cbs')``." -#: ../../library/stdtypes.rst:4348 +#: ../../builtins/stdtypes.rst:4950 msgid "" "Both :class:`set` and :class:`frozenset` support set to set comparisons. Two " "sets are equal if and only if every element of each set is contained in the " @@ -6135,16 +8444,15 @@ msgid "" "is not equal). A set is greater than another set if and only if the first " "set is a proper superset of the second set (is a superset, but is not equal)." msgstr "" -"Tanto :class:`set` quanto :class:`frozenset` suportam comparar um conjunto " -"com outro. Dois conjuntos são iguais se, e somente se, cada elemento de cada " -"conjunto está contido no outro conjunto (cada um é um subconjunto do outro). " -"Um conjunto é menor que outro se, e somente se, o primeiro conjunto é um " -"subconjunto adequado do segundo (é um subconjunto, mas não é igual). Um " -"conjunto é maior que outro conjunto se, e somente se, o primeiro conjunto é " -"um superconjunto próprio do segundo conjunto (é um superconjunto, mas não é " -"igual)." +"Tanto :class:`set` quanto :class:`frozenset` aceitam comparações entre " +"conjuntos. Dois conjuntos são iguais se e somente se cada elemento de um " +"está contido no outro (cada um é um subconjunto do outro). Um conjunto é " +"menor que outro se, e somente se, o primeiro conjunto é um subconjunto " +"adequado do segundo (é um subconjunto, mas não é igual). Um conjunto é maior " +"que outro conjunto se, e somente se, o primeiro conjunto é um superconjunto " +"próprio do segundo conjunto (é um superconjunto, mas não é igual)." -#: ../../library/stdtypes.rst:4355 +#: ../../builtins/stdtypes.rst:4957 msgid "" "Instances of :class:`set` are compared to instances of :class:`frozenset` " "based on their members. For example, ``set('abc') == frozenset('abc')`` " @@ -6154,7 +8462,7 @@ msgstr "" "baseados nos seus membros. Por exemplo, ``set('abc') == frozenset('abc')`` " "retorna ``True`` e assim como ``set('abc') in set([frozenset('abc')])``." -#: ../../library/stdtypes.rst:4359 +#: ../../builtins/stdtypes.rst:4961 msgid "" "The subset and equality comparisons do not generalize to a total ordering " "function. For example, any two nonempty disjoint sets are not equal and are " @@ -6166,7 +8474,7 @@ msgstr "" "vazios, não são iguais e não são subconjuntos um do outro, então *todos* os " "seguintes retornam ``False``: ``ab``." -#: ../../library/stdtypes.rst:4364 +#: ../../builtins/stdtypes.rst:4966 msgid "" "Since sets only define partial ordering (subset relationships), the output " "of the :meth:`list.sort` method is undefined for lists of sets." @@ -6175,23 +8483,23 @@ msgstr "" "relacionamentos), a saída do método :meth:`list.sort` é indefinida para " "listas e conjuntos." -#: ../../library/stdtypes.rst:4367 +#: ../../builtins/stdtypes.rst:4969 msgid "Set elements, like dictionary keys, must be :term:`hashable`." msgstr "" -"Elementos de conjuntos, assim como chaves de dicionário, devem ser :term:" -"`hasheáveis `." +"Elementos de conjuntos, assim como chaves de dicionário, devem " +"ser :term:`hasheáveis `." -#: ../../library/stdtypes.rst:4369 +#: ../../builtins/stdtypes.rst:4971 msgid "" "Binary operations that mix :class:`set` instances with :class:`frozenset` " "return the type of the first operand. For example: ``frozenset('ab') | " "set('bc')`` returns an instance of :class:`frozenset`." msgstr "" -"Operações binárias que misturam instâncias de :class:`set` com :class:" -"`frozenset` retornam o tipo do primeiro operando. Por exemplo: " +"Operações binárias que misturam instâncias de :class:`set` " +"com :class:`frozenset` retornam o tipo do primeiro operando. Por exemplo: " "``frozenset('ab') | set('bc')`` retorna uma instância de :class:`frozenset`." -#: ../../library/stdtypes.rst:4373 +#: ../../builtins/stdtypes.rst:4975 msgid "" "The following table lists operations available for :class:`set` that do not " "apply to immutable instances of :class:`frozenset`:" @@ -6199,31 +8507,31 @@ msgstr "" "A seguinte tabela lista operações disponíveis para :class:`set` que não se " "aplicam para instâncias imutáveis de :class:`frozenset`:" -#: ../../library/stdtypes.rst:4379 +#: ../../builtins/stdtypes.rst:4981 msgid "Update the set, adding elements from all others." msgstr "Atualiza o conjunto, adicionando elementos dos outros." -#: ../../library/stdtypes.rst:4384 +#: ../../builtins/stdtypes.rst:4986 msgid "Update the set, keeping only elements found in it and all others." msgstr "" "Atualiza o conjunto, mantendo somente elementos encontrados nele e em outros." -#: ../../library/stdtypes.rst:4389 +#: ../../builtins/stdtypes.rst:4991 msgid "Update the set, removing elements found in others." msgstr "Atualiza o conjunto, removendo elementos encontrados em outros." -#: ../../library/stdtypes.rst:4394 +#: ../../builtins/stdtypes.rst:4996 msgid "" "Update the set, keeping only elements found in either set, but not in both." msgstr "" "Atualiza o conjunto, mantendo somente elementos encontrados em qualquer " "conjunto, mas não em ambos." -#: ../../library/stdtypes.rst:4398 +#: ../../builtins/stdtypes.rst:5000 msgid "Add element *elem* to the set." msgstr "Adiciona o elemento *elem* ao conjunto." -#: ../../library/stdtypes.rst:4402 +#: ../../builtins/stdtypes.rst:5004 msgid "" "Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not " "contained in the set." @@ -6231,11 +8539,11 @@ msgstr "" "Remove o elemento *elem* do conjunto. Levanta :exc:`KeyError` se *elem* não " "estiver contido no conjunto." -#: ../../library/stdtypes.rst:4407 +#: ../../builtins/stdtypes.rst:5009 msgid "Remove element *elem* from the set if it is present." msgstr "Remove o elemento *elem* do conjunto se ele estiver presente." -#: ../../library/stdtypes.rst:4411 +#: ../../builtins/stdtypes.rst:5013 msgid "" "Remove and return an arbitrary element from the set. Raises :exc:`KeyError` " "if the set is empty." @@ -6243,58 +8551,69 @@ msgstr "" "Remove e retorna um elemento arbitrário do conjunto. Levanta :exc:`KeyError` " "se o conjunto estiver vazio." -#: ../../library/stdtypes.rst:4416 +#: ../../builtins/stdtypes.rst:5018 msgid "Remove all elements from the set." msgstr "Remove todos os elementos do conjunto." -#: ../../library/stdtypes.rst:4419 +#: ../../builtins/stdtypes.rst:5021 +msgid "" +"Note, the non-operator versions of " +"the :meth:`~set.update`, :meth:`~set.intersection_update`, :meth:`~set.difference_update`, " +"and :meth:`~set.symmetric_difference_update` methods will accept any " +"iterable as an argument." +msgstr "" +"Perceba, as versões sem operador dos " +"métodos :meth:`~set.update`, :meth:`~set.intersection_update`, :meth:`~set.difference_update` " +"e :meth:`~set.symmetric_difference_update` irão aceitar qualquer iterável " +"como um argumento." + +#: ../../builtins/stdtypes.rst:5026 msgid "" -"Note, the non-operator versions of the :meth:`update`, :meth:" -"`intersection_update`, :meth:`difference_update`, and :meth:" -"`symmetric_difference_update` methods will accept any iterable as an " -"argument." +"Note, the *elem* argument to " +"the :meth:`~object.__contains__`, :meth:`~set.remove`, " +"and :meth:`~set.discard` methods may be a set. To support searching for an " +"equivalent frozenset, a temporary one is created from *elem*." msgstr "" -"Perceba, as versões sem operador dos métodos :meth:`update`, :meth:" -"`intersection_update`, :meth:`difference_update` e :meth:" -"`symmetric_difference_update` irão aceitar qualquer iterável como um " -"argumento." +"Perceba, o argumento *elem* para os " +"métodos :meth:`~object.__contains__`, :meth:`~set.remove` " +"e :meth:`~set.discard` pode ser um conjunto. Para suportar pesquisas por um " +"frozenset equivalente, um frozenset temporário é criado a partir de *elem*." -#: ../../library/stdtypes.rst:4424 +#: ../../builtins/stdtypes.rst:5031 msgid "" -"Note, the *elem* argument to the :meth:`~object.__contains__`, :meth:" -"`remove`, and :meth:`discard` methods may be a set. To support searching " -"for an equivalent frozenset, a temporary one is created from *elem*." +"Sets and frozensets are :ref:`generic ` over the type of their " +"elements." msgstr "" -"Perceba, o argumento *elem* para os métodos :meth:`~object.__contains__`, :" -"meth:`remove` e :meth:`discard` pode ser um conjunto. Para suportar " -"pesquisas por um frozenset equivalente, um frozenset temporário é criado a " -"partir de *elem*." +"Conjuntos e conjuntos congelados (frozensets) são :ref:`genéricos " +"` em relação ao tipo de seus elementos." -#: ../../library/stdtypes.rst:4433 +#: ../../builtins/stdtypes.rst:5036 msgid "Mapping Types --- :class:`dict`" msgstr "Tipo mapeamento --- :class:`dict`" -#: ../../library/stdtypes.rst:4443 +#: ../../builtins/stdtypes.rst:5046 msgid "" "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. " "Mappings are mutable objects. There is currently only one standard mapping " -"type, the :dfn:`dictionary`. (For other containers see the built-in :class:" -"`list`, :class:`set`, and :class:`tuple` classes, and the :mod:`collections` " -"module.)" +"type, the :dfn:`dictionary`. (For other containers see the built-" +"in :class:`list`, :class:`set`, and :class:`tuple` classes, and " +"the :mod:`collections` module.)" msgstr "" "Um objeto :term:`mapeamento ` mapeia valores :term:`hasheáveis " "` para objetos arbitrários. Mapeamentos são objetos mutáveis. " "Existe no momento apenas um tipo de mapeamento padrão, o :dfn:`dicionário`. " -"(Para outros contêineres, veja as classes embutidas :class:`list`, :class:" -"`set` e :class:`tuple`, e o módulo :mod:`collections`.)" +"(Para outros contêineres, veja as classes " +"embutidas :class:`list`, :class:`set` e :class:`tuple`, e o " +"módulo :mod:`collections`.)" -#: ../../library/stdtypes.rst:4449 +#: ../../builtins/stdtypes.rst:5052 msgid "" -"A dictionary's keys are *almost* arbitrary values. Values that are not :" -"term:`hashable`, that is, values containing lists, dictionaries or other " -"mutable types (that are compared by value rather than by object identity) " -"may not be used as keys. Values that compare equal (such as ``1``, ``1.0``, " -"and ``True``) can be used interchangeably to index the same dictionary entry." +"A dictionary's keys are *almost* arbitrary values. Values that are " +"not :term:`hashable`, that is, values containing lists, dictionaries or " +"other mutable types (that are compared by value rather than by object " +"identity) may not be used as keys. Values that compare equal (such as ``1``, " +"``1.0``, and ``True``) can be used interchangeably to index the same " +"dictionary entry." msgstr "" "As chaves de um dicionário são *quase* valores arbitrários. Valores que não " "são :term:`hasheáveis `, ou seja, valores contendo listas, " @@ -6303,7 +8622,7 @@ msgstr "" "iguais (como ``1``, ``1.0`` e ``True``) podem ser usados alternadamente para " "indexar a mesma entrada do dicionário." -#: ../../library/stdtypes.rst:4460 +#: ../../builtins/stdtypes.rst:5063 msgid "" "Return a new dictionary initialized from an optional positional argument and " "a possibly empty set of keyword arguments." @@ -6311,11 +8630,11 @@ msgstr "" "Retorna um novo dicionário inicializado a partir de um argumento posicional " "opcional, e um conjunto de argumentos nomeados possivelmente vazio." -#: ../../library/stdtypes.rst:4463 +#: ../../builtins/stdtypes.rst:5066 msgid "Dictionaries can be created by several means:" msgstr "Os dicionários podem ser criados de várias formas:" -#: ../../library/stdtypes.rst:4465 +#: ../../builtins/stdtypes.rst:5068 msgid "" "Use a comma-separated list of ``key: value`` pairs within braces: ``{'jack': " "4098, 'sjoerd': 4127}`` or ``{4098: 'jack', 4127: 'sjoerd'}``" @@ -6323,13 +8642,13 @@ msgstr "" "Usar uma lista de pares ``key: value`` separados por vírgula com chaves: " "``{'jack': 4098, 'sjoerd': 4127}`` ou ``{4098: 'jack', 4127: 'sjoerd'}``" -#: ../../library/stdtypes.rst:4467 +#: ../../builtins/stdtypes.rst:5070 msgid "Use a dict comprehension: ``{}``, ``{x: x ** 2 for x in range(10)}``" msgstr "" "Usar uma compreensão de dicionário: ``{}``, ``{x: x ** 2 for x in range(10)}" "``" -#: ../../library/stdtypes.rst:4468 +#: ../../builtins/stdtypes.rst:5071 msgid "" "Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', " "200)])``, ``dict(foo=100, bar=200)``" @@ -6337,28 +8656,29 @@ msgstr "" "Usar o construtor de tipo: ``dict()``, ``dict([('foo', 100), ('bar', " "200)])``, ``dict(foo=100, bar=200)``" -#: ../../library/stdtypes.rst:4471 +#: ../../builtins/stdtypes.rst:5074 msgid "" "If no positional argument is given, an empty dictionary is created. If a " -"positional argument is given and it is a mapping object, a dictionary is " -"created with the same key-value pairs as the mapping object. Otherwise, the " -"positional argument must be an :term:`iterable` object. Each item in the " -"iterable must itself be an iterable with exactly two objects. The first " -"object of each item becomes a key in the new dictionary, and the second " -"object the corresponding value. If a key occurs more than once, the last " -"value for that key becomes the corresponding value in the new dictionary." +"positional argument is given and it defines a ``keys()`` method, a " +"dictionary is created by calling :meth:`~object.__getitem__` on the argument " +"with each returned key from the method. Otherwise, the positional argument " +"must be an :term:`iterable` object. Each item in the iterable must itself " +"be an iterable with exactly two elements. The first element of each item " +"becomes a key in the new dictionary, and the second element the " +"corresponding value. If a key occurs more than once, the last value for " +"that key becomes the corresponding value in the new dictionary." msgstr "" "Se nenhum argumento posicional é fornecido, um dicionário vazio é criado. Se " -"um argumento posicional é fornecido e é um objeto de mapeamento, um " -"dicionário é criado com os mesmos pares de chave-valor que o objeto de " -"mapeamento. Caso contrário, o argumento posicional deve ser um objeto :term:" -"`iterável `. Cada item no iterável deve ser por si mesmo um " -"iterável com exatamente dois objetos. O primeiro objeto de cada item torna-" -"se a chave no novo dicionário, e o segundo objeto, o valor correspondente. " -"Se a chave ocorrer mais do que uma vez, o último valor para aquela chave " -"torna-se o valor correspondente no novo dicionário." +"um argumento posicional é fornecido e ele define um método ``keys()``, um " +"dicionário é criado chamando :meth:`~object.__getitem__` no argumento com " +"cada chave retornada pelo método. Caso contrário, o argumento posicional " +"deve ser um objeto :term:`iterável`. Cada item no iterável deve ser por si " +"mesmo um iterável com exatamente dois elementos. O primeiro elemento de cada " +"item torna-se a chave no novo dicionário, e o segundo elemento, o valor " +"correspondente. Se a chave ocorrer mais do que uma vez, o último valor para " +"aquela chave torna-se o valor correspondente no novo dicionário." -#: ../../library/stdtypes.rst:4481 +#: ../../builtins/stdtypes.rst:5084 msgid "" "If keyword arguments are given, the keyword arguments and their values are " "added to the dictionary created from the positional argument. If a key " @@ -6370,15 +8690,41 @@ msgstr "" "uma chave sendo adicionada já está presente, o valor do argumento nomeado " "substitui o valor do argumento posicional." -#: ../../library/stdtypes.rst:4486 +#: ../../builtins/stdtypes.rst:5089 msgid "" -"To illustrate, the following examples all return a dictionary equal to " +"Dictionaries compare equal if and only if they have the same ``(key, " +"value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', " +"'>') raise :exc:`TypeError`. To illustrate dictionary creation and " +"equality, the following examples all return a dictionary equal to " "``{\"one\": 1, \"two\": 2, \"three\": 3}``::" msgstr "" -"Para ilustrar, os seguintes exemplos todos retornam um dicionário igual a " -"``{\"one\": 1, \"two\": 2, \"three\": 3}``::" - -#: ../../library/stdtypes.rst:4498 +"Dicionários são iguais se e somente se eles os mesmos pares ``(key, value)`` " +"(independente de ordem). Comparações de ordem ('<', '<=', '>=', '>') " +"levantam :exc:`TypeError`. Para ilustrar a criação e igualdade de " +"dicionários, os exemplos a seguir retornam um dicionário igual a ``{\"one\": " +"1, \"two\": 2, \"three\": 3}``::" + +#: ../../builtins/stdtypes.rst:5095 +msgid "" +">>> a = dict(one=1, two=2, three=3)\n" +">>> b = {'one': 1, 'two': 2, 'three': 3}\n" +">>> c = dict(zip(['one', 'two', 'three'], [1, 2, 3]))\n" +">>> d = dict([('two', 2), ('one', 1), ('three', 3)])\n" +">>> e = dict({'three': 3, 'one': 1, 'two': 2})\n" +">>> f = dict({'one': 1, 'three': 3}, two=2)\n" +">>> a == b == c == d == e == f\n" +"True" +msgstr "" +">>> a = dict(one=1, two=2, three=3)\n" +">>> b = {'one': 1, 'two': 2, 'three': 3}\n" +">>> c = dict(zip(['one', 'two', 'three'], [1, 2, 3]))\n" +">>> d = dict([('two', 2), ('one', 1), ('three', 3)])\n" +">>> e = dict({'three': 3, 'one': 1, 'two': 2})\n" +">>> f = dict({'one': 1, 'three': 3}, two=2)\n" +">>> a == b == c == d == e == f\n" +"True" + +#: ../../builtins/stdtypes.rst:5104 msgid "" "Providing keyword arguments as in the first example only works for keys that " "are valid Python identifiers. Otherwise, any valid keys can be used." @@ -6387,23 +8733,81 @@ msgstr "" "para chaves que são identificadores válidos no Python. Caso contrário, " "quaisquer chaves válidas podem ser usadas." -#: ../../library/stdtypes.rst:4502 +#: ../../builtins/stdtypes.rst:5107 +msgid "" +"Dictionaries preserve insertion order. Note that updating a key does not " +"affect the order. Keys added after deletion are inserted at the end. ::" +msgstr "" +"Dicionários preservam a ordem de inserção. Perceba que atualizar a chave não " +"afeta a ordem. Chaves adicionadas após a deleção são inseridas no final. ::" + +#: ../../builtins/stdtypes.rst:5110 +msgid "" +">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" +">>> d\n" +"{'one': 1, 'two': 2, 'three': 3, 'four': 4}\n" +">>> list(d)\n" +"['one', 'two', 'three', 'four']\n" +">>> list(d.values())\n" +"[1, 2, 3, 4]\n" +">>> d[\"one\"] = 42\n" +">>> d\n" +"{'one': 42, 'two': 2, 'three': 3, 'four': 4}\n" +">>> del d[\"two\"]\n" +">>> d[\"two\"] = None\n" +">>> d\n" +"{'one': 42, 'three': 3, 'four': 4, 'two': None}" +msgstr "" +">>> d = {\"um\": 1, \"dois\": 2, \"três\": 3, \"quatro\": 4}\n" +">>> d\n" +"{'um': 1, 'dois': 2, 'três': 3, 'quatro': 4}\n" +">>> list(d)\n" +"['um', 'dois', 'três', 'quatro']\n" +">>> list(d.values())\n" +"[1, 2, 3, 4]\n" +">>> d[\"um\"] = 42\n" +">>> d\n" +"{'um': 42, 'dois': 2, 'três': 3, 'quatro': 4}\n" +">>> del d[\"dois\"]\n" +">>> d[\"dois\"] = None\n" +">>> d\n" +"{'um': 42, 'três': 3, 'quatro': 4, 'dois': None}" + +#: ../../builtins/stdtypes.rst:5125 +msgid "" +"Dictionary order is guaranteed to be insertion order. This behavior was an " +"implementation detail of CPython from 3.6." +msgstr "" +"Ordem do dicionário é garantida conforme a ordem de inserção. Este " +"comportamento era um detalhe de implementação do CPython a partir da versão " +"3.6." + +#: ../../builtins/stdtypes.rst:5129 +msgid "" +"Dictionaries are :ref:`generic ` over two types, signifying " +"(respectively) the types of the dictionary's keys and values." +msgstr "" +"Dicionários são :ref:`genéricos ` em relação a dois tipos, " +"representando (respectivamente) os tipos das chaves e dos valores do " +"dicionário." + +#: ../../builtins/stdtypes.rst:5132 msgid "" "These are the operations that dictionaries support (and therefore, custom " "mapping types should support too):" msgstr "" -"Estas são as operações que dicionários suportam (e portanto, tipos de " -"mapeamento personalizados devem suportar também):" +"Estas são as operações que dicionários aceitam (e, portanto, tipos de " +"mapeamento personalizados devem aceitar também):" -#: ../../library/stdtypes.rst:4507 +#: ../../builtins/stdtypes.rst:5137 msgid "Return a list of all the keys used in the dictionary *d*." msgstr "Retorna uma lista de todas as chaves usadas no dicionário *d*." -#: ../../library/stdtypes.rst:4511 +#: ../../builtins/stdtypes.rst:5141 msgid "Return the number of items in the dictionary *d*." msgstr "Retorna o número de itens no dicionário *d*." -#: ../../library/stdtypes.rst:4515 +#: ../../builtins/stdtypes.rst:5145 msgid "" "Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is " "not in the map." @@ -6411,39 +8815,65 @@ msgstr "" "Retorna o item de *d* com a chave *key*. Levanta um :exc:`KeyError` se *key* " "não estiver no mapeamento." -#: ../../library/stdtypes.rst:4520 -msgid "" -"If a subclass of dict defines a method :meth:`__missing__` and *key* is not " -"present, the ``d[key]`` operation calls that method with the key *key* as " -"argument. The ``d[key]`` operation then returns or raises whatever is " -"returned or raised by the ``__missing__(key)`` call. No other operations or " -"methods invoke :meth:`__missing__`. If :meth:`__missing__` is not defined, :" -"exc:`KeyError` is raised. :meth:`__missing__` must be a method; it cannot be " -"an instance variable::" -msgstr "" -"Se uma subclasse de um dict define um método :meth:`__missing__` e *key* não " -"estiver presente, a operação ``d[key]`` chama aquele método com a chave " -"*key* como argumento. A operação ``d[key]`` então retorna ou levanta o que é " -"retornado ou levantado pela chamada de ``__missing__(key)``. Nenhuma " -"operação ou métodos invocam :meth:`__missing__`. Se :meth:`__missing__` não " -"for definido, então :exc:`KeyError` é levantado. :meth:`__missing__` deve " -"ser um método; ele não pode ser uma variável de instância::" - -#: ../../library/stdtypes.rst:4539 -msgid "" -"The example above shows part of the implementation of :class:`collections." -"Counter`. A different ``__missing__`` method is used by :class:`collections." -"defaultdict`." -msgstr "" -"O exemplo acima mostra parte da implementação de :class:`collections." -"Counter`. Um método ``__missing__`` diferente é usado para :class:" -"`collections.defaultdict`." - -#: ../../library/stdtypes.rst:4545 +#: ../../builtins/stdtypes.rst:5150 +msgid "" +"If a subclass of dict defines a method :meth:`~object.__missing__` and *key* " +"is not present, the ``d[key]`` operation calls that method with the key " +"*key* as argument. The ``d[key]`` operation then returns or raises whatever " +"is returned or raised by the ``__missing__(key)`` call. No other operations " +"or methods invoke :meth:`~object.__missing__`. " +"If :meth:`~object.__missing__` is not defined, :exc:`KeyError` is " +"raised. :meth:`~object.__missing__` must be a method; it cannot be an " +"instance variable::" +msgstr "" +"Se uma subclasse de um dict define um método :meth:`~object.__missing__` e " +"*key* não estiver presente, a operação ``d[key]`` chama aquele método com a " +"chave *key* como argumento. A operação ``d[key]`` então retorna ou levanta o " +"que é retornado ou levantado pela chamada de ``__missing__(key)``. Nenhuma " +"operação ou métodos invocam :meth:`~object.__missing__`. " +"Se :meth:`~object.__missing__` não for definido, então :exc:`KeyError` é " +"levantada. :meth:`~object.__missing__` deve ser um método; ele não pode ser " +"uma variável de instância::" + +#: ../../builtins/stdtypes.rst:5158 +msgid "" +">>> class Counter(dict):\n" +"... def __missing__(self, key):\n" +"... return 0\n" +"...\n" +">>> c = Counter()\n" +">>> c['red']\n" +"0\n" +">>> c['red'] += 1\n" +">>> c['red']\n" +"1" +msgstr "" +">>> class Counter(dict):\n" +"... def __missing__(self, key):\n" +"... return 0\n" +"...\n" +">>> c = Counter()\n" +">>> c['red']\n" +"0\n" +">>> c['red'] += 1\n" +">>> c['red']\n" +"1" + +#: ../../builtins/stdtypes.rst:5169 +msgid "" +"The example above shows part of the implementation " +"of :class:`collections.Counter`. A different :meth:`!__missing__` method is " +"used by :class:`collections.defaultdict`." +msgstr "" +"O exemplo acima mostra parte da implementação " +"de :class:`collections.Counter`. Um método :meth:`!__missing__` diferente é " +"usado para :class:`collections.defaultdict`." + +#: ../../builtins/stdtypes.rst:5176 msgid "Set ``d[key]`` to *value*." msgstr "Define ``d[key]`` para *value*." -#: ../../library/stdtypes.rst:4549 +#: ../../builtins/stdtypes.rst:5180 msgid "" "Remove ``d[key]`` from *d*. Raises a :exc:`KeyError` if *key* is not in the " "map." @@ -6451,16 +8881,16 @@ msgstr "" "Remove ``d[key]`` do *d*. Levanta uma exceção :exc:`KeyError` se *key* não " "estiver no mapeamento." -#: ../../library/stdtypes.rst:4554 +#: ../../builtins/stdtypes.rst:5185 msgid "Return ``True`` if *d* has a key *key*, else ``False``." msgstr "" "Retorna ``True`` se *d* tiver uma chave *key*, caso contrário ``False``." -#: ../../library/stdtypes.rst:4558 +#: ../../builtins/stdtypes.rst:5189 msgid "Equivalent to ``not key in d``." msgstr "Equivalente a ``not key in d``." -#: ../../library/stdtypes.rst:4562 +#: ../../builtins/stdtypes.rst:5193 msgid "" "Return an iterator over the keys of the dictionary. This is a shortcut for " "``iter(d.keys())``." @@ -6468,22 +8898,22 @@ msgstr "" "Retorna um iterador para as chaves do dicionário. Isso é um atalho para " "``iter(d.keys())``." -#: ../../library/stdtypes.rst:4567 +#: ../../builtins/stdtypes.rst:5198 msgid "Remove all items from the dictionary." msgstr "Remove todos os itens do dicionário." -#: ../../library/stdtypes.rst:4571 +#: ../../builtins/stdtypes.rst:5202 msgid "Return a shallow copy of the dictionary." msgstr "Retorna uma cópia superficial do dicionário." -#: ../../library/stdtypes.rst:4575 +#: ../../builtins/stdtypes.rst:5206 msgid "" "Create a new dictionary with keys from *iterable* and values set to *value*." msgstr "" "Cria um novo dicionário com chaves provenientes de *iterable* e valores " "definidos como *value*." -#: ../../library/stdtypes.rst:4577 +#: ../../builtins/stdtypes.rst:5208 msgid "" ":meth:`fromkeys` is a class method that returns a new dictionary. *value* " "defaults to ``None``. All of the values refer to just a single instance, so " @@ -6497,7 +8927,7 @@ msgstr "" "objeto mutável tal como uma lista vazia. Para obter valores distintos, use " "uma :ref:`compreensão de dicionário ` ao invés." -#: ../../library/stdtypes.rst:4585 +#: ../../builtins/stdtypes.rst:5216 msgid "" "Return the value for *key* if *key* is in the dictionary, else *default*. If " "*default* is not given, it defaults to ``None``, so that this method never " @@ -6507,7 +8937,7 @@ msgstr "" "*default*. Se *default* não é fornecido, será usado o valor padrão ``None``, " "de tal forma que este método nunca levanta um :exc:`KeyError`." -#: ../../library/stdtypes.rst:4591 +#: ../../builtins/stdtypes.rst:5222 msgid "" "Return a new view of the dictionary's items (``(key, value)`` pairs). See " "the :ref:`documentation of view objects `." @@ -6515,7 +8945,7 @@ msgstr "" "Retorna uma nova visão dos itens do dicionário (pares de ``(key, value)``). " "Veja a :ref:`documentação de objetos de visão de dicionário `." -#: ../../library/stdtypes.rst:4596 +#: ../../builtins/stdtypes.rst:5227 msgid "" "Return a new view of the dictionary's keys. See the :ref:`documentation of " "view objects `." @@ -6523,17 +8953,17 @@ msgstr "" "Retorna uma nova visão das chaves do dicionário. Veja a :ref:`documentação " "de objetos de visão de dicionário `." -#: ../../library/stdtypes.rst:4601 +#: ../../builtins/stdtypes.rst:5233 msgid "" "If *key* is in the dictionary, remove it and return its value, else return " -"*default*. If *default* is not given and *key* is not in the dictionary, a :" -"exc:`KeyError` is raised." +"*default*. If *default* is not given and *key* is not in the dictionary, " +"a :exc:`KeyError` is raised." msgstr "" "Se *key* está no dicionário, remove a mesma e retorna o seu valor, caso " "contrário retorna *default*. Se *default* não foi fornecido e *key* não está " "no dicionário, um :exc:`KeyError` é levantado." -#: ../../library/stdtypes.rst:4607 +#: ../../builtins/stdtypes.rst:5239 msgid "" "Remove and return a ``(key, value)`` pair from the dictionary. Pairs are " "returned in :abbr:`LIFO (last-in, first-out)` order." @@ -6541,17 +8971,17 @@ msgstr "" "Remove e retorna um par ``(key, value)`` do dicionário. Pares são retornados " "como uma pilha, ou seja em ordem :abbr:`LIFO (last-in, first-out)`." -#: ../../library/stdtypes.rst:4610 +#: ../../builtins/stdtypes.rst:5242 msgid "" ":meth:`popitem` is useful to destructively iterate over a dictionary, as " -"often used in set algorithms. If the dictionary is empty, calling :meth:" -"`popitem` raises a :exc:`KeyError`." +"often used in set algorithms. If the dictionary is empty, " +"calling :meth:`popitem` raises a :exc:`KeyError`." msgstr "" ":meth:`popitem` é útil para destrutivamente iterar sobre um dicionário, algo " "comumente usado em algoritmos de conjunto. Se o dicionário estiver vazio, " "chamar :meth:`popitem` levanta um :exc:`KeyError`." -#: ../../library/stdtypes.rst:4614 +#: ../../builtins/stdtypes.rst:5246 msgid "" "LIFO order is now guaranteed. In prior versions, :meth:`popitem` would " "return an arbitrary key/value pair." @@ -6559,7 +8989,7 @@ msgstr "" "Ordem LIFO agora é garantida. Em versões anteriores, :meth:`popitem` iria " "retornar um par chave/valor arbitrário." -#: ../../library/stdtypes.rst:4620 +#: ../../builtins/stdtypes.rst:5252 msgid "" "Return a reverse iterator over the keys of the dictionary. This is a " "shortcut for ``reversed(d.keys())``." @@ -6567,7 +8997,7 @@ msgstr "" "Retorna um iterador revertido sobre as chaves do dicionário. Isso é um " "atalho para ``reversed(d.keys())``." -#: ../../library/stdtypes.rst:4627 +#: ../../builtins/stdtypes.rst:5259 msgid "" "If *key* is in the dictionary, return its value. If not, insert *key* with " "a value of *default* and return *default*. *default* defaults to ``None``." @@ -6576,27 +9006,30 @@ msgstr "" "valor *default* e retorna *default*. *default* por padrão usa o valor " "``None``." -#: ../../library/stdtypes.rst:4633 +#: ../../builtins/stdtypes.rst:5267 msgid "" -"Update the dictionary with the key/value pairs from *other*, overwriting " -"existing keys. Return ``None``." +"Update the dictionary with the key/value pairs from *mapping* or *iterable* " +"and *kwargs*, overwriting existing keys. Return ``None``." msgstr "" -"Atualiza o dicionário com os pares chave/valor existente em *other*, " -"sobrescrevendo chaves existentes. Retorna ``None``." +"Atualiza o dicionário com os pares chave/valor de *mapping* ou *iterable* e " +"*kwargs*, sobrescrevendo chaves existentes. Retorna ``None``." -#: ../../library/stdtypes.rst:4636 +#: ../../builtins/stdtypes.rst:5270 msgid "" -":meth:`update` accepts either another dictionary object or an iterable of " -"key/value pairs (as tuples or other iterables of length two). If keyword " -"arguments are specified, the dictionary is then updated with those key/value " -"pairs: ``d.update(red=1, blue=2)``." +":meth:`update` accepts either another object with a ``keys()`` method (in " +"which case :meth:`~object.__getitem__` is called with every key returned " +"from the method) or an iterable of key/value pairs (as tuples or other " +"iterables of length two). If keyword arguments are specified, the dictionary " +"is then updated with those key/value pairs: ``d.update(red=1, blue=2)``." msgstr "" -":meth:`update` aceita ou outro objeto dicionário, ou um iterável de pares de " -"chave/valor (como tuplas ou outros iteráveis de comprimento dois). Se " -"argumentos nomeados são especificados, o dicionário é então atualizado com " -"esses pares de chave/valor: ``d.update(red=1, blue=2)``." +":meth:`update` aceita ou outro objeto com um método ``keys()`` (em cada " +"caso :meth:`~object.__getitem__` é chamado com cada chave retornada pelo " +"método) ou um iterável de pares de chave/valor (como tuplas ou outros " +"iteráveis de comprimento dois). Se argumentos nomeados são especificados, o " +"dicionário é então atualizado com esses pares de chave/valor: " +"``d.update(red=1, blue=2)``." -#: ../../library/stdtypes.rst:4643 +#: ../../builtins/stdtypes.rst:5278 msgid "" "Return a new view of the dictionary's values. See the :ref:`documentation " "of view objects `." @@ -6604,17 +9037,27 @@ msgstr "" "Retorna uma nova visão dos valores do dicionário. Veja a :ref:`documentação " "de objetos de visão de dicionário `." -#: ../../library/stdtypes.rst:4646 +#: ../../builtins/stdtypes.rst:5281 msgid "" "An equality comparison between one ``dict.values()`` view and another will " "always return ``False``. This also applies when comparing ``dict.values()`` " "to itself::" msgstr "" "Uma comparação de igualdade entre uma visão de ``dict.values()`` e outra, " -"sempre irá retornar ``False``. Isso também se aplica ao comparar ``dict." -"values()`` entre si::" +"sempre irá retornar ``False``. Isso também se aplica ao comparar " +"``dict.values()`` entre si::" + +#: ../../builtins/stdtypes.rst:5285 +msgid "" +">>> d = {'a': 1}\n" +">>> d.values() == d.values()\n" +"False" +msgstr "" +">>> d = {'a': 1}\n" +">>> d.values() == d.values()\n" +"False" -#: ../../library/stdtypes.rst:4656 +#: ../../builtins/stdtypes.rst:5291 msgid "" "Create a new dictionary with the merged keys and values of *d* and *other*, " "which must both be dictionaries. The values of *other* take priority when " @@ -6624,77 +9067,72 @@ msgstr "" "*other*, que devem ser dicionários. Os valores de *other* têm prioridade " "quando *d* e *other* compartilham chaves." -#: ../../library/stdtypes.rst:4664 +#: ../../builtins/stdtypes.rst:5299 msgid "" "Update the dictionary *d* with keys and values from *other*, which may be " "either a :term:`mapping` or an :term:`iterable` of key/value pairs. The " "values of *other* take priority when *d* and *other* share keys." msgstr "" -"Atualiza o dicionário *d* com chaves e valores de *other*, que podem ser a :" -"term:`mapeamento ` ou um :term:`iterável ` dos pares " +"Atualiza o dicionário *d* com chaves e valores de *other*, que podem ser " +"a :term:`mapeamento ` ou um :term:`iterável ` dos pares " "chave/valor. Os valores de *other* têm prioridade quando *d* e *other* " "compartilham chaves." -#: ../../library/stdtypes.rst:4670 -msgid "" -"Dictionaries compare equal if and only if they have the same ``(key, " -"value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', " -"'>') raise :exc:`TypeError`." -msgstr "" -"Dicionários são iguais se e somente se eles os mesmos pares ``(key, value)`` " -"(independente de ordem). Comparações de ordem ('<', '<=', '>=', '>') " -"levantam :exc:`TypeError`." - -#: ../../library/stdtypes.rst:4674 -msgid "" -"Dictionaries preserve insertion order. Note that updating a key does not " -"affect the order. Keys added after deletion are inserted at the end. ::" -msgstr "" -"Dicionários preservam a ordem de inserção. Perceba que atualizar a chave não " -"afeta a ordem. Chaves adicionadas após a deleção são inseridas no final. ::" - -#: ../../library/stdtypes.rst:4692 -msgid "" -"Dictionary order is guaranteed to be insertion order. This behavior was an " -"implementation detail of CPython from 3.6." -msgstr "" -"Ordem do dicionário é garantida conforme a ordem de inserção. Este " -"comportamento era um detalhe de implementação do CPython a partir da versão " -"3.6." - -#: ../../library/stdtypes.rst:4696 +#: ../../builtins/stdtypes.rst:5305 msgid "Dictionaries and dictionary views are reversible. ::" msgstr "Dicionários e visões de dicionários são reversíveis. ::" -#: ../../library/stdtypes.rst:4708 +#: ../../builtins/stdtypes.rst:5307 +msgid "" +">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" +">>> d\n" +"{'one': 1, 'two': 2, 'three': 3, 'four': 4}\n" +">>> list(reversed(d))\n" +"['four', 'three', 'two', 'one']\n" +">>> list(reversed(d.values()))\n" +"[4, 3, 2, 1]\n" +">>> list(reversed(d.items()))\n" +"[('four', 4), ('three', 3), ('two', 2), ('one', 1)]" +msgstr "" +">>> d = {\"um\": 1, \"dois\": 2, \"três\": 3, \"quatro\": 4}\n" +">>> d\n" +"{'um': 1, 'dois': 2, 'três': 3, 'quatro': 4}\n" +">>> list(reversed(d))\n" +"['quatro', 'três', 'dois', 'um']\n" +">>> list(reversed(d.values()))\n" +"[4, 3, 2, 1]\n" +">>> list(reversed(d.items()))\n" +"[('quatro', 4), ('três', 3), ('dois', 2), ('um', 1)]" + +#: ../../builtins/stdtypes.rst:5317 msgid "Dictionaries are now reversible." msgstr "Dicionários agora são reversíveis." -#: ../../library/stdtypes.rst:4713 +#: ../../builtins/stdtypes.rst:5322 msgid "" -":class:`types.MappingProxyType` can be used to create a read-only view of a :" -"class:`dict`." +":class:`types.MappingProxyType` can be used to create a read-only view of " +"a :class:`dict`." msgstr "" ":class:`types.MappingProxyType` podem ser usados para criar uma visão " "somente leitura de um :class:`dict`." -#: ../../library/stdtypes.rst:4720 +#: ../../builtins/stdtypes.rst:5329 msgid "Dictionary view objects" msgstr "Objetos de visão de dicionário" -#: ../../library/stdtypes.rst:4722 +#: ../../builtins/stdtypes.rst:5331 msgid "" -"The objects returned by :meth:`dict.keys`, :meth:`dict.values` and :meth:" -"`dict.items` are *view objects*. They provide a dynamic view on the " -"dictionary's entries, which means that when the dictionary changes, the view " -"reflects these changes." +"The objects returned by :meth:`dict.keys`, :meth:`dict.values` " +"and :meth:`dict.items` are *view objects*. They provide a dynamic view on " +"the dictionary's entries, which means that when the dictionary changes, the " +"view reflects these changes." msgstr "" -"Os objetos retornados por :meth:`dict.keys`, :meth:`dict.values` e :meth:" -"`dict.items` são *objetos de visão*. Eles fornecem uma visão dinâmica das " -"entradas do dicionário, o que significa que quando o dicionário muda, a " -"visão reflete essas mudanças." +"Os objetos retornados por :meth:`dict.keys`, :meth:`dict.values` " +"e :meth:`dict.items` são *objetos de visão*. Eles fornecem uma visão " +"dinâmica das entradas do dicionário, o que significa que quando o dicionário " +"muda, a visão reflete essas mudanças." -#: ../../library/stdtypes.rst:4727 +#: ../../builtins/stdtypes.rst:5336 msgid "" "Dictionary views can be iterated over to yield their respective data, and " "support membership tests:" @@ -6702,11 +9140,11 @@ msgstr "" "Visões de dicionários podem ser iteradas para apresentar seus respectivos " "dados, e suportar testes de existência:" -#: ../../library/stdtypes.rst:4732 +#: ../../builtins/stdtypes.rst:5341 msgid "Return the number of entries in the dictionary." msgstr "Retorna o número de entradas no dicionário." -#: ../../library/stdtypes.rst:4736 +#: ../../builtins/stdtypes.rst:5345 msgid "" "Return an iterator over the keys, values or items (represented as tuples of " "``(key, value)``) in the dictionary." @@ -6714,19 +9152,19 @@ msgstr "" "Retorna um iterador sobre as chaves, valores ou itens (representados como " "tuplas de ``(key, value)``) no dicionário." -#: ../../library/stdtypes.rst:4739 +#: ../../builtins/stdtypes.rst:5348 msgid "" "Keys and values are iterated over in insertion order. This allows the " -"creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d." -"values(), d.keys())``. Another way to create the same list is ``pairs = " -"[(v, k) for (k, v) in d.items()]``." +"creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = " +"zip(d.values(), d.keys())``. Another way to create the same list is ``pairs " +"= [(v, k) for (k, v) in d.items()]``." msgstr "" "Chaves e valores são iterados em ordem de inserção. Isso permite a criação " -"de pares ``(value, key)`` usando :func:`zip`: ``pairs = zip(d.values(), d." -"keys())``. Outra maneira de criar a mesma lista é ``pairs = [(v, k) for (k, " -"v) in d.items()]``." +"de pares ``(value, key)`` usando :func:`zip`: ``pairs = zip(d.values(), " +"d.keys())``. Outra maneira de criar a mesma lista é ``pairs = [(v, k) for " +"(k, v) in d.items()]``." -#: ../../library/stdtypes.rst:4744 +#: ../../builtins/stdtypes.rst:5353 msgid "" "Iterating views while adding or deleting entries in the dictionary may raise " "a :exc:`RuntimeError` or fail to iterate over all entries." @@ -6734,11 +9172,11 @@ msgstr "" "Iterar sobre visões enquanto adiciona ou deleta entradas no dicionário pode " "levantar um :exc:`RuntimeError` ou falhar a iteração sobre todas as entradas." -#: ../../library/stdtypes.rst:4747 +#: ../../builtins/stdtypes.rst:5356 msgid "Dictionary order is guaranteed to be insertion order." msgstr "Ordem do dicionário é garantida como a ordem de inserção." -#: ../../library/stdtypes.rst:4752 +#: ../../builtins/stdtypes.rst:5361 msgid "" "Return ``True`` if *x* is in the underlying dictionary's keys, values or " "items (in the latter case, *x* should be a ``(key, value)`` tuple)." @@ -6746,7 +9184,7 @@ msgstr "" "Retorna ``True`` se *x* está nas chaves, valores ou itens do dicionário " "subjacente (no último caso, *x* deve ser uma tupla de ``(key, value)``)." -#: ../../library/stdtypes.rst:4757 +#: ../../builtins/stdtypes.rst:5366 msgid "" "Return a reverse iterator over the keys, values or items of the dictionary. " "The view will be iterated in reverse order of the insertion." @@ -6754,11 +9192,11 @@ msgstr "" "Retorna um iterador reverso sobre as chaves, valores ou itens do dicionário. " "A visão será iterada na ordem reversa de inserção." -#: ../../library/stdtypes.rst:4760 +#: ../../builtins/stdtypes.rst:5369 msgid "Dictionary views are now reversible." msgstr "Visões de dicionário agora são reversíveis." -#: ../../library/stdtypes.rst:4765 +#: ../../builtins/stdtypes.rst:5374 msgid "" "Return a :class:`types.MappingProxyType` that wraps the original dictionary " "to which the view refers." @@ -6766,7 +9204,7 @@ msgstr "" "Retorna um :class:`types.MappingProxyType` que envolve o dicionário original " "ao qual a visão se refere." -#: ../../library/stdtypes.rst:4770 +#: ../../builtins/stdtypes.rst:5379 msgid "" "Keys views are set-like since their entries are unique and :term:`hashable`. " "Items views also have set-like operations since the (key, value) pairs are " @@ -6779,28 +9217,108 @@ msgid "" "any iterable as the other operand, unlike sets which only accept sets as the " "input." msgstr "" -"Visões chave são similar a conjunto, como suas entradas são únicas e :term:" -"`hasheáveis `. As visões de itens também têm operações " +"Visões chave são similar a conjunto, como suas entradas são únicas " +"e :term:`hasheáveis `. As visões de itens também têm operações " "semelhantes a conjuntos, uma vez que os pares (chave, valor) são únicos e as " "chaves são hasheáveis. Se todos os valores em uma visão de itens também " "forem hasheáveis, a visão de itens poderá interoperar com outros conjuntos. " "(Visões de valores não são tratadas de como similar a conjunto, pois as " "entradas geralmente não são únicas.) Para visões similares a conjunto, todas " -"as operações definidas para a classe base abstrata :class:`collections.abc." -"Set` estão disponíveis (por exemplo, ``==``, ``<`` ou ``^``). Ao usar " -"operadores de conjunto, visões de conjunto ou similares aceitam qualquer " -"iterável como outro operando, ao contrário de conjuntos que aceitam apenas " -"conjuntos como entrada." +"as operações definidas para a classe base " +"abstrata :class:`collections.abc.Set` estão disponíveis (por exemplo, " +"``==``, ``<`` ou ``^``). Ao usar operadores de conjunto, visões de conjunto " +"ou similares aceitam qualquer iterável como outro operando, ao contrário de " +"conjuntos que aceitam apenas conjuntos como entrada." -#: ../../library/stdtypes.rst:4782 +#: ../../builtins/stdtypes.rst:5391 msgid "An example of dictionary view usage::" msgstr "Um exemplo da utilização da visualização de dicionário::" -#: ../../library/stdtypes.rst:4826 +#: ../../builtins/stdtypes.rst:5393 +msgid "" +">>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}\n" +">>> keys = dishes.keys()\n" +">>> values = dishes.values()\n" +"\n" +">>> # iteration\n" +">>> n = 0\n" +">>> for val in values:\n" +"... n += val\n" +"...\n" +">>> print(n)\n" +"504\n" +"\n" +">>> # keys and values are iterated over in the same order (insertion order)\n" +">>> list(keys)\n" +"['eggs', 'sausage', 'bacon', 'spam']\n" +">>> list(values)\n" +"[2, 1, 1, 500]\n" +"\n" +">>> # view objects are dynamic and reflect dict changes\n" +">>> del dishes['eggs']\n" +">>> del dishes['sausage']\n" +">>> list(keys)\n" +"['bacon', 'spam']\n" +"\n" +">>> # set operations\n" +">>> keys & {'eggs', 'bacon', 'salad'}\n" +"{'bacon'}\n" +">>> keys ^ {'sausage', 'juice'} == {'juice', 'sausage', 'bacon', 'spam'}\n" +"True\n" +">>> keys | ['juice', 'juice', 'juice'] == {'bacon', 'spam', 'juice'}\n" +"True\n" +"\n" +">>> # get back a read-only proxy for the original dictionary\n" +">>> values.mapping\n" +"mappingproxy({'bacon': 1, 'spam': 500})\n" +">>> values.mapping['spam']\n" +"500" +msgstr "" +">>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}\n" +">>> keys = dishes.keys()\n" +">>> values = dishes.values()\n" +"\n" +">>> # iteration\n" +">>> n = 0\n" +">>> for val in values:\n" +"... n += val\n" +"...\n" +">>> print(n)\n" +"504\n" +"\n" +">>> # a iteração sobre chaves e valores é feita na mesma ordem (ordem de " +"inserção)\n" +">>> list(keys)\n" +"['eggs', 'sausage', 'bacon', 'spam']\n" +">>> list(values)\n" +"[2, 1, 1, 500]\n" +"\n" +">>> # objetos de visualização são dinâmicos e refletem mudanças no " +"dicionário\n" +">>> del dishes['eggs']\n" +">>> del dishes['sausage']\n" +">>> list(keys)\n" +"['bacon', 'spam']\n" +"\n" +">>> # operações de conjunto\n" +">>> keys & {'eggs', 'bacon', 'salad'}\n" +"{'bacon'}\n" +">>> keys ^ {'sausage', 'juice'} == {'juice', 'sausage', 'bacon', 'spam'}\n" +"True\n" +">>> keys | ['juice', 'juice', 'juice'] == {'bacon', 'spam', 'juice'}\n" +"True\n" +"\n" +">>> # recupera um proxy somente de leitura para o dicionário original\n" +">>> values.mapping\n" +"mappingproxy({'bacon': 1, 'spam': 500})\n" +">>> values.mapping['spam']\n" +"500" + +#: ../../builtins/stdtypes.rst:5435 msgid "Context Manager Types" msgstr "Tipos de Gerenciador de Contexto" -#: ../../library/stdtypes.rst:4833 +#: ../../builtins/stdtypes.rst:5442 msgid "" "Python's :keyword:`with` statement supports the concept of a runtime context " "defined by a context manager. This is implemented using a pair of methods " @@ -6814,7 +9332,7 @@ msgstr "" "inicializado antes da execução das instruções, e encerrado quando as " "instruções terminam:" -#: ../../library/stdtypes.rst:4841 +#: ../../builtins/stdtypes.rst:5450 msgid "" "Enter the runtime context and return either this object or another object " "related to the runtime context. The value returned by this method is bound " @@ -6823,21 +9341,22 @@ msgid "" msgstr "" "Entra no contexto em tempo de execução e retorna este objeto ou outro objeto " "relacionado ao contexto em tempo de execução. O valor retornado por este " -"método é ligado ao identificador na cláusula :keyword:`!as` das instruções :" -"keyword:`with` usando este gerenciador de contexto." +"método é ligado ao identificador na cláusula :keyword:`!as` das " +"instruções :keyword:`with` usando este gerenciador de contexto." -#: ../../library/stdtypes.rst:4846 +#: ../../builtins/stdtypes.rst:5455 msgid "" "An example of a context manager that returns itself is a :term:`file " -"object`. File objects return themselves from __enter__() to allow :func:" -"`open` to be used as the context expression in a :keyword:`with` statement." +"object`. File objects return themselves from __enter__() to " +"allow :func:`open` to be used as the context expression in a :keyword:`with` " +"statement." msgstr "" -"Um exemplo de gerenciador de contexto que retorna a si mesmo é um :term:" -"`objeto arquivo `. Objeto arquivos retornam a si mesmos do " -"método __enter__() para permitir que :func:`open` seja usado como a " -"expressão de contexto em uma instrução :keyword:`with`." +"Um exemplo de gerenciador de contexto que retorna a si mesmo é " +"um :term:`objeto arquivo `. Objeto arquivos retornam a si " +"mesmos do método __enter__() para permitir que :func:`open` seja usado como " +"a expressão de contexto em uma instrução :keyword:`with`." -#: ../../library/stdtypes.rst:4850 +#: ../../builtins/stdtypes.rst:5459 msgid "" "An example of a context manager that returns a related object is the one " "returned by :func:`decimal.localcontext`. These managers set the active " @@ -6853,7 +9372,7 @@ msgstr "" "no contexto decimal atual, no corpo contido na instrução :keyword:`with`, " "sem afetar o código fora da instrução :keyword:`!with`." -#: ../../library/stdtypes.rst:4860 +#: ../../builtins/stdtypes.rst:5469 msgid "" "Exit the runtime context and return a Boolean flag indicating if any " "exception that occurred should be suppressed. If an exception occurred while " @@ -6868,30 +9387,35 @@ msgstr "" "(situação da pilha de execução). Caso contrário, os três argumentos são " "``None``." -#: ../../library/stdtypes.rst:4865 +#: ../../builtins/stdtypes.rst:5474 msgid "" "Returning a true value from this method will cause the :keyword:`with` " "statement to suppress the exception and continue execution with the " "statement immediately following the :keyword:`!with` statement. Otherwise " -"the exception continues propagating after this method has finished " -"executing. Exceptions that occur during execution of this method will " -"replace any exception that occurred in the body of the :keyword:`!with` " -"statement." +"the exception continues propagating after this method has finished executing." +msgstr "" +"Retornar um valor verdadeiro deste método fará com que a " +"instrução :keyword:`with` suprima a exceção e continue a execução com a " +"instrução imediatamente após a instrução :keyword:`!with`. Caso contrário a " +"exceção continuará propagando após este método ter encerrado sua execução." + +#: ../../builtins/stdtypes.rst:5479 +msgid "" +"If this method raises an exception while handling an earlier exception from " +"the :keyword:`with` block, the new exception is raised, and the original " +"exception is stored in its :attr:`~BaseException.__context__` attribute." msgstr "" -"Retornar um valor verdadeiro deste método fará com que a instrução :keyword:" -"`with` suprima a exceção e continue a execução com a instrução imediatamente " -"após a instrução :keyword:`!with`. Caso contrário a exceção continuará " -"propagando após este método ter encerrado sua execução. Exceções que " -"ocorrerem durante a execução deste método irão substituir qualquer exceção " -"que tenha ocorrido dentro do corpo da instrução :keyword:`!with`." +"Se este método levantar uma exceção enquanto trata uma exceção anterior do " +"bloco :keyword:`with`, a nova exceção é levantada e a exceção original é " +"armazenada em seu atributo :attr:`~BaseException.__context__`." -#: ../../library/stdtypes.rst:4872 +#: ../../builtins/stdtypes.rst:5483 msgid "" "The exception passed in should never be reraised explicitly - instead, this " "method should return a false value to indicate that the method completed " "successfully and does not want to suppress the raised exception. This allows " -"context management code to easily detect whether or not an :meth:`~object." -"__exit__` method has actually failed." +"context management code to easily detect whether or not " +"an :meth:`~object.__exit__` method has actually failed." msgstr "" "A exceção passada nunca deve ser re-levantada explicitamente - ao invés " "disso, este método deve retornar um valor falso para indicar que o método " @@ -6899,7 +9423,7 @@ msgstr "" "Isso permite ao código do gerenciador de contexto facilmente detectar se um " "método :meth:`~object.__exit__` realmente falhou ou não." -#: ../../library/stdtypes.rst:4878 +#: ../../builtins/stdtypes.rst:5489 msgid "" "Python defines several context managers to support easy thread " "synchronisation, prompt closure of files or other objects, and simpler " @@ -6911,27 +9435,29 @@ msgstr "" "sincronização de threads, solicita o fechamento de arquivos ou outros " "objetos, e manipula de forma simples o contexto ativo de aritmética decimal. " "Os tipos especificados não são tratados de forma especial além da sua " -"implementação e do protocolo do gerenciador de contexto. Veja o módulo :mod:" -"`contextlib` para alguns exemplos." +"implementação e do protocolo do gerenciador de contexto. Veja o " +"módulo :mod:`contextlib` para alguns exemplos." -#: ../../library/stdtypes.rst:4884 +#: ../../builtins/stdtypes.rst:5495 msgid "" "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` " "decorator provide a convenient way to implement these protocols. If a " "generator function is decorated with the :class:`contextlib.contextmanager` " -"decorator, it will return a context manager implementing the necessary :meth:" -"`~contextmanager.__enter__` and :meth:`~contextmanager.__exit__` methods, " -"rather than the iterator produced by an undecorated generator function." -msgstr "" -"Os :term:`gerador`\\es do Python e o decorador :class:`contextlib." -"contextmanager` fornecem uma maneira conveniente de implementar esses " -"protocolos. Se uma função geradora for decorada com o decorador :class:" -"`contextlib.contextmanager`, ela retornará um gerenciador de contexto " -"implementando os métodos necessários :meth:`~contextmanager.__enter__` e :" -"meth:`~contextmanager.__exit__`, em vez de o iterador produzido por uma " +"decorator, it will return a context manager implementing the " +"necessary :meth:`~contextmanager.__enter__` " +"and :meth:`~contextmanager.__exit__` methods, rather than the iterator " +"produced by an undecorated generator function." +msgstr "" +"Os :term:`gerador`\\es do Python e o " +"decorador :class:`contextlib.contextmanager` fornecem uma maneira " +"conveniente de implementar esses protocolos. Se uma função geradora for " +"decorada com o decorador :class:`contextlib.contextmanager`, ela retornará " +"um gerenciador de contexto implementando os métodos " +"necessários :meth:`~contextmanager.__enter__` " +"e :meth:`~contextmanager.__exit__`, em vez de o iterador produzido por uma " "função geradora não decorada." -#: ../../library/stdtypes.rst:4891 +#: ../../builtins/stdtypes.rst:5502 msgid "" "Note that there is no specific slot for any of these methods in the type " "structure for Python objects in the Python/C API. Extension types wanting to " @@ -6946,28 +9472,28 @@ msgstr "" "contexto em tempo de execução, a sobrecarga na pesquisa de dicionário em uma " "única classe é negligenciável." -#: ../../library/stdtypes.rst:4899 +#: ../../builtins/stdtypes.rst:5510 msgid "" -"Type Annotation Types --- :ref:`Generic Alias `, :ref:" -"`Union `" +"Type Annotation Types --- :ref:`Generic Alias `, :ref:`Union `" msgstr "" -"Tipos de anotação de tipo --- :ref:`Apelido genérico `, :" -"ref:`União `" +"Tipos de anotação de tipo --- :ref:`Apelido genérico `, :ref:`União `" -#: ../../library/stdtypes.rst:4904 +#: ../../builtins/stdtypes.rst:5515 msgid "" -"The core built-in types for :term:`type annotations ` are :ref:" -"`Generic Alias ` and :ref:`Union `." +"The core built-in types for :term:`type annotations ` " +"are :ref:`Generic Alias ` and :ref:`Union `." msgstr "" "Os principais tipos embutidos para :term:`anotações de tipo ` " "são :ref:`Apelido genérico ` e :ref:`União `." -#: ../../library/stdtypes.rst:4911 +#: ../../builtins/stdtypes.rst:5522 msgid "Generic Alias Type" msgstr "Tipo Generic Alias" -#: ../../library/stdtypes.rst:4917 +#: ../../builtins/stdtypes.rst:5528 msgid "" "``GenericAlias`` objects are generally created by :ref:`subscripting " "` a class. They are most often used with :ref:`container " @@ -6984,7 +9510,7 @@ msgstr "" "são destinados principalmente para uso com :term:`anotações de tipo " "`." -#: ../../library/stdtypes.rst:4927 +#: ../../builtins/stdtypes.rst:5538 msgid "" "It is generally only possible to subscript a class if the class implements " "the special method :meth:`~object.__class_getitem__`." @@ -6992,7 +9518,7 @@ msgstr "" "Geralmente só é possível subscrever uma classe se a classe implementar o " "método especial :meth:`~object.__class_getitem__`." -#: ../../library/stdtypes.rst:4930 +#: ../../builtins/stdtypes.rst:5541 msgid "" "A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, " "implementing *parameterized generics*." @@ -7000,21 +9526,21 @@ msgstr "" "Um objeto ``GenericAlias`` atua como um proxy para um :term:`tipo genérico`, " "implementando *genéricos parametrizados*." -#: ../../library/stdtypes.rst:4933 +#: ../../builtins/stdtypes.rst:5544 msgid "" "For a container class, the argument(s) supplied to a :ref:`subscription " "` of the class may indicate the type(s) of the elements an " "object contains. For example, ``set[bytes]`` can be used in type annotations " -"to signify a :class:`set` in which all the elements are of type :class:" -"`bytes`." +"to signify a :class:`set` in which all the elements are of " +"type :class:`bytes`." msgstr "" -"Para uma classe contêiner, o(s) argumento(s) fornecido(s) para uma :ref:" -"`subscrição ` da classe pode indicar o(s) tipo(s) dos " -"elementos que um objeto contém. Por exemplo, ``set[bytes]`` pode ser usado " -"em anotações de tipo para significar um :class:`set` em que todos os " +"Para uma classe contêiner, o(s) argumento(s) fornecido(s) para " +"uma :ref:`subscrição ` da classe pode indicar o(s) tipo(s) " +"dos elementos que um objeto contém. Por exemplo, ``set[bytes]`` pode ser " +"usado em anotações de tipo para significar um :class:`set` em que todos os " "elementos são do tipo :class:`bytes`." -#: ../../library/stdtypes.rst:4939 +#: ../../builtins/stdtypes.rst:5550 msgid "" "For a class which defines :meth:`~object.__class_getitem__` but is not a " "container, the argument(s) supplied to a subscription of the class will " @@ -7028,7 +9554,7 @@ msgstr "" "em um objeto. Por exemplo, :mod:`expressões regulares ` podem ser usadas " "tanto no tipo de dados :class:`str` quanto no tipo de dados :class:`bytes`:" -#: ../../library/stdtypes.rst:4945 +#: ../../builtins/stdtypes.rst:5556 msgid "" "If ``x = re.search('foo', 'foo')``, ``x`` will be a :ref:`re.Match ` object where the return values of ``x.group(0)`` and ``x[0]`` will " @@ -7040,11 +9566,11 @@ msgstr "" "serão ambos do tipo :class:`str`. Podemos representar este tipo de objeto em " "anotações de tipo com o ``GenericAlias`` ``re.Match[str]``." -#: ../../library/stdtypes.rst:4951 +#: ../../builtins/stdtypes.rst:5562 msgid "" "If ``y = re.search(b'bar', b'bar')``, (note the ``b`` for :class:`bytes`), " -"``y`` will also be an instance of ``re.Match``, but the return values of ``y." -"group(0)`` and ``y[0]`` will both be of type :class:`bytes`. In type " +"``y`` will also be an instance of ``re.Match``, but the return values of " +"``y.group(0)`` and ``y[0]`` will both be of type :class:`bytes`. In type " "annotations, we would represent this variety of :ref:`re.Match ` objects with ``re.Match[bytes]``." msgstr "" @@ -7054,17 +9580,21 @@ msgstr "" "anotações de tipo, representaríamos esta variedade de objetos :ref:`re.Match " "` com ``re.Match[bytes]``." -#: ../../library/stdtypes.rst:4957 +#: ../../builtins/stdtypes.rst:5568 msgid "" -"``GenericAlias`` objects are instances of the class :class:`types." -"GenericAlias`, which can also be used to create ``GenericAlias`` objects " -"directly." +"``GenericAlias`` objects are instances of the " +"class :class:`types.GenericAlias`, which can also be used to create " +"``GenericAlias`` objects directly. Specializations of user-" +"defined :ref:`generic classes ` may not be instances " +"of :class:`types.GenericAlias`, but they provide similar functionality." msgstr "" -"Objetos ``GenericAlias`` são instâncias da classe :class:`types." -"GenericAlias`, que também podem ser usadas para criar objetos " -"``GenericAlias`` diretamente." +"Objetos ``GenericAlias`` são instâncias da " +"classe :class:`types.GenericAlias`, que também pode ser usada para criar " +"objetos ``GenericAlias`` diretamente. Especializações de :ref:`classes " +"genéricas ` definidas pelo usuário podem não ser instâncias " +"de :class:`types.GenericAlias`, mas oferecem funcionalidade semelhante." -#: ../../library/stdtypes.rst:4963 +#: ../../builtins/stdtypes.rst:5575 msgid "" "Creates a ``GenericAlias`` representing a type ``T`` parameterized by types " "*X*, *Y*, and more depending on the ``T`` used. For example, a function " @@ -7074,20 +9604,36 @@ msgstr "" "*X*, *Y* e mais, dependendo do ``T`` usados. Por exemplo, uma função " "esperando uma :class:`list` contendo elementos :class:`float`::" -#: ../../library/stdtypes.rst:4971 +#: ../../builtins/stdtypes.rst:5580 +msgid "" +"def average(values: list[float]) -> float:\n" +" return sum(values) / len(values)" +msgstr "" +"def average(values: list[float]) -> float:\n" +" return sum(values) / len(values)" + +#: ../../builtins/stdtypes.rst:5583 msgid "" "Another example for :term:`mapping` objects, using a :class:`dict`, which is " "a generic type expecting two type parameters representing the key type and " "the value type. In this example, the function expects a ``dict`` with keys " "of type :class:`str` and values of type :class:`int`::" msgstr "" -"Outro exemplo para :term:`mapeamento ` de objetos, usando um :class:" -"`dict`, o qual é um tipo genérico esperando 2 tipos de parâmetros " +"Outro exemplo para :term:`mapeamento ` de objetos, usando " +"um :class:`dict`, o qual é um tipo genérico esperando 2 tipos de parâmetros " "representando o tipo da chave e o tipo do valor. Neste exemplo, a função " -"espera um ``dict`` com chaves do tipo :class:`str` e valores do tipo :class:" -"`int`::" +"espera um ``dict`` com chaves do tipo :class:`str` e valores do " +"tipo :class:`int`::" + +#: ../../builtins/stdtypes.rst:5588 +msgid "" +"def send_post_request(url: str, body: dict[str, int]) -> None:\n" +" ..." +msgstr "" +"def send_post_request(url: str, body: dict[str, int]) -> None:\n" +" ..." -#: ../../library/stdtypes.rst:4979 +#: ../../builtins/stdtypes.rst:5591 msgid "" "The builtin functions :func:`isinstance` and :func:`issubclass` do not " "accept ``GenericAlias`` types for their second argument::" @@ -7095,7 +9641,19 @@ msgstr "" "As funções embutidas :func:`isinstance` e :func:`issubclass` não aceitam " "tipos ``GenericAlias`` para o seu segundo argumento::" -#: ../../library/stdtypes.rst:4987 +#: ../../builtins/stdtypes.rst:5594 +msgid "" +">>> isinstance([1, 2], list[str])\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: isinstance() argument 2 cannot be a parameterized generic" +msgstr "" +">>> isinstance([1, 2], list[str])\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: isinstance() argument 2 cannot be a parameterized generic" + +#: ../../builtins/stdtypes.rst:5599 msgid "" "The Python runtime does not enforce :term:`type annotations `. " "This extends to generic types and their type parameters. When creating a " @@ -7109,7 +9667,17 @@ msgstr "" "verificados pelo seu tipo. Por exemplo, o seguinte código é desencorajado, " "mas irá executar sem erros::" -#: ../../library/stdtypes.rst:4997 +#: ../../builtins/stdtypes.rst:5605 +msgid "" +">>> t = list[str]\n" +">>> t([1, 2, 3])\n" +"[1, 2, 3]" +msgstr "" +">>> t = list[str]\n" +">>> t([1, 2, 3])\n" +"[1, 2, 3]" + +#: ../../builtins/stdtypes.rst:5609 msgid "" "Furthermore, parameterized generics erase type parameters during object " "creation::" @@ -7117,7 +9685,51 @@ msgstr "" "Além disso, genéricos parametrizados removem parâmetros tipados durante a " "criação do objeto::" -#: ../../library/stdtypes.rst:5008 +#: ../../builtins/stdtypes.rst:5612 +msgid "" +">>> t = list[str]\n" +">>> type(t)\n" +"\n" +"\n" +">>> l = t()\n" +">>> type(l)\n" +"" +msgstr "" +">>> t = list[str]\n" +">>> type(t)\n" +"\n" +"\n" +">>> l = t()\n" +">>> type(l)\n" +"" + +#: ../../builtins/stdtypes.rst:5621 +msgid "" +"Instances of ``GenericAlias`` are not classes at runtime, even though they " +"behave like classes (they can be instantiated and subclassed)::" +msgstr "" +"Instâncias de ``GenericAlias`` não são classes em tempo de execução, embora " +"se comportem como classes (podem ser instanciadas e servir de base para " +"subclasses)::" + +#: ../../builtins/stdtypes.rst:5623 +msgid "" +">>> import inspect\n" +">>> inspect.isclass(list[int])\n" +"False" +msgstr "" +">>> import inspect\n" +">>> inspect.isclass(list[int])\n" +"False" + +#: ../../builtins/stdtypes.rst:5627 +msgid "" +"This is true for :ref:`user-defined generics ` also." +msgstr "" +"Isso é verdadeiro para :ref:`genéricos definidos pelo usuário ` também." + +#: ../../builtins/stdtypes.rst:5629 msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " "type::" @@ -7125,7 +9737,21 @@ msgstr "" "Chamar :func:`repr` ou :func:`str` sobre um genérico mostra o tipo " "parametrizado::" -#: ../../library/stdtypes.rst:5016 +#: ../../builtins/stdtypes.rst:5631 +msgid "" +">>> repr(list[int])\n" +"'list[int]'\n" +"\n" +">>> str(list[int])\n" +"'list[int]'" +msgstr "" +">>> repr(list[int])\n" +"'list[int]'\n" +"\n" +">>> str(list[int])\n" +"'list[int]'" + +#: ../../builtins/stdtypes.rst:5637 msgid "" "The :meth:`~object.__getitem__` method of generic containers will raise an " "exception to disallow mistakes like ``dict[str][str]``::" @@ -7133,7 +9759,19 @@ msgstr "" "O método :meth:`~object.__getitem__` de contêineres genéricos irá levantar " "uma exceção para não permitir erros como ``dict[str][str]``::" -#: ../../library/stdtypes.rst:5024 +#: ../../builtins/stdtypes.rst:5640 +msgid "" +">>> dict[str][str]\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: dict[str] is not a generic class" +msgstr "" +">>> dict[str][str]\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: dict[str] is not a generic class" + +#: ../../builtins/stdtypes.rst:5645 msgid "" "However, such expressions are valid when :ref:`type variables ` " "are used. The index must have as many elements as there are type variable " @@ -7141,14 +9779,26 @@ msgid "" msgstr "" "Entretanto, tais expressões são válidas quando :ref:`type variáveis " "` são usadas. O índice deve ter tantos elementos quantos forem os " -"itens de variável de tipo no objeto ``GenericAlias`` :attr:`~genericalias." -"__args__`. ::" +"itens de variável de tipo no objeto " +"``GenericAlias`` :attr:`~genericalias.__args__`. ::" + +#: ../../builtins/stdtypes.rst:5649 +msgid "" +">>> from typing import TypeVar\n" +">>> Y = TypeVar('Y')\n" +">>> dict[str, Y][int]\n" +"dict[str, int]" +msgstr "" +">>> from typing import TypeVar\n" +">>> Y = TypeVar('Y')\n" +">>> dict[str, Y][int]\n" +"dict[str, int]" -#: ../../library/stdtypes.rst:5035 +#: ../../builtins/stdtypes.rst:5656 msgid "Standard Generic Classes" msgstr "Classes genéricas padrão" -#: ../../library/stdtypes.rst:5037 +#: ../../builtins/stdtypes.rst:5658 msgid "" "The following standard library classes support parameterized generics. This " "list is non-exhaustive." @@ -7156,237 +9806,253 @@ msgstr "" "As seguintes classes de biblioteca padrão oferecem suporte a genéricos " "parametrizados. Esta lista não é exaustiva." -#: ../../library/stdtypes.rst:5040 +#: ../../builtins/stdtypes.rst:5661 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../library/stdtypes.rst:5041 +#: ../../builtins/stdtypes.rst:5662 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../library/stdtypes.rst:5042 +#: ../../builtins/stdtypes.rst:5663 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../library/stdtypes.rst:5043 +#: ../../builtins/stdtypes.rst:5664 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../library/stdtypes.rst:5044 +#: ../../builtins/stdtypes.rst:5665 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../library/stdtypes.rst:5045 +#: ../../builtins/stdtypes.rst:5666 msgid ":class:`type`" msgstr ":class:`type`" -#: ../../library/stdtypes.rst:5046 +#: ../../builtins/stdtypes.rst:5667 +msgid ":class:`asyncio.Future`" +msgstr ":class:`asyncio.Future`" + +#: ../../builtins/stdtypes.rst:5668 +msgid ":class:`asyncio.Task`" +msgstr ":class:`asyncio.Task`" + +#: ../../builtins/stdtypes.rst:5669 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../library/stdtypes.rst:5047 +#: ../../builtins/stdtypes.rst:5670 msgid ":class:`collections.defaultdict`" msgstr ":class:`collections.defaultdict`" -#: ../../library/stdtypes.rst:5048 +#: ../../builtins/stdtypes.rst:5671 msgid ":class:`collections.OrderedDict`" msgstr ":class:`collections.OrderedDict`" -#: ../../library/stdtypes.rst:5049 +#: ../../builtins/stdtypes.rst:5672 msgid ":class:`collections.Counter`" msgstr ":class:`collections.Counter`" -#: ../../library/stdtypes.rst:5050 +#: ../../builtins/stdtypes.rst:5673 msgid ":class:`collections.ChainMap`" msgstr ":class:`collections.ChainMap`" -#: ../../library/stdtypes.rst:5051 +#: ../../builtins/stdtypes.rst:5674 msgid ":class:`collections.abc.Awaitable`" msgstr ":class:`collections.abc.Awaitable`" -#: ../../library/stdtypes.rst:5052 +#: ../../builtins/stdtypes.rst:5675 msgid ":class:`collections.abc.Coroutine`" msgstr ":class:`collections.abc.Coroutine`" -#: ../../library/stdtypes.rst:5053 +#: ../../builtins/stdtypes.rst:5676 msgid ":class:`collections.abc.AsyncIterable`" msgstr ":class:`collections.abc.AsyncIterable`" -#: ../../library/stdtypes.rst:5054 +#: ../../builtins/stdtypes.rst:5677 msgid ":class:`collections.abc.AsyncIterator`" msgstr ":class:`collections.abc.AsyncIterator`" -#: ../../library/stdtypes.rst:5055 +#: ../../builtins/stdtypes.rst:5678 msgid ":class:`collections.abc.AsyncGenerator`" msgstr ":class:`collections.abc.AsyncGenerator`" -#: ../../library/stdtypes.rst:5056 +#: ../../builtins/stdtypes.rst:5679 msgid ":class:`collections.abc.Iterable`" msgstr ":class:`collections.abc.Iterable`" -#: ../../library/stdtypes.rst:5057 +#: ../../builtins/stdtypes.rst:5680 msgid ":class:`collections.abc.Iterator`" msgstr ":class:`collections.abc.Iterator`" -#: ../../library/stdtypes.rst:5058 +#: ../../builtins/stdtypes.rst:5681 msgid ":class:`collections.abc.Generator`" msgstr ":class:`collections.abc.Generator`" -#: ../../library/stdtypes.rst:5059 +#: ../../builtins/stdtypes.rst:5682 msgid ":class:`collections.abc.Reversible`" msgstr ":class:`collections.abc.Reversible`" -#: ../../library/stdtypes.rst:5060 +#: ../../builtins/stdtypes.rst:5683 msgid ":class:`collections.abc.Container`" msgstr ":class:`collections.abc.Container`" -#: ../../library/stdtypes.rst:5061 +#: ../../builtins/stdtypes.rst:5684 msgid ":class:`collections.abc.Collection`" msgstr ":class:`collections.abc.Collection`" -#: ../../library/stdtypes.rst:5062 +#: ../../builtins/stdtypes.rst:5685 msgid ":class:`collections.abc.Callable`" msgstr ":class:`collections.abc.Callable`" -#: ../../library/stdtypes.rst:5063 +#: ../../builtins/stdtypes.rst:5686 msgid ":class:`collections.abc.Set`" msgstr ":class:`collections.abc.Set`" -#: ../../library/stdtypes.rst:5064 +#: ../../builtins/stdtypes.rst:5687 msgid ":class:`collections.abc.MutableSet`" msgstr ":class:`collections.abc.MutableSet`" -#: ../../library/stdtypes.rst:5065 +#: ../../builtins/stdtypes.rst:5688 msgid ":class:`collections.abc.Mapping`" msgstr ":class:`collections.abc.Mapping`" -#: ../../library/stdtypes.rst:5066 +#: ../../builtins/stdtypes.rst:5689 msgid ":class:`collections.abc.MutableMapping`" msgstr ":class:`collections.abc.MutableMapping`" -#: ../../library/stdtypes.rst:5067 +#: ../../builtins/stdtypes.rst:5690 msgid ":class:`collections.abc.Sequence`" msgstr ":class:`collections.abc.Sequence`" -#: ../../library/stdtypes.rst:5068 +#: ../../builtins/stdtypes.rst:5691 msgid ":class:`collections.abc.MutableSequence`" msgstr ":class:`collections.abc.MutableSequence`" -#: ../../library/stdtypes.rst:5069 +#: ../../builtins/stdtypes.rst:5692 msgid ":class:`collections.abc.ByteString`" msgstr ":class:`collections.abc.ByteString`" -#: ../../library/stdtypes.rst:5070 +#: ../../builtins/stdtypes.rst:5693 msgid ":class:`collections.abc.MappingView`" msgstr ":class:`collections.abc.MappingView`" -#: ../../library/stdtypes.rst:5071 +#: ../../builtins/stdtypes.rst:5694 msgid ":class:`collections.abc.KeysView`" msgstr ":class:`collections.abc.KeysView`" -#: ../../library/stdtypes.rst:5072 +#: ../../builtins/stdtypes.rst:5695 msgid ":class:`collections.abc.ItemsView`" msgstr ":class:`collections.abc.ItemsView`" -#: ../../library/stdtypes.rst:5073 +#: ../../builtins/stdtypes.rst:5696 msgid ":class:`collections.abc.ValuesView`" msgstr ":class:`collections.abc.ValuesView`" -#: ../../library/stdtypes.rst:5074 +#: ../../builtins/stdtypes.rst:5697 msgid ":class:`contextlib.AbstractContextManager`" msgstr ":class:`contextlib.AbstractContextManager`" -#: ../../library/stdtypes.rst:5075 +#: ../../builtins/stdtypes.rst:5698 msgid ":class:`contextlib.AbstractAsyncContextManager`" msgstr ":class:`contextlib.AbstractAsyncContextManager`" -#: ../../library/stdtypes.rst:5076 +#: ../../builtins/stdtypes.rst:5699 msgid ":class:`dataclasses.Field`" msgstr ":class:`dataclasses.Field`" -#: ../../library/stdtypes.rst:5077 +#: ../../builtins/stdtypes.rst:5700 msgid ":class:`functools.cached_property`" msgstr ":class:`functools.cached_property`" -#: ../../library/stdtypes.rst:5078 +#: ../../builtins/stdtypes.rst:5701 msgid ":class:`functools.partialmethod`" msgstr ":class:`functools.partialmethod`" -#: ../../library/stdtypes.rst:5079 +#: ../../builtins/stdtypes.rst:5702 msgid ":class:`os.PathLike`" msgstr ":class:`os.PathLike`" -#: ../../library/stdtypes.rst:5080 +#: ../../builtins/stdtypes.rst:5703 msgid ":class:`queue.LifoQueue`" msgstr ":class:`queue.LifoQueue`" -#: ../../library/stdtypes.rst:5081 +#: ../../builtins/stdtypes.rst:5704 msgid ":class:`queue.Queue`" msgstr ":class:`queue.Queue`" -#: ../../library/stdtypes.rst:5082 +#: ../../builtins/stdtypes.rst:5705 msgid ":class:`queue.PriorityQueue`" msgstr ":class:`queue.PriorityQueue`" -#: ../../library/stdtypes.rst:5083 +#: ../../builtins/stdtypes.rst:5706 msgid ":class:`queue.SimpleQueue`" msgstr ":class:`queue.SimpleQueue`" -#: ../../library/stdtypes.rst:5084 +#: ../../builtins/stdtypes.rst:5707 msgid ":ref:`re.Pattern `" msgstr ":ref:`re.Pattern `" -#: ../../library/stdtypes.rst:5085 +#: ../../builtins/stdtypes.rst:5708 msgid ":ref:`re.Match `" msgstr ":ref:`re.Match `" -#: ../../library/stdtypes.rst:5086 +#: ../../builtins/stdtypes.rst:5709 msgid ":class:`shelve.BsdDbShelf`" msgstr ":class:`shelve.BsdDbShelf`" -#: ../../library/stdtypes.rst:5087 +#: ../../builtins/stdtypes.rst:5710 msgid ":class:`shelve.DbfilenameShelf`" msgstr ":class:`shelve.DbfilenameShelf`" -#: ../../library/stdtypes.rst:5088 +#: ../../builtins/stdtypes.rst:5711 msgid ":class:`shelve.Shelf`" msgstr ":class:`shelve.Shelf`" -#: ../../library/stdtypes.rst:5089 +#: ../../builtins/stdtypes.rst:5712 msgid ":class:`types.MappingProxyType`" msgstr ":class:`types.MappingProxyType`" -#: ../../library/stdtypes.rst:5090 +#: ../../builtins/stdtypes.rst:5713 msgid ":class:`weakref.WeakKeyDictionary`" msgstr ":class:`weakref.WeakKeyDictionary`" -#: ../../library/stdtypes.rst:5091 +#: ../../builtins/stdtypes.rst:5714 msgid ":class:`weakref.WeakMethod`" msgstr ":class:`weakref.WeakMethod`" -#: ../../library/stdtypes.rst:5092 +#: ../../builtins/stdtypes.rst:5715 msgid ":class:`weakref.WeakSet`" msgstr ":class:`weakref.WeakSet`" -#: ../../library/stdtypes.rst:5093 +#: ../../builtins/stdtypes.rst:5716 msgid ":class:`weakref.WeakValueDictionary`" msgstr ":class:`weakref.WeakValueDictionary`" -#: ../../library/stdtypes.rst:5098 +#: ../../builtins/stdtypes.rst:5721 msgid "Special Attributes of ``GenericAlias`` objects" msgstr "Atributos especiais de objetos ``GenericAlias``" -#: ../../library/stdtypes.rst:5100 +#: ../../builtins/stdtypes.rst:5723 msgid "All parameterized generics implement special read-only attributes." msgstr "" "Todos os genéricos parametrizados implementam atributos especiais somente " "leitura." -#: ../../library/stdtypes.rst:5104 +#: ../../builtins/stdtypes.rst:5727 msgid "This attribute points at the non-parameterized generic class::" msgstr "Este atributo aponta para a classe genérica não parametrizada::" -#: ../../library/stdtypes.rst:5112 +#: ../../builtins/stdtypes.rst:5729 +msgid "" +">>> list[int].__origin__\n" +"" +msgstr "" +">>> list[int].__origin__\n" +"" + +#: ../../builtins/stdtypes.rst:5735 msgid "" "This attribute is a :class:`tuple` (possibly of length 1) of generic types " "passed to the original :meth:`~object.__class_getitem__` of the generic " @@ -7396,7 +10062,15 @@ msgstr "" "genéricos passado para o método :meth:`~object.__class_getitem__` original " "da classe genérica::" -#: ../../library/stdtypes.rst:5122 +#: ../../builtins/stdtypes.rst:5739 +msgid "" +">>> dict[str, list[int]].__args__\n" +"(, list[int])" +msgstr "" +">>> dict[str, list[int]].__args__\n" +"(, list[int])" + +#: ../../builtins/stdtypes.rst:5745 msgid "" "This attribute is a lazily computed tuple (possibly empty) of unique type " "variables found in ``__args__``::" @@ -7404,17 +10078,33 @@ msgstr "" "O atributo é uma tupla computada preguiçosamente (possivelmente vazia) de " "variáveis de tipo único encontradas em ``__args__``::" -#: ../../library/stdtypes.rst:5133 +#: ../../builtins/stdtypes.rst:5748 +msgid "" +">>> from typing import TypeVar\n" +"\n" +">>> T = TypeVar('T')\n" +">>> list[T].__parameters__\n" +"(~T,)" +msgstr "" +">>> from typing import TypeVar\n" +"\n" +">>> T = TypeVar('T')\n" +">>> list[T].__parameters__\n" +"(~T,)" + +#: ../../builtins/stdtypes.rst:5756 msgid "" "A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not " -"have correct ``__parameters__`` after substitution because :class:`typing." -"ParamSpec` is intended primarily for static type checking." +"have correct ``__parameters__`` after substitution " +"because :class:`typing.ParamSpec` is intended primarily for static type " +"checking." msgstr "" "Um objeto ``GenericAlias`` com os parâmetros :class:`typing.ParamSpec` pode " -"não ter ``__parameters__`` correto após a substituição porque :class:`typing." -"ParamSpec` se destina principalmente à verificação de tipo estático." +"não ter ``__parameters__`` correto após a substituição " +"porque :class:`typing.ParamSpec` se destina principalmente à verificação de " +"tipo estático." -#: ../../library/stdtypes.rst:5140 +#: ../../builtins/stdtypes.rst:5763 msgid "" "A boolean that is true if the alias has been unpacked using the ``*`` " "operator (see :data:`~typing.TypeVarTuple`)." @@ -7422,37 +10112,37 @@ msgstr "" "Um booleano que é true se o apelido foi desempacotado usando o operador " "``*`` (consulte :data:`~typing.TypeVarTuple`)." -#: ../../library/stdtypes.rst:5148 +#: ../../builtins/stdtypes.rst:5771 msgid ":pep:`484` - Type Hints" -msgstr ":pep:`484` - Dicas de tipos" +msgstr ":pep:`484` - Dicas de tipo" -#: ../../library/stdtypes.rst:5149 +#: ../../builtins/stdtypes.rst:5772 msgid "Introducing Python's framework for type annotations." msgstr "Apresentando a estrutura do Python para anotações de tipo." -#: ../../library/stdtypes.rst:5151 +#: ../../builtins/stdtypes.rst:5774 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr ":pep:`585` - Sugestão de tipo para Genéricos em coleções padrão" -#: ../../library/stdtypes.rst:5152 +#: ../../builtins/stdtypes.rst:5775 msgid "" "Introducing the ability to natively parameterize standard-library classes, " -"provided they implement the special class method :meth:`~object." -"__class_getitem__`." +"provided they implement the special class " +"method :meth:`~object.__class_getitem__`." msgstr "" "Apresentando a capacidade de parametrizar nativamente as classes da " -"biblioteca padrão, desde que implementem o método de classe especial :meth:" -"`~object.__class_getitem__`." +"biblioteca padrão, desde que implementem o método de classe " +"especial :meth:`~object.__class_getitem__`." -#: ../../library/stdtypes.rst:5156 +#: ../../builtins/stdtypes.rst:5779 msgid "" -":ref:`Generics`, :ref:`user-defined generics ` and :" -"class:`typing.Generic`" +":ref:`Generics`, :ref:`user-defined generics ` " +"and :class:`typing.Generic`" msgstr "" ":ref:`Generics`, :ref:`genéricos definidos pelo usuário ` e :class:`typing.Generic`" -#: ../../library/stdtypes.rst:5157 +#: ../../builtins/stdtypes.rst:5780 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." @@ -7461,79 +10151,107 @@ msgstr "" "parametrizadas em tempo de execução e compreendidas por verificadores de " "tipo estático." -#: ../../library/stdtypes.rst:5166 +#: ../../builtins/stdtypes.rst:5789 msgid "Union Type" msgstr "Tipo União" -#: ../../library/stdtypes.rst:5172 +#: ../../builtins/stdtypes.rst:5795 msgid "" "A union object holds the value of the ``|`` (bitwise or) operation on " "multiple :ref:`type objects `. These types are intended " "primarily for :term:`type annotations `. The union type " -"expression enables cleaner type hinting syntax compared to :data:`typing." -"Union`." +"expression enables cleaner type hinting syntax compared " +"to :data:`typing.Union`." msgstr "" -"Um objeto união contém o valor da operação ``|`` (bit a bit ou) em vários :" -"ref:`objetos tipo `. Esses tipos são destinados " +"Um objeto união contém o valor da operação ``|`` (bit a bit ou) em " +"vários :ref:`objetos tipo `. Esses tipos são destinados " "principalmente para :term:`anotações de tipo `. A expressão de " "tipo de união habilita a sintaxe de sugestão de tipo mais limpo em " "comparação com :data:`typing.Union`." -#: ../../library/stdtypes.rst:5179 +#: ../../builtins/stdtypes.rst:5802 msgid "" "Defines a union object which holds types *X*, *Y*, and so forth. ``X | Y`` " "means either X or Y. It is equivalent to ``typing.Union[X, Y]``. For " -"example, the following function expects an argument of type :class:`int` or :" -"class:`float`::" +"example, the following function expects an argument of type :class:`int` " +"or :class:`float`::" msgstr "" "Define um objeto união que contém os tipos *X*, *Y* e assim por diante. ``X " "| Y`` significa X ou Y. É equivalente a ``typing.Union[X, Y]``. Por exemplo, " -"a seguinte função espera um argumento do tipo :class:`int` ou :class:" -"`float`::" +"a seguinte função espera um argumento do tipo :class:`int` " +"ou :class:`float`::" + +#: ../../builtins/stdtypes.rst:5807 +msgid "" +"def square(number: int | float) -> int | float:\n" +" return number ** 2" +msgstr "" +"def square(number: int | float) -> int | float:\n" +" return number ** 2" -#: ../../library/stdtypes.rst:5189 +#: ../../builtins/stdtypes.rst:5812 msgid "" -"The ``|`` operand cannot be used at runtime to define unions where one or " +"The ``|`` operator cannot be used at runtime to define unions where one or " "more members is a forward reference. For example, ``int | \"Foo\"``, where " "``\"Foo\"`` is a reference to a class not yet defined, will fail at runtime. " "For unions which include forward references, present the whole expression as " "a string, e.g. ``\"int | Foo\"``." msgstr "" -"O operando ``|`` não pode ser usado em tempo de execução para definir uniões " +"O operador ``|`` não pode ser usado em tempo de execução para definir uniões " "onde um ou mais membros são uma referência direta. Por exemplo, ``int | " "\"Foo\"``, onde ``\"Foo\"`` é uma referência a uma classe ainda não " "definida, falhará em tempo de execução. Para uniões que incluem referências " "futuras, apresente a expressão inteira como uma string, por exemplo. ``\"int " "| Foo\"``." -#: ../../library/stdtypes.rst:5197 +#: ../../builtins/stdtypes.rst:5820 msgid "" "Union objects can be tested for equality with other union objects. Details:" msgstr "" "Os objetos união podem ser testados quanto à igualdade com outros objetos " "união. Detalhes:" -#: ../../library/stdtypes.rst:5199 +#: ../../builtins/stdtypes.rst:5822 msgid "Unions of unions are flattened::" msgstr "Uniões de uniões são achatadas::" -#: ../../library/stdtypes.rst:5203 +#: ../../builtins/stdtypes.rst:5824 +msgid "(int | str) | float == int | str | float" +msgstr "(int | str) | float == int | str | float" + +#: ../../builtins/stdtypes.rst:5826 msgid "Redundant types are removed::" msgstr "Tipos redundantes são removidos::" -#: ../../library/stdtypes.rst:5207 +#: ../../builtins/stdtypes.rst:5828 +msgid "int | str | int == int | str" +msgstr "int | str | int == int | str" + +#: ../../builtins/stdtypes.rst:5830 msgid "When comparing unions, the order is ignored::" msgstr "Ao comparar uniões, a ordem é ignorada::" -#: ../../library/stdtypes.rst:5211 +#: ../../builtins/stdtypes.rst:5832 +msgid "int | str == str | int" +msgstr "int | str == str | int" + +#: ../../builtins/stdtypes.rst:5834 msgid "It is compatible with :data:`typing.Union`::" msgstr "É compatível com :data:`typing.Union`::" -#: ../../library/stdtypes.rst:5215 +#: ../../builtins/stdtypes.rst:5836 +msgid "int | str == typing.Union[int, str]" +msgstr "int | str == typing.Union[int, str]" + +#: ../../builtins/stdtypes.rst:5838 msgid "Optional types can be spelled as a union with ``None``::" msgstr "Tipos opcionais podem ser escritos como uma união com ``None``::" -#: ../../library/stdtypes.rst:5222 +#: ../../builtins/stdtypes.rst:5840 +msgid "str | None == typing.Optional[str]" +msgstr "str | None == typing.Optional[str]" + +#: ../../builtins/stdtypes.rst:5845 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" @@ -7541,7 +10259,15 @@ msgstr "" "Chamadas para :func:`isinstance` e :func:`issubclass` também são suportados " "com um objeto união::" -#: ../../library/stdtypes.rst:5228 +#: ../../builtins/stdtypes.rst:5848 +msgid "" +">>> isinstance(\"\", int | str)\n" +"True" +msgstr "" +">>> isinstance(\"\", int | str)\n" +"True" + +#: ../../builtins/stdtypes.rst:5851 msgid "" "However, :ref:`parameterized generics ` in union objects " "cannot be checked::" @@ -7549,17 +10275,51 @@ msgstr "" "No entanto, :ref:`genéricos parametrizados ` em objetos " "de união não podem ser verificados::" -#: ../../library/stdtypes.rst:5238 +#: ../../builtins/stdtypes.rst:5854 msgid "" -"The user-exposed type for the union object can be accessed from :data:`types." -"UnionType` and used for :func:`isinstance` checks. An object cannot be " -"instantiated from the type::" +">>> isinstance(1, int | list[int]) # short-circuit evaluation\n" +"True\n" +">>> isinstance([1], int | list[int])\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: isinstance() argument 2 cannot be a parameterized generic" msgstr "" -"O tipo exposto ao usuário para o objeto união pode ser acessado a partir de :" -"data:`types.UnionType` e usado por verificações de :func:`isinstance`. Um " -"objeto não pode ser instanciado a partir do tipo::" +">>> isinstance(1, int | list[int]) # cálculo em curto-circuito\n" +"True\n" +">>> isinstance([1], int | list[int])\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: isinstance() argument 2 cannot be a parameterized generic" -#: ../../library/stdtypes.rst:5251 +#: ../../builtins/stdtypes.rst:5861 +msgid "" +"The user-exposed type for the union object can be accessed " +"from :data:`types.UnionType` and used for :func:`isinstance` checks. An " +"object cannot be instantiated from the type::" +msgstr "" +"O tipo exposto ao usuário para o objeto união pode ser acessado a partir " +"de :data:`types.UnionType` e usado por verificações de :func:`isinstance`. " +"Um objeto não pode ser instanciado a partir do tipo::" + +#: ../../builtins/stdtypes.rst:5865 +msgid "" +">>> import types\n" +">>> isinstance(int | str, types.UnionType)\n" +"True\n" +">>> types.UnionType()\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: cannot create 'types.UnionType' instances" +msgstr "" +">>> import types\n" +">>> isinstance(int | str, types.UnionType)\n" +"True\n" +">>> types.UnionType()\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: cannot create 'types.UnionType' instances" + +#: ../../builtins/stdtypes.rst:5874 msgid "" "The :meth:`!__or__` method for type objects was added to support the syntax " "``X | Y``. If a metaclass implements :meth:`!__or__`, the Union may " @@ -7569,15 +10329,41 @@ msgstr "" "sintaxe ``X | Y``. Se uma metaclasse implementa :meth:`!__or__`, a União " "pode substituí-la:" -#: ../../library/stdtypes.rst:5271 +#: ../../builtins/stdtypes.rst:5878 +msgid "" +">>> class M(type):\n" +"... def __or__(self, other):\n" +"... return \"Hello\"\n" +"...\n" +">>> class C(metaclass=M):\n" +"... pass\n" +"...\n" +">>> C | int\n" +"'Hello'\n" +">>> int | C\n" +"int | C" +msgstr "" +">>> class M(type):\n" +"... def __or__(self, other):\n" +"... return \"Hello\"\n" +"...\n" +">>> class C(metaclass=M):\n" +"... pass\n" +"...\n" +">>> C | int\n" +"'Hello'\n" +">>> int | C\n" +"int | C" + +#: ../../builtins/stdtypes.rst:5894 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr ":pep:`604` -- PEP propondo a sintaxe ``X | Y`` e o tipo União." -#: ../../library/stdtypes.rst:5279 +#: ../../builtins/stdtypes.rst:5902 msgid "Other Built-in Types" msgstr "Outros tipos embutidos" -#: ../../library/stdtypes.rst:5281 +#: ../../builtins/stdtypes.rst:5904 msgid "" "The interpreter supports several other kinds of objects. Most of these " "support only one or two operations." @@ -7585,69 +10371,69 @@ msgstr "" "O interpretador suporta diversos outros tipos de objetos. Maior parte " "desses, suporta apenas uma ou duas operações." -#: ../../library/stdtypes.rst:5288 +#: ../../builtins/stdtypes.rst:5911 msgid "Modules" msgstr "Módulos" -#: ../../library/stdtypes.rst:5290 +#: ../../builtins/stdtypes.rst:5913 msgid "" "The only special operation on a module is attribute access: ``m.name``, " "where *m* is a module and *name* accesses a name defined in *m*'s symbol " -"table. Module attributes can be assigned to. (Note that the :keyword:" -"`import` statement is not, strictly speaking, an operation on a module " -"object; ``import foo`` does not require a module object named *foo* to " -"exist, rather it requires an (external) *definition* for a module named " +"table. Module attributes can be assigned to. (Note that " +"the :keyword:`import` statement is not, strictly speaking, an operation on a " +"module object; ``import foo`` does not require a module object named *foo* " +"to exist, rather it requires an (external) *definition* for a module named " "*foo* somewhere.)" msgstr "" "A única operação especial em um módulo é o acesso a um atributo: ``m.name``, " "onde *m* é um módulo e *name* acessa o nome defino na tabela de símbolos de " -"*m*. Atributos de módulo podem receber atribuição. (Perceba que a instrução :" -"keyword:`import` não é, estritamente falando, uma operação em um objeto do " -"módulo; ``import foo`` não requer que um objeto do módulo chamado *foo* " -"exista, ao invés disso requer uma *definição* (externa) de um módulo chamado " -"*foo* em algum lugar.)" +"*m*. Atributos de módulo podem receber atribuição. (Perceba que a " +"instrução :keyword:`import` não é, estritamente falando, uma operação em um " +"objeto do módulo; ``import foo`` não requer que um objeto do módulo chamado " +"*foo* exista, ao invés disso requer uma *definição* (externa) de um módulo " +"chamado *foo* em algum lugar.)" -#: ../../library/stdtypes.rst:5297 +#: ../../builtins/stdtypes.rst:5920 msgid "" "A special attribute of every module is :attr:`~object.__dict__`. This is the " "dictionary containing the module's symbol table. Modifying this dictionary " "will actually change the module's symbol table, but direct assignment to " -"the :attr:`~object.__dict__` attribute is not possible (you can write ``m." -"__dict__['a'] = 1``, which defines ``m.a`` to be ``1``, but you can't write " -"``m.__dict__ = {}``). Modifying :attr:`~object.__dict__` directly is not " -"recommended." +"the :attr:`~object.__dict__` attribute is not possible (you can write " +"``m.__dict__['a'] = 1``, which defines ``m.a`` to be ``1``, but you can't " +"write ``m.__dict__ = {}``). Modifying :attr:`~object.__dict__` directly is " +"not recommended." msgstr "" "Um atributo especial de cada módulo é :attr:`~object.__dict__`. Este é o " "dicionário contendo a tabela de símbolos do modulo. Modificar este " "dicionário vai na verdade modificar a tabela de símbolos do módulo, mas " "atribuição direta para o atributo :attr:`~object.__dict__` não é possível " "(você pode escrever ``m.__dict__['a'] = 1``, o qual define ``m.a`` para ser " -"``1``, mas você não consegue escrever ``m.__dict__ = {}``). Modificar :attr:" -"`~object.__dict__` diretamente não é recomendado." +"``1``, mas você não consegue escrever ``m.__dict__ = {}``). " +"Modificar :attr:`~object.__dict__` diretamente não é recomendado." -#: ../../library/stdtypes.rst:5305 +#: ../../builtins/stdtypes.rst:5928 msgid "" -"Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." +"Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" -"Módulos embutidos no interpretador são escritos desta forma: ````. Se carregados a partir de um arquivo, eles são escritos " -"como ````." +"Módulos embutidos no interpretador são escritos desta forma: ````. Se carregados a partir de um arquivo, eles são escritos como " +"````." -#: ../../library/stdtypes.rst:5313 +#: ../../builtins/stdtypes.rst:5936 msgid "Classes and Class Instances" msgstr "Classes e Instâncias de Classes" -#: ../../library/stdtypes.rst:5315 +#: ../../builtins/stdtypes.rst:5938 msgid "See :ref:`objects` and :ref:`class` for these." msgstr "Veja :ref:`objects` e :ref:`class` para estes." -#: ../../library/stdtypes.rst:5321 +#: ../../builtins/stdtypes.rst:5944 msgid "Functions" msgstr "Funções" -#: ../../library/stdtypes.rst:5323 +#: ../../builtins/stdtypes.rst:5946 msgid "" "Function objects are created by function definitions. The only operation on " "a function object is to call it: ``func(argument-list)``." @@ -7656,7 +10442,7 @@ msgstr "" "que pode ser feita em um objeto função é chamá-la: ``func(lista-de-" "argumentos)``." -#: ../../library/stdtypes.rst:5326 +#: ../../builtins/stdtypes.rst:5949 msgid "" "There are really two flavors of function objects: built-in functions and " "user-defined functions. Both support the same operation (to call the " @@ -7668,37 +10454,38 @@ msgstr "" "função), mas a implementação é diferente, portanto os diferentes tipos de " "objetos." -#: ../../library/stdtypes.rst:5330 +#: ../../builtins/stdtypes.rst:5953 msgid "See :ref:`function` for more information." msgstr "Veja a função :ref:`function` para mais informações." -#: ../../library/stdtypes.rst:5336 +#: ../../builtins/stdtypes.rst:5959 msgid "Methods" msgstr "Métodos" -#: ../../library/stdtypes.rst:5340 +#: ../../builtins/stdtypes.rst:5963 msgid "" "Methods are functions that are called using the attribute notation. There " -"are two flavors: :ref:`built-in methods ` (such as :meth:" -"`append` on lists) and :ref:`class instance method `. " -"Built-in methods are described with the types that support them." +"are two flavors: :ref:`built-in methods ` (such " +"as :meth:`~list.append` on lists) and :ref:`class instance methods `. Built-in methods are described with the types that support them." msgstr "" "Métodos são funções que são chamadas usando a notação de atributo. Existem " -"duas opções: :ref:`métodos embutidos ` (tal como :meth:" -"`append` em listas) e :ref:`métodos de instância de classe `. Métodos embutidos são descritos com os tipos que suportam eles." +"duas opções: :ref:`métodos embutidos ` (tal " +"como :meth:`~list.append` em listas) e :ref:`métodos de instância de classe " +"`. Métodos embutidos são descritos com os tipos que os " +"implementam." -#: ../../library/stdtypes.rst:5345 +#: ../../builtins/stdtypes.rst:5969 msgid "" "If you access a method (a function defined in a class namespace) through an " -"instance, you get a special object: a :dfn:`bound method` (also called :ref:" -"`instance method `) object. When called, it will add the " -"``self`` argument to the argument list. Bound methods have two special read-" -"only attributes: :attr:`m.__self__ ` is the object on which " -"the method operates, and :attr:`m.__func__ ` is the " -"function implementing the method. Calling ``m(arg-1, arg-2, ..., arg-n)`` " -"is completely equivalent to calling ``m.__func__(m.__self__, arg-1, " -"arg-2, ..., arg-n)``." +"instance, you get a special object: a :dfn:`bound method` (also " +"called :ref:`instance method `) object. When called, it " +"will add the ``self`` argument to the argument list. Bound methods have two " +"special read-only attributes: :attr:`m.__self__ ` is the " +"object on which the method operates, and :attr:`m.__func__ " +"` is the function implementing the method. Calling " +"``m(arg-1, arg-2, ..., arg-n)`` is completely equivalent to calling " +"``m.__func__(m.__self__, arg-1, arg-2, ..., arg-n)``." msgstr "" "Se você acessar um método (uma função definida em um espaço de nomes de uma " "classe) através de uma instância, você obtém um objeto especial: um objeto " @@ -7710,7 +10497,7 @@ msgstr "" "implementa o método. Chamar ``m(arg-1, arg-2, ..., arg-n)`` é completamente " "equivalente a chamar ``m.__func__(m.__self__, arg-1, arg-2, ..., arg-n)``." -#: ../../library/stdtypes.rst:5356 +#: ../../builtins/stdtypes.rst:5980 msgid "" "Like :ref:`function objects `, bound method objects " "support getting arbitrary attributes. However, since method attributes are " @@ -7722,28 +10509,57 @@ msgid "" msgstr "" "Assim como :ref:`objetos função `, objetos de métodos " "vinculados tem suporte para receber atributos arbitrários. Entretanto, como " -"atributos de método na verdade são armazenados no objeto função subjacente (:" -"attr:`method.__func__`), definir atributos de método em métodos vinculados " -"não é permitido. Tentar definir um atributo em um método resulta em um :exc:" -"`AttributeError` sendo levantado. A fim de definir um atributo de método, " -"você precisa definir explicitamente ele no objeto função subjacente::" - -#: ../../library/stdtypes.rst:5379 +"atributos de método na verdade são armazenados no objeto função subjacente " +"(:attr:`method.__func__`), definir atributos de método em métodos vinculados " +"não é permitido. Tentar definir um atributo em um método resulta em " +"um :exc:`AttributeError` sendo levantado. A fim de definir um atributo de " +"método, você precisa definir explicitamente ele no objeto função subjacente::" + +#: ../../builtins/stdtypes.rst:5988 +msgid "" +">>> class C:\n" +"... def method(self):\n" +"... pass\n" +"...\n" +">>> c = C()\n" +">>> c.method.whoami = 'my name is method' # can't set on the method\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"AttributeError: 'method' object has no attribute 'whoami'\n" +">>> c.method.__func__.whoami = 'my name is method'\n" +">>> c.method.whoami\n" +"'my name is method'" +msgstr "" +">>> class C:\n" +"... def method(self):\n" +"... pass\n" +"...\n" +">>> c = C()\n" +">>> c.method.whoami = 'my name is method' # proibido atribuir diretamente " +"no método\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"AttributeError: 'method' object has no attribute 'whoami'\n" +">>> c.method.__func__.whoami = 'my name is method'\n" +">>> c.method.whoami\n" +"'my name is method'" + +#: ../../builtins/stdtypes.rst:6003 msgid "See :ref:`instance-methods` for more information." msgstr "Veja :ref:`instance-methods` para mais informações." -#: ../../library/stdtypes.rst:5387 +#: ../../builtins/stdtypes.rst:6011 msgid "Code Objects" msgstr "Objetos código" -#: ../../library/stdtypes.rst:5393 +#: ../../builtins/stdtypes.rst:6017 msgid "" "Code objects are used by the implementation to represent \"pseudo-compiled\" " "executable Python code such as a function body. They differ from function " "objects because they don't contain a reference to their global execution " "environment. Code objects are returned by the built-in :func:`compile` " -"function and can be extracted from function objects through their :attr:" -"`~function.__code__` attribute. See also the :mod:`code` module." +"function and can be extracted from function objects through " +"their :attr:`~function.__code__` attribute. See also the :mod:`code` module." msgstr "" "Objetos código são usados pela implementação para representar código Python " "executável \"pseudo-compilado\", tal como corpo de uma função. Eles são " @@ -7752,7 +10568,7 @@ msgstr "" "embutida :func:`compile` e podem ser extraídos de objetos função através do " "seu atributo :attr:`~function.__code__`. Veja também o módulo :mod:`code`." -#: ../../library/stdtypes.rst:5400 +#: ../../builtins/stdtypes.rst:6024 msgid "" "Accessing :attr:`~function.__code__` raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and " @@ -7762,7 +10578,7 @@ msgstr "" "` ``object.__getattr__`` com os argumentos ``obj`` e " "``\"__code__\"``." -#: ../../library/stdtypes.rst:5407 +#: ../../builtins/stdtypes.rst:6031 msgid "" "A code object can be executed or evaluated by passing it (instead of a " "source string) to the :func:`exec` or :func:`eval` built-in functions." @@ -7770,15 +10586,15 @@ msgstr "" "Um objeto de código pode ser executado ou avaliado passando-o (ao invés da " "string fonte) para as funções embutidas :func:`exec` ou :func:`eval`." -#: ../../library/stdtypes.rst:5410 +#: ../../builtins/stdtypes.rst:6034 msgid "See :ref:`types` for more information." msgstr "Veja o tipo :ref:`types` para maiores informações." -#: ../../library/stdtypes.rst:5416 +#: ../../builtins/stdtypes.rst:6040 msgid "Type Objects" msgstr "Objetos tipo" -#: ../../library/stdtypes.rst:5422 +#: ../../builtins/stdtypes.rst:6046 msgid "" "Type objects represent the various object types. An object's type is " "accessed by the built-in function :func:`type`. There are no special " @@ -7790,15 +10606,15 @@ msgstr "" "especiais sobre tipos. O módulo padrão :mod:`types` define nomes para todos " "os tipos padrão embutidos." -#: ../../library/stdtypes.rst:5427 +#: ../../builtins/stdtypes.rst:6051 msgid "Types are written like this: ````." msgstr "Tipos são escritos como isto: ````." -#: ../../library/stdtypes.rst:5433 +#: ../../builtins/stdtypes.rst:6057 msgid "The Null Object" msgstr "O objeto nulo" -#: ../../library/stdtypes.rst:5435 +#: ../../builtins/stdtypes.rst:6059 msgid "" "This object is returned by functions that don't explicitly return a value. " "It supports no special operations. There is exactly one null object, named " @@ -7809,55 +10625,120 @@ msgstr "" "objeto nulo, chamado de ``None`` (um nome embutido). ``type(None)()`` produz " "o mesmo singleton." -#: ../../library/stdtypes.rst:5439 +#: ../../builtins/stdtypes.rst:6063 msgid "It is written as ``None``." msgstr "Ele é escrito como ``None``." -#: ../../library/stdtypes.rst:5446 +#: ../../builtins/stdtypes.rst:6070 msgid "The Ellipsis Object" msgstr "O Objeto Ellipsis" -#: ../../library/stdtypes.rst:5448 +#: ../../builtins/stdtypes.rst:6072 msgid "" -"This object is commonly used by slicing (see :ref:`slicings`). It supports " -"no special operations. There is exactly one ellipsis object, named :const:" -"`Ellipsis` (a built-in name). ``type(Ellipsis)()`` produces the :const:" -"`Ellipsis` singleton." +"This object is commonly used to indicate that something is omitted. It " +"supports no special operations. There is exactly one ellipsis object, " +"named :const:`Ellipsis` (a built-in name). ``type(Ellipsis)()`` produces " +"the :const:`Ellipsis` singleton." msgstr "" -"Este objeto é comumente usado através de fatiamento (veja :ref:`slicings`). " -"Ela não suporta operações especiais. Existe exatamente um objeto ellipsis, " +"Este objeto é comumente usado para indicar que algo foi omitido. Ela não " +"suporta operações especiais. Existe exatamente um objeto ellipsis, " "nomeado :const:`Ellipsis` (um nome embutido). ``type(Ellipsis)()`` produz o " "singleton :const:`Ellipsis`." -#: ../../library/stdtypes.rst:5453 +#: ../../builtins/stdtypes.rst:6077 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "Está escrito com ``Ellipsis`` ou ``...``." -#: ../../library/stdtypes.rst:5459 +#: ../../builtins/stdtypes.rst:6079 +msgid "" +"In typical use, ``...`` as the ``Ellipsis`` object appears in a few " +"different places, for instance:" +msgstr "" +"No uso típico, ``...`` como o objeto ``Ellipsis`` aparece em alguns lugares " +"diferentes, por exemplo:" + +#: ../../builtins/stdtypes.rst:6082 +msgid "" +"In type annotations, such as :ref:`callable arguments ` or :ref:`tuple elements `." +msgstr "" +"Em anotações de tipo, como :ref:`argumentos chamáveis ` ou :ref:`elementos de tupla `." + +#: ../../builtins/stdtypes.rst:6085 +msgid "" +"As the body of a function instead of a :ref:`pass statement `." +msgstr "" +"Como o corpo de uma função em vez de uma :ref:`instrução pass `." + +#: ../../builtins/stdtypes.rst:6087 +msgid "" +"In third-party libraries, such as `Numpy's slicing and striding `_." +msgstr "" +"Em bibliotecas de terceiros, como `slicing e striding do Numpy `_." + +#: ../../builtins/stdtypes.rst:6090 +msgid "" +"Python also uses three dots in ways that are not ``Ellipsis`` objects, for " +"instance:" +msgstr "" +"Python também usa três pontos de maneiras que não são objetos ``Ellipsis``, " +"por exemplo:" + +#: ../../builtins/stdtypes.rst:6092 +msgid "" +"Doctest's :const:`ELLIPSIS `, as a pattern for missing " +"content." +msgstr "" +":const:`ELLIPSIS ` do doctest, como um padrão para " +"conteúdo ausente." + +#: ../../builtins/stdtypes.rst:6094 +msgid "" +"The default Python prompt of the :term:`interactive` shell when partial " +"input is incomplete." +msgstr "" +"O prompt Python padrão do console :term:`interativo` quando a entrada " +"parcial está incompleta." + +#: ../../builtins/stdtypes.rst:6096 +msgid "" +"Lastly, the Python documentation often uses three dots in conventional " +"English usage to mean omitted content, even in code examples that also use " +"them as the ``Ellipsis``." +msgstr "" +"Por fim, a documentação do Python geralmente usa três pontos no uso " +"convencional do inglês para indicar conteúdo omitido, mesmo em exemplos de " +"código que também os usam como ``Ellipsis``." + +#: ../../builtins/stdtypes.rst:6104 msgid "The NotImplemented Object" msgstr "O Objeto NotImplemented" -#: ../../library/stdtypes.rst:5461 +#: ../../builtins/stdtypes.rst:6106 msgid "" "This object is returned from comparisons and binary operations when they are " "asked to operate on types they don't support. See :ref:`comparisons` for " -"more information. There is exactly one :data:`NotImplemented` object. :code:" -"`type(NotImplemented)()` produces the singleton instance." +"more information. There is exactly one :data:`NotImplemented` " +"object. :code:`type(NotImplemented)()` produces the singleton instance." msgstr "" "Este objeto é retornado a partir de comparações e operações binárias quando " -"elas são solicitadas para operar em tipos nos quais eles não suportam. Veja :" -"ref:`comparisons` para mais informações. Existe exatamente um objeto :data:" -"`NotImplemented`. :code:`type(NotImplemented)()` produz o mesmo valor." +"elas são solicitadas para operar em tipos nos quais eles não suportam. " +"Veja :ref:`comparisons` para mais informações. Existe exatamente um " +"objeto :data:`NotImplemented`. :code:`type(NotImplemented)()` produz o mesmo " +"valor." -#: ../../library/stdtypes.rst:5466 +#: ../../builtins/stdtypes.rst:6111 msgid "It is written as :code:`NotImplemented`." msgstr "Está escrito como :code:`NotImplemented`." -#: ../../library/stdtypes.rst:5472 +#: ../../builtins/stdtypes.rst:6117 msgid "Internal Objects" msgstr "Objetos Internos" -#: ../../library/stdtypes.rst:5474 +#: ../../builtins/stdtypes.rst:6119 msgid "" "See :ref:`types` for this information. It describes :ref:`stack frame " "objects `, :ref:`traceback objects `, and " @@ -7867,42 +10748,26 @@ msgstr "" "pilha `, :ref:`objetos traceback (situação da pilha de " "execução) `, e objetos fatia." -#: ../../library/stdtypes.rst:5482 +#: ../../builtins/stdtypes.rst:6127 msgid "Special Attributes" msgstr "Atributos Especiais" -#: ../../library/stdtypes.rst:5484 +#: ../../builtins/stdtypes.rst:6129 msgid "" "The implementation adds a few special read-only attributes to several object " -"types, where they are relevant. Some of these are not reported by the :func:" -"`dir` built-in function." +"types, where they are relevant. Some of these are not reported by " +"the :func:`dir` built-in function." msgstr "" "A implementação adiciona alguns atributos especiais somente leitura para " "diversos tipos de objetos, onde eles são relevantes. Alguns desses não são " "reportados pela função embutida :func:`dir`." -#: ../../library/stdtypes.rst:5491 -msgid "" -"A dictionary or other mapping object used to store an object's (writable) " -"attributes." -msgstr "" -"Um dicionário ou outro objeto de mapeamento usado para armazenar os " -"atributos (graváveis) de um objeto." - -#: ../../library/stdtypes.rst:5497 -msgid "The class to which a class instance belongs." -msgstr "A classe à qual pertence uma instância de classe." - -#: ../../library/stdtypes.rst:5502 -msgid "The tuple of base classes of a class object." -msgstr "A tupla de classes base de um objeto classe." - -#: ../../library/stdtypes.rst:5507 +#: ../../builtins/stdtypes.rst:6136 msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "O nome da classe, função, método, descritor, ou instância geradora." -#: ../../library/stdtypes.rst:5513 +#: ../../builtins/stdtypes.rst:6142 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." @@ -7910,68 +10775,45 @@ msgstr "" "O :term:`nome qualificado ` da classe, função, método, " "descritor, ou instância geradora." -#: ../../library/stdtypes.rst:5521 -msgid "" -"The :ref:`type parameters ` of generic classes, functions, and :" -"ref:`type aliases `." -msgstr "" -"Os :ref:`parâmetros de tipo ` de classes genéricas, funções e :" -"ref:`apelidos de tipo `." - -#: ../../library/stdtypes.rst:5529 -msgid "" -"This attribute is a tuple of classes that are considered when looking for " -"base classes during method resolution." -msgstr "" -"Este atributo é uma tupla de classes que são consideradas ao procurar por " -"classes bases durante resolução de métodos." - -#: ../../library/stdtypes.rst:5535 -msgid "" -"This method can be overridden by a metaclass to customize the method " -"resolution order for its instances. It is called at class instantiation, " -"and its result is stored in :attr:`~class.__mro__`." -msgstr "" -"Este método pode ser substituído por uma metaclasse para customizar a ordem " -"de resolução de métodos para suas instâncias. Ele é chamado na instanciação " -"da classe, e o seu resultado é armazenado em :attr:`~class.__mro__`." +#: ../../builtins/stdtypes.rst:6150 +msgid "The name of the module in which a class or function was defined." +msgstr "O nome do módulo no qual uma classe ou função foi definida." -#: ../../library/stdtypes.rst:5542 +#: ../../builtins/stdtypes.rst:6155 msgid "" -"Each class keeps a list of weak references to its immediate subclasses. " -"This method returns a list of all those references still alive. The list is " -"in definition order. Example::" +"The documentation string of a class or function, or ``None`` if undefined." msgstr "" -"Cada classe mantém uma lista de referências fracas para suas subclasses " -"imediatas. Este método retorna uma lista de todas essas referências ainda " -"vivas. A lista está na ordem que são definidas. Exemplo::" +"A string de documentação de uma classe ou função, ou ``None`` se não " +"definida." -#: ../../library/stdtypes.rst:5552 +#: ../../builtins/stdtypes.rst:6160 msgid "" -"A tuple containing names of attributes of this class which are accessed " -"through ``self.X`` from any function in its body." +"The :ref:`type parameters ` of generic classes, functions, " +"and :ref:`type aliases `. For classes and functions that are " +"not generic, this will be an empty tuple." msgstr "" -"Uma tupla contendo nomes de atributos dessa classe que são acessados por " -"meio de ``self.X`` de qualquer função em seu corpo." +"Os :ref:`parâmetros de tipo ` de classes genéricas, funções " +"e :ref:`apelidos de tipo `. Para classes e funções que não são " +"genéricas, isso será uma tupla vazia." -#: ../../library/stdtypes.rst:5560 +#: ../../builtins/stdtypes.rst:6170 msgid "Integer string conversion length limitation" msgstr "Limitação de comprimento de string na conversão para inteiro" -#: ../../library/stdtypes.rst:5562 +#: ../../builtins/stdtypes.rst:6172 msgid "" -"CPython has a global limit for converting between :class:`int` and :class:" -"`str` to mitigate denial of service attacks. This limit *only* applies to " -"decimal or other non-power-of-two number bases. Hexadecimal, octal, and " -"binary conversions are unlimited. The limit can be configured." +"CPython has a global limit for converting between :class:`int` " +"and :class:`str` to mitigate denial of service attacks. This limit *only* " +"applies to decimal or other non-power-of-two number bases. Hexadecimal, " +"octal, and binary conversions are unlimited. The limit can be configured." msgstr "" -"CPython tem um limite global para conversão entre :class:`int` e :class:" -"`str` para mitigar ataques de negação de serviço. Esse limite *somente* se " -"aplica a bases numéricas decimais ou outras que não sejam potência de dois. " -"As conversões hexadecimais, octais e binárias são ilimitadas. O limite pode " -"ser configurado." +"CPython tem um limite global para conversão entre :class:`int` " +"e :class:`str` para mitigar ataques de negação de serviço. Esse limite " +"*somente* se aplica a bases numéricas decimais ou outras que não sejam " +"potência de dois. As conversões hexadecimais, octais e binárias são " +"ilimitadas. O limite pode ser configurado." -#: ../../library/stdtypes.rst:5567 +#: ../../builtins/stdtypes.rst:6177 msgid "" "The :class:`int` type in CPython is an arbitrary length number stored in " "binary form (commonly known as a \"bignum\"). There exists no algorithm that " @@ -7988,14 +10830,14 @@ msgstr "" "têm complexidade subquadrática. Converter um valor grande como ``int('1' * " "500_000)`` pode levar mais de um segundo em uma CPU rápida." -#: ../../library/stdtypes.rst:5574 +#: ../../builtins/stdtypes.rst:6184 msgid "" "Limiting conversion size offers a practical way to avoid :cve:`2020-10735`." msgstr "" -"Limitar o tamanho da conversão oferece uma maneira prática de evitar :cve:" -"`2020-10735`." +"Limitar o tamanho da conversão oferece uma maneira prática de " +"evitar :cve:`2020-10735`." -#: ../../library/stdtypes.rst:5576 +#: ../../builtins/stdtypes.rst:6186 msgid "" "The limit is applied to the number of digit characters in the input or " "output string when a non-linear conversion algorithm would be involved. " @@ -8005,59 +10847,122 @@ msgstr "" "ou saída quando um algoritmo de conversão não linear estiver envolvido. " "Sublinhados e o sinal não são contados para o limite." -#: ../../library/stdtypes.rst:5580 +#: ../../builtins/stdtypes.rst:6190 msgid "" "When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "" "Quando uma operação excede o limite, uma exceção :exc:`ValueError` é " "levantada:" -#: ../../library/stdtypes.rst:5602 -msgid "" -"The default limit is 4300 digits as provided in :data:`sys.int_info." -"default_max_str_digits `. The lowest limit that can be " -"configured is 640 digits as provided in :data:`sys.int_info." -"str_digits_check_threshold `." -msgstr "" -"O limite padrão é de 4300 dígitos conforme fornecido em :data:`sys.int_info." -"default_max_str_digits `. O limite mínimo que pode ser " -"configurado é de 640 dígitos conforme fornecido em :data:`sys.int_info." -"str_digits_check_threshold `." - -#: ../../library/stdtypes.rst:5607 +#: ../../builtins/stdtypes.rst:6192 +msgid "" +">>> import sys\n" +">>> sys.set_int_max_str_digits(4300) # Illustrative, this is the default.\n" +">>> _ = int('2' * 5432)\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: Exceeds the limit (4300 digits) for integer string conversion: " +"value has 5432 digits; use sys.set_int_max_str_digits() to increase the " +"limit\n" +">>> i = int('2' * 4300)\n" +">>> len(str(i))\n" +"4300\n" +">>> i_squared = i*i\n" +">>> len(str(i_squared))\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: Exceeds the limit (4300 digits) for integer string conversion; " +"use sys.set_int_max_str_digits() to increase the limit\n" +">>> len(hex(i_squared))\n" +"7144\n" +">>> assert int(hex(i_squared), base=16) == i*i # Hexadecimal is unlimited." +msgstr "" +">>> import sys\n" +">>> sys.set_int_max_str_digits(4300) # Illustrativo, este é o padrão.\n" +">>> _ = int('2' * 5432)\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: Exceeds the limit (4300 digits) for integer string conversion: " +"value has 5432 digits; use sys.set_int_max_str_digits() to increase the " +"limit\n" +">>> i = int('2' * 4300)\n" +">>> len(str(i))\n" +"4300\n" +">>> i_squared = i*i\n" +">>> len(str(i_squared))\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: Exceeds the limit (4300 digits) for integer string conversion; " +"use sys.set_int_max_str_digits() to increase the limit\n" +">>> len(hex(i_squared))\n" +"7144\n" +">>> assert int(hex(i_squared), base=16) == i*i # Conversão envolvendo " +"hexadecimais é ilimitada." + +#: ../../builtins/stdtypes.rst:6212 +msgid "" +"The default limit is 4300 digits as provided " +"in :data:`sys.int_info.default_max_str_digits `. The lowest " +"limit that can be configured is 640 digits as provided " +"in :data:`sys.int_info.str_digits_check_threshold `." +msgstr "" +"O limite padrão é de 4300 dígitos conforme fornecido " +"em :data:`sys.int_info.default_max_str_digits `. O limite " +"mínimo que pode ser configurado é de 640 dígitos conforme fornecido " +"em :data:`sys.int_info.str_digits_check_threshold `." + +#: ../../builtins/stdtypes.rst:6217 msgid "Verification:" msgstr "Verificação:" -#: ../../library/stdtypes.rst:5622 +#: ../../builtins/stdtypes.rst:6219 +msgid "" +">>> import sys\n" +">>> assert sys.int_info.default_max_str_digits == 4300, sys.int_info\n" +">>> assert sys.int_info.str_digits_check_threshold == 640, sys.int_info\n" +">>> msg = int('578966293710682886880994035146873798396722250538762761564'\n" +"... '9252925514383915483333812743580549779436104706260696366600'\n" +"... '571186405732').to_bytes(53, 'big')\n" +"..." +msgstr "" +">>> import sys\n" +">>> assert sys.int_info.default_max_str_digits == 4300, sys.int_info\n" +">>> assert sys.int_info.str_digits_check_threshold == 640, sys.int_info\n" +">>> msg = int('578966293710682886880994035146873798396722250538762761564'\n" +"... '9252925514383915483333812743580549779436104706260696366600'\n" +"... '571186405732').to_bytes(53, 'big')\n" +"..." + +#: ../../builtins/stdtypes.rst:6232 msgid "Affected APIs" msgstr "APIs afetadas" -#: ../../library/stdtypes.rst:5624 +#: ../../builtins/stdtypes.rst:6234 msgid "" -"The limitation only applies to potentially slow conversions between :class:" -"`int` and :class:`str` or :class:`bytes`:" +"The limitation only applies to potentially slow conversions " +"between :class:`int` and :class:`str` or :class:`bytes`:" msgstr "" -"A limitação só se aplica a conversões potencialmente lentas entre :class:" -"`int` e :class:`str` ou :class:`bytes`:" +"A limitação só se aplica a conversões potencialmente lentas " +"entre :class:`int` e :class:`str` ou :class:`bytes`:" -#: ../../library/stdtypes.rst:5627 +#: ../../builtins/stdtypes.rst:6237 msgid "``int(string)`` with default base 10." msgstr "``int(string)`` com padrão sendo base 10." -#: ../../library/stdtypes.rst:5628 +#: ../../builtins/stdtypes.rst:6238 msgid "``int(string, base)`` for all bases that are not a power of 2." msgstr "" "``int(string, base)`` para todas as bases que não são uma potência de 2." -#: ../../library/stdtypes.rst:5629 +#: ../../builtins/stdtypes.rst:6239 msgid "``str(integer)``." msgstr "``str(integer)``." -#: ../../library/stdtypes.rst:5630 +#: ../../builtins/stdtypes.rst:6240 msgid "``repr(integer)``." msgstr "``repr(integer)``." -#: ../../library/stdtypes.rst:5631 +#: ../../builtins/stdtypes.rst:6241 msgid "" "any other string conversion to base 10, for example ``f\"{integer}\"``, " "``\"{}\".format(integer)``, or ``b\"%d\" % integer``." @@ -8065,39 +10970,39 @@ msgstr "" "qualquer outra conversão de string para base 10 como, por exemplo, " "``f\"{integer}\"``, ``\"{}\".format(integer)`` ou ``b\"%d\" % integer``." -#: ../../library/stdtypes.rst:5634 +#: ../../builtins/stdtypes.rst:6244 msgid "The limitations do not apply to functions with a linear algorithm:" msgstr "As limitações não se aplicam a funções com um algoritmo linear:" -#: ../../library/stdtypes.rst:5636 +#: ../../builtins/stdtypes.rst:6246 msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32." msgstr "``int(string, base)`` com base 2, 4, 8, 16 ou 32." -#: ../../library/stdtypes.rst:5637 +#: ../../builtins/stdtypes.rst:6247 msgid ":func:`int.from_bytes` and :func:`int.to_bytes`." msgstr ":func:`int.from_bytes` e :func:`int.to_bytes`." -#: ../../library/stdtypes.rst:5638 +#: ../../builtins/stdtypes.rst:6248 msgid ":func:`hex`, :func:`oct`, :func:`bin`." msgstr ":func:`hex`, :func:`oct`, :func:`bin`." -#: ../../library/stdtypes.rst:5639 +#: ../../builtins/stdtypes.rst:6249 msgid ":ref:`formatspec` for hex, octal, and binary numbers." msgstr ":ref:`formatspec` para números hexa, octal e binários" -#: ../../library/stdtypes.rst:5640 +#: ../../builtins/stdtypes.rst:6250 msgid ":class:`str` to :class:`float`." msgstr ":class:`str` para :class:`float`." -#: ../../library/stdtypes.rst:5641 +#: ../../builtins/stdtypes.rst:6251 msgid ":class:`str` to :class:`decimal.Decimal`." msgstr ":class:`str` para :class:`decimal.Decimal`." -#: ../../library/stdtypes.rst:5644 +#: ../../builtins/stdtypes.rst:6254 msgid "Configuring the limit" msgstr "Configurando o limiter" -#: ../../library/stdtypes.rst:5646 +#: ../../builtins/stdtypes.rst:6256 msgid "" "Before Python starts up you can use an environment variable or an " "interpreter command line flag to configure the limit:" @@ -8105,7 +11010,7 @@ msgstr "" "Antes de iniciar o Python, você pode usar uma variável de ambiente ou um " "sinalizador de linha de comando do interpretador para configurar o limite:" -#: ../../library/stdtypes.rst:5649 +#: ../../builtins/stdtypes.rst:6259 msgid "" ":envvar:`PYTHONINTMAXSTRDIGITS`, e.g. ``PYTHONINTMAXSTRDIGITS=640 python3`` " "to set the limit to 640 or ``PYTHONINTMAXSTRDIGITS=0 python3`` to disable " @@ -8115,7 +11020,7 @@ msgstr "" "python3`` para definir o limite para 640 ou ``PYTHONINTMAXSTRDIGITS=0 " "python3`` para desabilitar a limitação." -#: ../../library/stdtypes.rst:5652 +#: ../../builtins/stdtypes.rst:6262 msgid "" ":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X " "int_max_str_digits=640``" @@ -8123,30 +11028,31 @@ msgstr "" ":option:`-X int_max_str_digits <-X>`, por exemplo ``python3 -X " "int_max_str_digits=640``" -#: ../../library/stdtypes.rst:5654 +#: ../../builtins/stdtypes.rst:6264 msgid "" -":data:`sys.flags.int_max_str_digits` contains the value of :envvar:" -"`PYTHONINTMAXSTRDIGITS` or :option:`-X int_max_str_digits <-X>`. If both the " -"env var and the ``-X`` option are set, the ``-X`` option takes precedence. A " -"value of *-1* indicates that both were unset, thus a value of :data:`sys." -"int_info.default_max_str_digits` was used during initialization." +":data:`sys.flags.int_max_str_digits` contains the value " +"of :envvar:`PYTHONINTMAXSTRDIGITS` or :option:`-X int_max_str_digits <-X>`. " +"If both the env var and the ``-X`` option are set, the ``-X`` option takes " +"precedence. A value of *-1* indicates that both were unset, thus a value " +"of :data:`sys.int_info.default_max_str_digits` was used during " +"initialization." msgstr "" -":data:`sys.flags.int_max_str_digits` contém o valor de :envvar:" -"`PYTHONINTMAXSTRDIGITS` ou :option:`-X int_max_str_digits <-X>`. Se a " -"variável env e a opção ``-X`` estiverem definidas, a opção ``-X`` terá " +":data:`sys.flags.int_max_str_digits` contém o valor " +"de :envvar:`PYTHONINTMAXSTRDIGITS` ou :option:`-X int_max_str_digits <-X>`. " +"Se a variável env e a opção ``-X`` estiverem definidas, a opção ``-X`` terá " "precedência. Um valor de *-1* indica que ambos não foram definidos, " "portanto, um valor de :data:`sys.int_info.default_max_str_digits` foi usado " "durante a inicialização." -#: ../../library/stdtypes.rst:5660 +#: ../../builtins/stdtypes.rst:6270 msgid "" -"From code, you can inspect the current limit and set a new one using these :" -"mod:`sys` APIs:" +"From code, you can inspect the current limit and set a new one using " +"these :mod:`sys` APIs:" msgstr "" "A partir do código, você pode inspecionar o limite atual e definir um novo " "usando estas APIs :mod:`sys`:" -#: ../../library/stdtypes.rst:5663 +#: ../../builtins/stdtypes.rst:6273 msgid "" ":func:`sys.get_int_max_str_digits` and :func:`sys.set_int_max_str_digits` " "are a getter and setter for the interpreter-wide limit. Subinterpreters have " @@ -8156,15 +11062,15 @@ msgstr "" "um getter e um setter para o limite de todo o interpretador. Os " "subinterpretadores têm seu próprio limite." -#: ../../library/stdtypes.rst:5667 +#: ../../builtins/stdtypes.rst:6277 msgid "" -"Information about the default and minimum can be found in :data:`sys." -"int_info`:" +"Information about the default and minimum can be found " +"in :data:`sys.int_info`:" msgstr "" -"Informações sobre o padrão e o mínimo podem ser encontradas em :data:`sys." -"int_info`:" +"Informações sobre o padrão e o mínimo podem ser encontradas " +"em :data:`sys.int_info`:" -#: ../../library/stdtypes.rst:5669 +#: ../../builtins/stdtypes.rst:6279 msgid "" ":data:`sys.int_info.default_max_str_digits ` is the compiled-" "in default limit." @@ -8172,7 +11078,7 @@ msgstr "" ":data:`sys.int_info.default_max_str_digits ` é o limite padrão " "compilado." -#: ../../library/stdtypes.rst:5671 +#: ../../builtins/stdtypes.rst:6281 msgid "" ":data:`sys.int_info.str_digits_check_threshold ` is the lowest " "accepted value for the limit (other than 0 which disables it)." @@ -8180,7 +11086,7 @@ msgstr "" ":data:`sys.int_info.str_digits_check_threshold ` é o menor " "valor aceito para o limite (diferente de 0 que o desabilita)." -#: ../../library/stdtypes.rst:5678 +#: ../../builtins/stdtypes.rst:6288 msgid "" "Setting a low limit *can* lead to problems. While rare, code exists that " "contains integer constants in decimal in their source that exceed the " @@ -8201,7 +11107,7 @@ msgstr "" "para source que contém tais constantes grandes é convertê-las para a forma " "hexadecimal ``0x``, pois não há limite." -#: ../../library/stdtypes.rst:5687 +#: ../../builtins/stdtypes.rst:6297 msgid "" "Test your application thoroughly if you use a low limit. Ensure your tests " "run with the limit set early via the environment or flag so that it applies " @@ -8214,11 +11120,11 @@ msgstr "" "inicialização e até mesmo durante qualquer etapa de instalação que possa " "invocar o Python para pré-compilar fontes ``.py`` para arquivos ``.pyc``." -#: ../../library/stdtypes.rst:5693 +#: ../../builtins/stdtypes.rst:6303 msgid "Recommended configuration" msgstr "Configuração recomendada" -#: ../../library/stdtypes.rst:5695 +#: ../../builtins/stdtypes.rst:6305 msgid "" "The default :data:`sys.int_info.default_max_str_digits` is expected to be " "reasonable for most applications. If your application requires a different " @@ -8231,19 +11137,41 @@ msgstr "" "agnóstico de versão Python, pois essas APIs foram adicionadas em lançamentos " "de patch de segurança em versões anteriores a 3.12." -#: ../../library/stdtypes.rst:5700 +#: ../../builtins/stdtypes.rst:6310 msgid "Example::" msgstr "Exemplo::" -#: ../../library/stdtypes.rst:5712 +#: ../../builtins/stdtypes.rst:6312 +msgid "" +">>> import sys\n" +">>> if hasattr(sys, \"set_int_max_str_digits\"):\n" +"... upper_bound = 68000\n" +"... lower_bound = 4004\n" +"... current_limit = sys.get_int_max_str_digits()\n" +"... if current_limit == 0 or current_limit > upper_bound:\n" +"... sys.set_int_max_str_digits(upper_bound)\n" +"... elif current_limit < lower_bound:\n" +"... sys.set_int_max_str_digits(lower_bound)" +msgstr "" +">>> import sys\n" +">>> if hasattr(sys, \"set_int_max_str_digits\"):\n" +"... upper_bound = 68000\n" +"... lower_bound = 4004\n" +"... current_limit = sys.get_int_max_str_digits()\n" +"... if current_limit == 0 or current_limit > upper_bound:\n" +"... sys.set_int_max_str_digits(upper_bound)\n" +"... elif current_limit < lower_bound:\n" +"... sys.set_int_max_str_digits(lower_bound)" + +#: ../../builtins/stdtypes.rst:6322 msgid "If you need to disable it entirely, set it to ``0``." msgstr "Se você precisar desativá-lo totalmente, defina-o como ``0``." -#: ../../library/stdtypes.rst:5716 +#: ../../builtins/stdtypes.rst:6326 msgid "Footnotes" msgstr "Notas de rodapé" -#: ../../library/stdtypes.rst:5717 +#: ../../builtins/stdtypes.rst:6327 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." @@ -8252,7 +11180,7 @@ msgstr "" "no Manual de Referência do Python (:ref:`Customização básica " "`)." -#: ../../library/stdtypes.rst:5720 +#: ../../builtins/stdtypes.rst:6330 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." @@ -8260,13 +11188,13 @@ msgstr "" "Como uma consequência, a lista ``[1, 2]`` é considerada igual a ``[1.0, " "2.0]``, e similarmente para tuplas." -#: ../../library/stdtypes.rst:5723 +#: ../../builtins/stdtypes.rst:6333 msgid "They must have since the parser can't tell the type of the operands." msgstr "" "Eles precisam ter, já que o analisador sintático não consegue dizer o tipo " "dos operandos." -#: ../../library/stdtypes.rst:5725 +#: ../../builtins/stdtypes.rst:6335 msgid "" "Cased characters are those with general category property being one of " "\"Lu\" (Letter, uppercase), \"Ll\" (Letter, lowercase), or \"Lt\" (Letter, " @@ -8276,7 +11204,7 @@ msgstr "" "de categoria geral igual a \"Lu\" (Letra, maiúscula), \"Ll\" (Letra, " "minúscula), ou \"Lt\" (Letra, em formato de título)." -#: ../../library/stdtypes.rst:5728 +#: ../../builtins/stdtypes.rst:6338 msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." @@ -8284,749 +11212,766 @@ msgstr "" "Para formatar apenas uma tupla, você deve portanto fornecer uma tupla com " "apenas um elemento, que é a tupla a ser formatada." -#: ../../library/stdtypes.rst:13 +#: ../../builtins/stdtypes.rst:13 msgid "built-in" msgstr "embutido" -#: ../../library/stdtypes.rst:13 ../../library/stdtypes.rst:316 -#: ../../library/stdtypes.rst:393 ../../library/stdtypes.rst:950 -#: ../../library/stdtypes.rst:1117 ../../library/stdtypes.rst:1139 -#: ../../library/stdtypes.rst:1154 ../../library/stdtypes.rst:4435 -#: ../../library/stdtypes.rst:5418 +#: ../../builtins/stdtypes.rst:13 ../../builtins/stdtypes.rst:316 +#: ../../builtins/stdtypes.rst:393 ../../builtins/stdtypes.rst:950 +#: ../../builtins/stdtypes.rst:1140 ../../builtins/stdtypes.rst:1162 +#: ../../builtins/stdtypes.rst:1177 ../../builtins/stdtypes.rst:5038 +#: ../../builtins/stdtypes.rst:6042 msgid "types" msgstr "types" -#: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:1154 -#: ../../library/stdtypes.rst:4435 +#: ../../builtins/stdtypes.rst:34 ../../builtins/stdtypes.rst:1177 +#: ../../builtins/stdtypes.rst:5038 msgid "statement" msgstr "instrução" -#: ../../library/stdtypes.rst:34 +#: ../../builtins/stdtypes.rst:34 msgid "if" msgstr "if" -#: ../../library/stdtypes.rst:34 +#: ../../builtins/stdtypes.rst:34 msgid "while" msgstr "while" -#: ../../library/stdtypes.rst:34 +#: ../../builtins/stdtypes.rst:34 msgid "truth" msgstr "verdade" -#: ../../library/stdtypes.rst:34 +#: ../../builtins/stdtypes.rst:34 msgid "value" -msgstr "value" +msgstr "valor" -#: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:81 -#: ../../library/stdtypes.rst:208 ../../library/stdtypes.rst:817 +#: ../../builtins/stdtypes.rst:34 ../../builtins/stdtypes.rst:81 +#: ../../builtins/stdtypes.rst:208 ../../builtins/stdtypes.rst:817 msgid "Boolean" msgstr "Booleano" -#: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:81 -#: ../../library/stdtypes.rst:393 +#: ../../builtins/stdtypes.rst:34 ../../builtins/stdtypes.rst:81 +#: ../../builtins/stdtypes.rst:393 msgid "operations" msgstr "operações" -#: ../../library/stdtypes.rst:34 +#: ../../builtins/stdtypes.rst:34 msgid "false" msgstr "false" -#: ../../library/stdtypes.rst:44 +#: ../../builtins/stdtypes.rst:44 msgid "true" msgstr "true" -#: ../../library/stdtypes.rst:52 +#: ../../builtins/stdtypes.rst:52 msgid "None (Built-in object)" msgstr "None (Objeto embutido)" -#: ../../library/stdtypes.rst:52 +#: ../../builtins/stdtypes.rst:52 msgid "False (Built-in object)" msgstr "False (objeto embutido)" -#: ../../library/stdtypes.rst:64 ../../library/stdtypes.rst:98 -#: ../../library/stdtypes.rst:123 ../../library/stdtypes.rst:195 -#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:393 -#: ../../library/stdtypes.rst:950 +#: ../../builtins/stdtypes.rst:64 ../../builtins/stdtypes.rst:98 +#: ../../builtins/stdtypes.rst:123 ../../builtins/stdtypes.rst:195 +#: ../../builtins/stdtypes.rst:246 ../../builtins/stdtypes.rst:393 +#: ../../builtins/stdtypes.rst:950 msgid "operator" msgstr "operador" -#: ../../library/stdtypes.rst:64 ../../library/stdtypes.rst:98 +#: ../../builtins/stdtypes.rst:64 ../../builtins/stdtypes.rst:98 msgid "or" msgstr "or" -#: ../../library/stdtypes.rst:64 ../../library/stdtypes.rst:98 +#: ../../builtins/stdtypes.rst:64 ../../builtins/stdtypes.rst:98 msgid "and" msgstr "and" -#: ../../library/stdtypes.rst:64 ../../library/stdtypes.rst:817 +#: ../../builtins/stdtypes.rst:64 ../../builtins/stdtypes.rst:817 msgid "False" msgstr "False" -#: ../../library/stdtypes.rst:64 ../../library/stdtypes.rst:817 +#: ../../builtins/stdtypes.rst:64 ../../builtins/stdtypes.rst:817 msgid "True" msgstr "True" -#: ../../library/stdtypes.rst:98 +#: ../../builtins/stdtypes.rst:98 msgid "not" msgstr "not" -#: ../../library/stdtypes.rst:123 +#: ../../builtins/stdtypes.rst:123 msgid "chaining" msgstr "encadeamento" -#: ../../library/stdtypes.rst:123 +#: ../../builtins/stdtypes.rst:123 msgid "comparisons" msgstr "comparações" -#: ../../library/stdtypes.rst:123 +#: ../../builtins/stdtypes.rst:123 msgid "comparison" msgstr "comparação" -#: ../../library/stdtypes.rst:123 +#: ../../builtins/stdtypes.rst:123 msgid "==" msgstr "==" -#: ../../library/stdtypes.rst:123 +#: ../../builtins/stdtypes.rst:123 msgid "< (less)" -msgstr "< (menor)" +msgstr "< (menor que)" -#: ../../library/stdtypes.rst:123 +#: ../../builtins/stdtypes.rst:123 msgid "<=" msgstr "<=" -#: ../../library/stdtypes.rst:123 +#: ../../builtins/stdtypes.rst:123 msgid "> (greater)" msgstr "> (maior)" -#: ../../library/stdtypes.rst:123 +#: ../../builtins/stdtypes.rst:123 msgid ">=" msgstr ">=" -#: ../../library/stdtypes.rst:123 +#: ../../builtins/stdtypes.rst:123 msgid "!=" msgstr "!=" -#: ../../library/stdtypes.rst:123 +#: ../../builtins/stdtypes.rst:123 msgid "is" msgstr "is" -#: ../../library/stdtypes.rst:123 +#: ../../builtins/stdtypes.rst:123 msgid "is not" msgstr "is not" -#: ../../library/stdtypes.rst:163 ../../library/stdtypes.rst:208 -#: ../../library/stdtypes.rst:934 ../../library/stdtypes.rst:1117 -#: ../../library/stdtypes.rst:1139 ../../library/stdtypes.rst:1260 -#: ../../library/stdtypes.rst:1339 ../../library/stdtypes.rst:1383 -#: ../../library/stdtypes.rst:1504 ../../library/stdtypes.rst:1540 -#: ../../library/stdtypes.rst:2526 ../../library/stdtypes.rst:2545 -#: ../../library/stdtypes.rst:2652 ../../library/stdtypes.rst:4233 -#: ../../library/stdtypes.rst:4435 ../../library/stdtypes.rst:4913 -#: ../../library/stdtypes.rst:5168 ../../library/stdtypes.rst:5338 -#: ../../library/stdtypes.rst:5382 +#: ../../builtins/stdtypes.rst:163 ../../builtins/stdtypes.rst:208 +#: ../../builtins/stdtypes.rst:934 ../../builtins/stdtypes.rst:1140 +#: ../../builtins/stdtypes.rst:1162 ../../builtins/stdtypes.rst:1327 +#: ../../builtins/stdtypes.rst:1408 ../../builtins/stdtypes.rst:1456 +#: ../../builtins/stdtypes.rst:1577 ../../builtins/stdtypes.rst:1613 +#: ../../builtins/stdtypes.rst:3112 ../../builtins/stdtypes.rst:3131 +#: ../../builtins/stdtypes.rst:3240 ../../builtins/stdtypes.rst:4827 +#: ../../builtins/stdtypes.rst:5038 ../../builtins/stdtypes.rst:5524 +#: ../../builtins/stdtypes.rst:5791 ../../builtins/stdtypes.rst:5961 +#: ../../builtins/stdtypes.rst:6006 msgid "object" msgstr "objeto" -#: ../../library/stdtypes.rst:163 ../../library/stdtypes.rst:208 -#: ../../library/stdtypes.rst:229 ../../library/stdtypes.rst:316 -#: ../../library/stdtypes.rst:335 +#: ../../builtins/stdtypes.rst:163 ../../builtins/stdtypes.rst:208 +#: ../../builtins/stdtypes.rst:229 ../../builtins/stdtypes.rst:316 +#: ../../builtins/stdtypes.rst:335 msgid "numeric" msgstr "numérico" -#: ../../library/stdtypes.rst:163 +#: ../../builtins/stdtypes.rst:163 msgid "objects" msgstr "objetos" -#: ../../library/stdtypes.rst:163 +#: ../../builtins/stdtypes.rst:163 msgid "comparing" msgstr "comparando" -#: ../../library/stdtypes.rst:173 +#: ../../builtins/stdtypes.rst:173 msgid "__eq__() (instance method)" msgstr "__eq__() (método de instância)" -#: ../../library/stdtypes.rst:173 +#: ../../builtins/stdtypes.rst:173 msgid "__ne__() (instance method)" msgstr "__ne__() (método de instância)" -#: ../../library/stdtypes.rst:173 +#: ../../builtins/stdtypes.rst:173 msgid "__lt__() (instance method)" msgstr "__lt__() (método de instância)" -#: ../../library/stdtypes.rst:173 +#: ../../builtins/stdtypes.rst:173 msgid "__le__() (instance method)" msgstr "__le__() (método de instância)" -#: ../../library/stdtypes.rst:173 +#: ../../builtins/stdtypes.rst:173 msgid "__gt__() (instance method)" msgstr "__gt__() (método de instância)" -#: ../../library/stdtypes.rst:173 +#: ../../builtins/stdtypes.rst:173 msgid "__ge__() (instance method)" msgstr "__ge__() (método de instância)" -#: ../../library/stdtypes.rst:195 ../../library/stdtypes.rst:950 +#: ../../builtins/stdtypes.rst:195 ../../builtins/stdtypes.rst:950 msgid "in" msgstr "in" -#: ../../library/stdtypes.rst:195 ../../library/stdtypes.rst:950 +#: ../../builtins/stdtypes.rst:195 ../../builtins/stdtypes.rst:950 msgid "not in" msgstr "not in" -#: ../../library/stdtypes.rst:208 ../../library/stdtypes.rst:229 -#: ../../library/stdtypes.rst:393 +#: ../../builtins/stdtypes.rst:208 ../../builtins/stdtypes.rst:229 +#: ../../builtins/stdtypes.rst:393 msgid "integer" msgstr "inteiro" -#: ../../library/stdtypes.rst:208 ../../library/stdtypes.rst:229 +#: ../../builtins/stdtypes.rst:208 ../../builtins/stdtypes.rst:229 msgid "floating-point" msgstr "ponto flutuante" -#: ../../library/stdtypes.rst:208 ../../library/stdtypes.rst:229 +#: ../../builtins/stdtypes.rst:208 ../../builtins/stdtypes.rst:229 msgid "complex number" msgstr "número complexo" -#: ../../library/stdtypes.rst:208 +#: ../../builtins/stdtypes.rst:208 msgid "C" msgstr "C" -#: ../../library/stdtypes.rst:208 +#: ../../builtins/stdtypes.rst:208 msgid "language" msgstr "linguagem" -#: ../../library/stdtypes.rst:229 +#: ../../builtins/stdtypes.rst:229 msgid "literals" msgstr "literais" -#: ../../library/stdtypes.rst:229 +#: ../../builtins/stdtypes.rst:229 msgid "hexadecimal" msgstr "hexadecimal" -#: ../../library/stdtypes.rst:229 +#: ../../builtins/stdtypes.rst:229 msgid "octal" msgstr "octal" -#: ../../library/stdtypes.rst:229 +#: ../../builtins/stdtypes.rst:229 msgid "binary" msgstr "binário" -#: ../../library/stdtypes.rst:246 +#: ../../builtins/stdtypes.rst:246 msgid "arithmetic" msgstr "aritmética" -#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:950 -#: ../../library/stdtypes.rst:1117 ../../library/stdtypes.rst:4435 -#: ../../library/stdtypes.rst:5389 ../../library/stdtypes.rst:5403 -#: ../../library/stdtypes.rst:5418 +#: ../../builtins/stdtypes.rst:246 ../../builtins/stdtypes.rst:950 +#: ../../builtins/stdtypes.rst:1140 ../../builtins/stdtypes.rst:5038 +#: ../../builtins/stdtypes.rst:6013 ../../builtins/stdtypes.rst:6027 +#: ../../builtins/stdtypes.rst:6042 msgid "built-in function" msgstr "função embutida" -#: ../../library/stdtypes.rst:246 +#: ../../builtins/stdtypes.rst:246 msgid "int" msgstr "int" -#: ../../library/stdtypes.rst:246 +#: ../../builtins/stdtypes.rst:246 msgid "float" msgstr "ponto flutuante" -#: ../../library/stdtypes.rst:246 +#: ../../builtins/stdtypes.rst:246 msgid "complex" msgstr "complexo" -#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:2402 -#: ../../library/stdtypes.rst:3621 +#: ../../builtins/stdtypes.rst:246 ../../builtins/stdtypes.rst:2984 +#: ../../builtins/stdtypes.rst:4213 msgid "+ (plus)" msgstr "+ (mais)" -#: ../../library/stdtypes.rst:246 +#: ../../builtins/stdtypes.rst:246 msgid "unary operator" msgstr "operador unário" -#: ../../library/stdtypes.rst:246 +#: ../../builtins/stdtypes.rst:246 msgid "binary operator" msgstr "operador binário" -#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:2402 -#: ../../library/stdtypes.rst:3621 +#: ../../builtins/stdtypes.rst:246 ../../builtins/stdtypes.rst:2984 +#: ../../builtins/stdtypes.rst:4213 msgid "- (minus)" msgstr "- (menos)" -#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:2359 -#: ../../library/stdtypes.rst:3578 +#: ../../builtins/stdtypes.rst:246 ../../builtins/stdtypes.rst:2941 +#: ../../builtins/stdtypes.rst:4170 msgid "* (asterisk)" msgstr "* (asterisco)" -#: ../../library/stdtypes.rst:246 +#: ../../builtins/stdtypes.rst:246 msgid "/ (slash)" msgstr "/ (barra)" -#: ../../library/stdtypes.rst:246 +#: ../../builtins/stdtypes.rst:246 msgid "//" msgstr "//" -#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:2323 -#: ../../library/stdtypes.rst:3546 +#: ../../builtins/stdtypes.rst:246 ../../builtins/stdtypes.rst:2905 +#: ../../builtins/stdtypes.rst:4138 msgid "% (percent)" msgstr "% (porcentagem)" -#: ../../library/stdtypes.rst:246 +#: ../../builtins/stdtypes.rst:246 msgid "**" msgstr "**" -#: ../../library/stdtypes.rst:316 ../../library/stdtypes.rst:393 -#: ../../library/stdtypes.rst:950 ../../library/stdtypes.rst:1154 -#: ../../library/stdtypes.rst:4435 +#: ../../builtins/stdtypes.rst:316 ../../builtins/stdtypes.rst:393 +#: ../../builtins/stdtypes.rst:950 ../../builtins/stdtypes.rst:1177 +#: ../../builtins/stdtypes.rst:5038 msgid "operations on" msgstr "operações em" -#: ../../library/stdtypes.rst:316 +#: ../../builtins/stdtypes.rst:316 msgid "conjugate() (complex number method)" msgstr "conjugate() (método de número complexo)" -#: ../../library/stdtypes.rst:335 ../../library/stdtypes.rst:1606 -#: ../../library/stdtypes.rst:2526 ../../library/stdtypes.rst:5418 +#: ../../builtins/stdtypes.rst:335 ../../builtins/stdtypes.rst:1681 +#: ../../builtins/stdtypes.rst:3112 ../../builtins/stdtypes.rst:6042 msgid "module" msgstr "módulo" -#: ../../library/stdtypes.rst:335 +#: ../../builtins/stdtypes.rst:335 msgid "math" msgstr "math" -#: ../../library/stdtypes.rst:335 +#: ../../builtins/stdtypes.rst:335 msgid "floor() (in module math)" msgstr "floor() (no módulo math)" -#: ../../library/stdtypes.rst:335 +#: ../../builtins/stdtypes.rst:335 msgid "ceil() (in module math)" msgstr "ceil() (no módulo math)" -#: ../../library/stdtypes.rst:335 +#: ../../builtins/stdtypes.rst:335 msgid "trunc() (in module math)" msgstr "trunc() (no módulo math)" -#: ../../library/stdtypes.rst:335 +#: ../../builtins/stdtypes.rst:335 msgid "conversions" msgstr "conversões" -#: ../../library/stdtypes.rst:393 +#: ../../builtins/stdtypes.rst:393 msgid "bitwise" msgstr "bit a bit" -#: ../../library/stdtypes.rst:393 +#: ../../builtins/stdtypes.rst:393 msgid "shifting" msgstr "deslocamento" -#: ../../library/stdtypes.rst:393 +#: ../../builtins/stdtypes.rst:393 msgid "masking" msgstr "mascaramento" -#: ../../library/stdtypes.rst:393 +#: ../../builtins/stdtypes.rst:393 msgid "| (vertical bar)" msgstr "| (barra vertical)" -#: ../../library/stdtypes.rst:393 +#: ../../builtins/stdtypes.rst:393 msgid "^ (caret)" msgstr "^ (circunflexo)" -#: ../../library/stdtypes.rst:393 +#: ../../builtins/stdtypes.rst:393 msgid "& (ampersand)" msgstr "& (e comercial)" -#: ../../library/stdtypes.rst:393 +#: ../../builtins/stdtypes.rst:393 msgid "<<" msgstr "<<" -#: ../../library/stdtypes.rst:393 +#: ../../builtins/stdtypes.rst:393 msgid ">>" msgstr ">>" -#: ../../library/stdtypes.rst:393 +#: ../../builtins/stdtypes.rst:393 msgid "~ (tilde)" msgstr "~ (til)" -#: ../../library/stdtypes.rst:817 +#: ../../builtins/stdtypes.rst:817 msgid "values" msgstr "valores" -#: ../../library/stdtypes.rst:847 +#: ../../builtins/stdtypes.rst:847 msgid "iterator protocol" msgstr "protocolo iterador" -#: ../../library/stdtypes.rst:847 ../../library/stdtypes.rst:4828 +#: ../../builtins/stdtypes.rst:847 ../../builtins/stdtypes.rst:5437 msgid "protocol" msgstr "protocolo" -#: ../../library/stdtypes.rst:847 +#: ../../builtins/stdtypes.rst:847 msgid "iterator" msgstr "iterador" -#: ../../library/stdtypes.rst:847 ../../library/stdtypes.rst:934 -#: ../../library/stdtypes.rst:950 ../../library/stdtypes.rst:1117 -#: ../../library/stdtypes.rst:1139 ../../library/stdtypes.rst:1154 +#: ../../builtins/stdtypes.rst:847 ../../builtins/stdtypes.rst:934 +#: ../../builtins/stdtypes.rst:950 ../../builtins/stdtypes.rst:1140 +#: ../../builtins/stdtypes.rst:1162 ../../builtins/stdtypes.rst:1177 msgid "sequence" msgstr "sequência" -#: ../../library/stdtypes.rst:847 +#: ../../builtins/stdtypes.rst:847 msgid "iteration" msgstr "iteração" -#: ../../library/stdtypes.rst:847 +#: ../../builtins/stdtypes.rst:847 msgid "container" msgstr "contêiner" -#: ../../library/stdtypes.rst:847 +#: ../../builtins/stdtypes.rst:847 msgid "iteration over" msgstr "iteração por" -#: ../../library/stdtypes.rst:950 ../../library/stdtypes.rst:4435 +#: ../../builtins/stdtypes.rst:950 ../../builtins/stdtypes.rst:5038 msgid "len" msgstr "len" -#: ../../library/stdtypes.rst:950 +#: ../../builtins/stdtypes.rst:950 msgid "min" msgstr "min" -#: ../../library/stdtypes.rst:950 +#: ../../builtins/stdtypes.rst:950 msgid "max" msgstr "max" -#: ../../library/stdtypes.rst:950 +#: ../../builtins/stdtypes.rst:950 msgid "concatenation" msgstr "concatenação" -#: ../../library/stdtypes.rst:950 +#: ../../builtins/stdtypes.rst:950 msgid "operation" msgstr "operação" -#: ../../library/stdtypes.rst:950 +#: ../../builtins/stdtypes.rst:950 msgid "repetition" msgstr "repetição" -#: ../../library/stdtypes.rst:950 ../../library/stdtypes.rst:1154 +#: ../../builtins/stdtypes.rst:950 ../../builtins/stdtypes.rst:1177 msgid "subscript" -msgstr "subscrição" +msgstr "subscrito" -#: ../../library/stdtypes.rst:950 ../../library/stdtypes.rst:1154 +#: ../../builtins/stdtypes.rst:950 ../../builtins/stdtypes.rst:1177 msgid "slice" msgstr "fatia" -#: ../../library/stdtypes.rst:950 -msgid "count() (sequence method)" -msgstr "count() (método de sequência)" - -#: ../../library/stdtypes.rst:950 -msgid "index() (sequence method)" -msgstr "index() (método de sequência)" - -#: ../../library/stdtypes.rst:1006 +#: ../../builtins/stdtypes.rst:997 msgid "loop" msgstr "laço" -#: ../../library/stdtypes.rst:1006 +#: ../../builtins/stdtypes.rst:997 msgid "over mutable sequence" msgstr "sobre sequência mutável" -#: ../../library/stdtypes.rst:1006 +#: ../../builtins/stdtypes.rst:997 msgid "mutable sequence" msgstr "sequência mutável" -#: ../../library/stdtypes.rst:1006 +#: ../../builtins/stdtypes.rst:997 msgid "loop over" msgstr "laço sobre" -#: ../../library/stdtypes.rst:1117 +#: ../../builtins/stdtypes.rst:1140 msgid "immutable" msgstr "imutável" -#: ../../library/stdtypes.rst:1117 ../../library/stdtypes.rst:1339 +#: ../../builtins/stdtypes.rst:1140 ../../builtins/stdtypes.rst:1408 msgid "tuple" msgstr "tupla" -#: ../../library/stdtypes.rst:1117 +#: ../../builtins/stdtypes.rst:1140 msgid "hash" msgstr "hash" -#: ../../library/stdtypes.rst:1139 +#: ../../builtins/stdtypes.rst:1162 msgid "mutable" msgstr "mutável" -#: ../../library/stdtypes.rst:1139 ../../library/stdtypes.rst:1154 -#: ../../library/stdtypes.rst:1260 +#: ../../builtins/stdtypes.rst:1162 ../../builtins/stdtypes.rst:1177 +#: ../../builtins/stdtypes.rst:1327 msgid "list" msgstr "lista" -#: ../../library/stdtypes.rst:1139 ../../library/stdtypes.rst:2526 -#: ../../library/stdtypes.rst:2652 ../../library/stdtypes.rst:2724 -#: ../../library/stdtypes.rst:3546 +#: ../../builtins/stdtypes.rst:1162 ../../builtins/stdtypes.rst:3112 +#: ../../builtins/stdtypes.rst:3240 ../../builtins/stdtypes.rst:3314 +#: ../../builtins/stdtypes.rst:4138 msgid "bytearray" msgstr "bytearray" -#: ../../library/stdtypes.rst:1154 ../../library/stdtypes.rst:4435 -#: ../../library/stdtypes.rst:5168 ../../library/stdtypes.rst:5418 +#: ../../builtins/stdtypes.rst:1177 ../../builtins/stdtypes.rst:5038 +#: ../../builtins/stdtypes.rst:5791 ../../builtins/stdtypes.rst:6042 msgid "type" msgstr "tipo" -#: ../../library/stdtypes.rst:1154 +#: ../../builtins/stdtypes.rst:1177 msgid "assignment" msgstr "atribuição" -#: ../../library/stdtypes.rst:1154 ../../library/stdtypes.rst:4435 +#: ../../builtins/stdtypes.rst:1177 ../../builtins/stdtypes.rst:5038 msgid "del" msgstr "del" -#: ../../library/stdtypes.rst:1154 -msgid "append() (sequence method)" -msgstr "append() (método de sequência)" - -#: ../../library/stdtypes.rst:1154 -msgid "clear() (sequence method)" -msgstr "clear() (método de sequência)" - -#: ../../library/stdtypes.rst:1154 -msgid "copy() (sequence method)" -msgstr "copy() (método de sequência)" - -#: ../../library/stdtypes.rst:1154 -msgid "extend() (sequence method)" -msgstr "extend() (método de sequência)" - -#: ../../library/stdtypes.rst:1154 -msgid "insert() (sequence method)" -msgstr "insert() (método de sequência)" - -#: ../../library/stdtypes.rst:1154 -msgid "pop() (sequence method)" -msgstr "pop() (método de sequência)" - -#: ../../library/stdtypes.rst:1154 -msgid "remove() (sequence method)" -msgstr "remove() (método de sequência)" - -#: ../../library/stdtypes.rst:1154 -msgid "reverse() (sequence method)" -msgstr "reverse() (método de sequência)" - -#: ../../library/stdtypes.rst:1383 +#: ../../builtins/stdtypes.rst:1456 msgid "range" msgstr "range" -#: ../../library/stdtypes.rst:1504 ../../library/stdtypes.rst:1553 -#: ../../library/stdtypes.rst:1598 ../../library/stdtypes.rst:2323 +#: ../../builtins/stdtypes.rst:1577 ../../builtins/stdtypes.rst:1626 +#: ../../builtins/stdtypes.rst:1673 ../../builtins/stdtypes.rst:2759 +#: ../../builtins/stdtypes.rst:2905 msgid "string" msgstr "string" -#: ../../library/stdtypes.rst:1504 +#: ../../builtins/stdtypes.rst:1577 msgid "text sequence type" msgstr "tipo sequência de texto" -#: ../../library/stdtypes.rst:1504 ../../library/stdtypes.rst:1553 -#: ../../library/stdtypes.rst:1571 +#: ../../builtins/stdtypes.rst:1577 ../../builtins/stdtypes.rst:1626 +#: ../../builtins/stdtypes.rst:1646 msgid "str (built-in class)" msgstr "str (classe embutida)" -#: ../../library/stdtypes.rst:1504 +#: ../../builtins/stdtypes.rst:1577 msgid "(see also string)" msgstr "(veja também string)" -#: ../../library/stdtypes.rst:1540 +#: ../../builtins/stdtypes.rst:1613 msgid "io.StringIO" msgstr "io.StringIO" -#: ../../library/stdtypes.rst:1571 ../../library/stdtypes.rst:2518 +#: ../../builtins/stdtypes.rst:1646 ../../builtins/stdtypes.rst:3104 msgid "buffer protocol" msgstr "protocolo de buffer" -#: ../../library/stdtypes.rst:1571 ../../library/stdtypes.rst:2526 -#: ../../library/stdtypes.rst:2545 ../../library/stdtypes.rst:2724 -#: ../../library/stdtypes.rst:3546 +#: ../../builtins/stdtypes.rst:1646 ../../builtins/stdtypes.rst:3112 +#: ../../builtins/stdtypes.rst:3131 ../../builtins/stdtypes.rst:3314 +#: ../../builtins/stdtypes.rst:4138 msgid "bytes" msgstr "bytes" -#: ../../library/stdtypes.rst:1598 ../../library/stdtypes.rst:2724 +#: ../../builtins/stdtypes.rst:1673 ../../builtins/stdtypes.rst:3314 msgid "methods" msgstr "métodos" -#: ../../library/stdtypes.rst:1606 +#: ../../builtins/stdtypes.rst:1681 msgid "re" msgstr "re" -#: ../../library/stdtypes.rst:2131 ../../library/stdtypes.rst:3400 +#: ../../builtins/stdtypes.rst:2529 ../../builtins/stdtypes.rst:3992 msgid "universal newlines" msgstr "novas linhas universais" -#: ../../library/stdtypes.rst:2131 +#: ../../builtins/stdtypes.rst:2529 msgid "str.splitlines method" msgstr "método str.splitlines" -#: ../../library/stdtypes.rst:2323 +#: ../../builtins/stdtypes.rst:2759 +msgid "! formatted string literal" +msgstr "literal de string formatada com !" + +#: ../../builtins/stdtypes.rst:2759 +msgid "formatted string literals" +msgstr "literais de string formatadas" + +#: ../../builtins/stdtypes.rst:2759 +msgid "! f-string" +msgstr "! f-string" + +#: ../../builtins/stdtypes.rst:2759 +msgid "f-strings" +msgstr "f-strings" + +#: ../../builtins/stdtypes.rst:2759 +msgid "fstring" +msgstr "fstring" + +#: ../../builtins/stdtypes.rst:2759 +msgid "interpolated string literal" +msgstr "literal de string interpolada" + +#: ../../builtins/stdtypes.rst:2759 +msgid "formatted literal" +msgstr "literal formatado" + +#: ../../builtins/stdtypes.rst:2759 +msgid "interpolated literal" +msgstr "literal interpolado" + +#: ../../builtins/stdtypes.rst:2759 +msgid "{} (curly brackets)" +msgstr "{} (chaves)" + +#: ../../builtins/stdtypes.rst:2759 +msgid "in formatted string literal" +msgstr "em literal de string formatado" + +#: ../../builtins/stdtypes.rst:2759 +msgid "! (exclamation mark)" +msgstr "! (ponto de exclamação)" + +#: ../../builtins/stdtypes.rst:2759 +msgid ": (colon)" +msgstr ": (dois pontos)" + +#: ../../builtins/stdtypes.rst:2759 +msgid "= (equals)" +msgstr "= (igual)" + +#: ../../builtins/stdtypes.rst:2759 +msgid "for help in debugging using string literals" +msgstr "para ajudar na depuração usando literais de string" + +#: ../../builtins/stdtypes.rst:2905 msgid "formatting, string (%)" msgstr "formatação, string (%)" -#: ../../library/stdtypes.rst:2323 +#: ../../builtins/stdtypes.rst:2905 msgid "interpolation, string (%)" msgstr "interpolação, string (%)" -#: ../../library/stdtypes.rst:2323 +#: ../../builtins/stdtypes.rst:2905 msgid "formatting, printf" msgstr "formatação, printf" -#: ../../library/stdtypes.rst:2323 +#: ../../builtins/stdtypes.rst:2905 msgid "interpolation, printf" msgstr "interpolação, printf" -#: ../../library/stdtypes.rst:2323 ../../library/stdtypes.rst:3546 +#: ../../builtins/stdtypes.rst:2905 ../../builtins/stdtypes.rst:4138 msgid "printf-style formatting" msgstr "printf, estilo de formatação" -#: ../../library/stdtypes.rst:2323 ../../library/stdtypes.rst:3546 +#: ../../builtins/stdtypes.rst:2905 ../../builtins/stdtypes.rst:4138 msgid "sprintf-style formatting" msgstr "sprintf, estilo de formatação" -#: ../../library/stdtypes.rst:2359 ../../library/stdtypes.rst:3578 +#: ../../builtins/stdtypes.rst:2941 ../../builtins/stdtypes.rst:4170 msgid "() (parentheses)" msgstr "() (parênteses)" -#: ../../library/stdtypes.rst:2359 ../../library/stdtypes.rst:2402 -#: ../../library/stdtypes.rst:3578 ../../library/stdtypes.rst:3621 +#: ../../builtins/stdtypes.rst:2941 ../../builtins/stdtypes.rst:2984 +#: ../../builtins/stdtypes.rst:4170 ../../builtins/stdtypes.rst:4213 msgid "in printf-style formatting" msgstr "em formatação no estilo printf" -#: ../../library/stdtypes.rst:2359 ../../library/stdtypes.rst:3578 +#: ../../builtins/stdtypes.rst:2941 ../../builtins/stdtypes.rst:4170 msgid ". (dot)" msgstr ". (ponto)" -#: ../../library/stdtypes.rst:2402 ../../library/stdtypes.rst:3621 +#: ../../builtins/stdtypes.rst:2984 ../../builtins/stdtypes.rst:4213 msgid "# (hash)" msgstr "# (cerquilha)" -#: ../../library/stdtypes.rst:2402 ../../library/stdtypes.rst:3621 +#: ../../builtins/stdtypes.rst:2984 ../../builtins/stdtypes.rst:4213 msgid "space" msgstr "espaço" -#: ../../library/stdtypes.rst:2518 +#: ../../builtins/stdtypes.rst:3104 msgid "binary sequence types" msgstr "tipos de sequência binária" -#: ../../library/stdtypes.rst:2526 +#: ../../builtins/stdtypes.rst:3112 msgid "memoryview" msgstr "memoryview" -#: ../../library/stdtypes.rst:2526 +#: ../../builtins/stdtypes.rst:3112 msgid "array" msgstr "array" -#: ../../library/stdtypes.rst:3400 +#: ../../builtins/stdtypes.rst:3992 msgid "bytes.splitlines method" msgstr "método bytes.splitlines" -#: ../../library/stdtypes.rst:3400 +#: ../../builtins/stdtypes.rst:3992 msgid "bytearray.splitlines method" msgstr "método bytearray.splitlines" -#: ../../library/stdtypes.rst:3546 +#: ../../builtins/stdtypes.rst:4138 msgid "formatting" msgstr "formatação" -#: ../../library/stdtypes.rst:3546 +#: ../../builtins/stdtypes.rst:4138 msgid "bytes (%)" msgstr "bytes (%)" -#: ../../library/stdtypes.rst:3546 +#: ../../builtins/stdtypes.rst:4138 msgid "bytearray (%)" msgstr "bytearray (%)" -#: ../../library/stdtypes.rst:3546 +#: ../../builtins/stdtypes.rst:4138 msgid "interpolation" msgstr "interpolação" -#: ../../library/stdtypes.rst:4233 +#: ../../builtins/stdtypes.rst:4827 msgid "set" msgstr "set" -#: ../../library/stdtypes.rst:4435 +#: ../../builtins/stdtypes.rst:5038 msgid "mapping" msgstr "mapeamento" -#: ../../library/stdtypes.rst:4435 +#: ../../builtins/stdtypes.rst:5038 msgid "dictionary" msgstr "dicionário" -#: ../../library/stdtypes.rst:4518 +#: ../../builtins/stdtypes.rst:5148 msgid "__missing__()" msgstr "__missing__()" -#: ../../library/stdtypes.rst:4828 +#: ../../builtins/stdtypes.rst:5437 msgid "context manager" msgstr "gerenciador de contexto" -#: ../../library/stdtypes.rst:4828 +#: ../../builtins/stdtypes.rst:5437 msgid "context management protocol" msgstr "protocolo de gerenciamento de contexto" -#: ../../library/stdtypes.rst:4828 +#: ../../builtins/stdtypes.rst:5437 msgid "context management" msgstr "gerenciamento de contexto" -#: ../../library/stdtypes.rst:4901 +#: ../../builtins/stdtypes.rst:5512 msgid "annotation" msgstr "anotação" -#: ../../library/stdtypes.rst:4901 +#: ../../builtins/stdtypes.rst:5512 msgid "type annotation; type hint" msgstr "tipo, anotação de; tipo, dica de" -#: ../../library/stdtypes.rst:4913 +#: ../../builtins/stdtypes.rst:5524 msgid "GenericAlias" msgstr "GenericAlias" -#: ../../library/stdtypes.rst:4913 +#: ../../builtins/stdtypes.rst:5524 msgid "Generic" msgstr "Generic" -#: ../../library/stdtypes.rst:4913 +#: ../../builtins/stdtypes.rst:5524 msgid "Alias" msgstr "Alias" -#: ../../library/stdtypes.rst:5168 +#: ../../builtins/stdtypes.rst:5791 msgid "Union" msgstr "União" -#: ../../library/stdtypes.rst:5168 +#: ../../builtins/stdtypes.rst:5791 msgid "union" msgstr "união" -#: ../../library/stdtypes.rst:5338 +#: ../../builtins/stdtypes.rst:5961 msgid "method" msgstr "método" -#: ../../library/stdtypes.rst:5382 +#: ../../builtins/stdtypes.rst:6006 msgid "code" msgstr "código" -#: ../../library/stdtypes.rst:5382 +#: ../../builtins/stdtypes.rst:6006 msgid "code object" msgstr "objeto código" -#: ../../library/stdtypes.rst:5389 +#: ../../builtins/stdtypes.rst:6013 msgid "compile" msgstr "compile" -#: ../../library/stdtypes.rst:5389 +#: ../../builtins/stdtypes.rst:6013 msgid "__code__ (function object attribute)" msgstr "__code__ (atributo de objeto função)" -#: ../../library/stdtypes.rst:5403 +#: ../../builtins/stdtypes.rst:6027 msgid "exec" msgstr "exec" -#: ../../library/stdtypes.rst:5403 +#: ../../builtins/stdtypes.rst:6027 msgid "eval" msgstr "eval" -#: ../../library/stdtypes.rst:5442 +#: ../../builtins/stdtypes.rst:6066 msgid "..." msgstr "..." -#: ../../library/stdtypes.rst:5442 +#: ../../builtins/stdtypes.rst:6066 msgid "ellipsis literal" -msgstr "reticências literais" +msgstr "literal de reticências" diff --git a/c-api/abstract.po b/c-api/abstract.po index 3a5bad996..d0d5bd98a 100644 --- a/c-api/abstract.po +++ b/c-api/abstract.po @@ -1,26 +1,25 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Felipefpl, 2021 -# Rafael Fontenelle , 2022 +# python-doc bot, 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-24 14:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Rafael Fontenelle , 2022\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: python-doc bot, 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -35,20 +34,18 @@ msgid "" "or all sequence types). When used on object types for which they do not " "apply, they will raise a Python exception." msgstr "" -"As funções neste capítulo interagem com os objetos do Python " -"independentemente do tipo deles ou com classes amplas dos tipos de objetos " -"(por exemplo, todos os tipos numéricos ou todos os tipos de sequência). " -"Quando usado nos tipos de objetos pros quais eles não se aplicam eles " -"levantarão uma exceção no Python." +"As funções neste capítulo interagem com objetos Python independentemente do " +"seu tipo, ou com classes amplas de tipos de objetos (por exemplo, todos os " +"tipos numéricos ou todos os tipos de sequência). Quando usadas em tipos de " +"objetos para os quais não se aplicam, elas irão levantar uma exceção Python." #: ../../c-api/abstract.rst:14 msgid "" "It is not possible to use these functions on objects that are not properly " -"initialized, such as a list object that has been created by :c:func:" -"`PyList_New`, but whose items have not been set to some non-\\ ``NULL`` " -"value yet." +"initialized, such as a list object that has been created " +"by :c:func:`PyList_New`, but whose items have not been set to some non-\\ " +"``NULL`` value yet." msgstr "" -"Não é possível usar estas funções em objetos que não estão apropriadamente " -"inicializados, tal como uma objeto de lista que foi criado por :c:func:" -"`PyList_New`, mas cujos itens não foram definidos como algum valor não " -"``NULL`` ainda." +"Não é possível usar essas funções em objetos que não foram inicializados " +"corretamente, como um objeto de lista criado por :c:func:`PyList_New`, mas " +"cujos itens ainda não foram definidos para algum valor diferente de ``NULL``." diff --git a/c-api/allocation.po b/c-api/allocation.po index 3d978e286..f663aafc0 100644 --- a/c-api/allocation.po +++ b/c-api/allocation.po @@ -1,48 +1,44 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Welington Carlos , 2021 -# Felipefpl, 2021 -# Rafael Fontenelle , 2023 +# Gustavo Reis, 2025 +# python-doc bot, 2025 +# Rafael Fontenelle , 2026 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-24 14:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2026-10-17 18:27+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2026\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../c-api/allocation.rst:6 -msgid "Allocating Objects on the Heap" -msgstr "Alocando Objetos na Pilha" +msgid "Allocating objects on the heap" +msgstr "Alocando objetos na heap" #: ../../c-api/allocation.rst:17 msgid "" "Initialize a newly allocated object *op* with its type and initial " -"reference. Returns the initialized object. If *type* indicates that the " -"object participates in the cyclic garbage detector, it is added to the " -"detector's set of observed objects. Other fields of the object are not " -"affected." +"reference. Returns the initialized object. Other fields of the object are " +"not affected." msgstr "" "Inicializa um objeto *op* recém-alocado com seu tipo e referência inicial. " -"Retorna o objeto inicializado. Se o *type* indica que o objeto participa no " -"detector de lixo cíclico ele é adicionado ao grupo do detector de objetos " -"observados. Outros campos do objeto não são afetados." +"Retorna o objeto inicializado. Outros campos do objeto não são afetados." -#: ../../c-api/allocation.rst:26 +#: ../../c-api/allocation.rst:24 msgid "" "This does everything :c:func:`PyObject_Init` does, and also initializes the " "length information for a variable-size object." @@ -50,23 +46,33 @@ msgstr "" "Isto faz tudo que o :c:func:`PyObject_Init` faz e também inicializa a " "informação de comprimento para um objeto de tamanho variável." -#: ../../c-api/allocation.rst:32 +#: ../../c-api/allocation.rst:30 msgid "" "Allocate a new Python object using the C structure type *TYPE* and the " "Python type object *typeobj* (``PyTypeObject*``). Fields not defined by the " "Python object header are not initialized. The caller will own the only " "reference to the object (i.e. its 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." +"the memory allocation is determined from " +"the :c:member:`~PyTypeObject.tp_basicsize` field of the type object." msgstr "" "Aloca um novo objeto Python usando o tipo de estrutura do C *TYPE* e o " "objeto Python do tipo *typeobj* (``PyTypeObject*``). Campos não definidos " "pelo cabeçalho do objeto Python não são inicializados. O chamador será dono " "da apenas a referência ao objeto (isto é, sua contagem de referências será " -"uma). O tamanho da alocação de memória é determinado do campo :c:member:" -"`~PyTypeObject.tp_basicsize` do objeto tipo." +"uma). O tamanho da alocação de memória é determinado do " +"campo :c:member:`~PyTypeObject.tp_basicsize` do objeto tipo." + +#: ../../c-api/allocation.rst:38 +msgid "" +"Note that this function is unsuitable if *typeobj* " +"has :c:macro:`Py_TPFLAGS_HAVE_GC` set. For such objects, " +"use :c:func:`PyObject_GC_New` instead." +msgstr "" +"Note que esta função não é adequada se *typeobj* " +"tiver :c:macro:`Py_TPFLAGS_HAVE_GC` definido. Para tais objetos, " +"use :c:func:`PyObject_GC_New` em vez disso." -#: ../../c-api/allocation.rst:43 +#: ../../c-api/allocation.rst:45 msgid "" "Allocate a new Python object using the C structure type *TYPE* and the " "Python type object *typeobj* (``PyTypeObject*``). Fields not defined by the " @@ -88,21 +94,17 @@ msgstr "" "campos dentro da mesma alocação diminuindo o numero de alocações, melhorando " "a eficiência do gerenciamento de memória." -#: ../../c-api/allocation.rst:57 +#: ../../c-api/allocation.rst:56 msgid "" -"Releases memory allocated to an object using :c:macro:`PyObject_New` or :c:" -"macro:`PyObject_NewVar`. This is normally called from the :c:member:" -"`~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." +"Note that this function is unsuitable if *typeobj* " +"has :c:macro:`Py_TPFLAGS_HAVE_GC` set. For such objects, " +"use :c:func:`PyObject_GC_NewVar` instead." msgstr "" -"Libera memória alocada a um objeto usando :c:macro:`PyObject_New` ou :c:" -"macro:`PyObject_NewVar`. Isto é normalmente chamado pelo manipulador de :c:" -"member:`~PyTypeObject.tp_dealloc` especificado no tipo do objeto. Os campos " -"do objeto não devem ser acessados após esta chamada como a memória não é " -"mais um objeto Python válido." +"Note que esta função não é adequada se *typeobj* " +"tiver :c:macro:`Py_TPFLAGS_HAVE_GC` definido. Para tais objetos, " +"use :c:func:`PyObject_GC_NewVar` em vez disso." -#: ../../c-api/allocation.rst:66 +#: ../../c-api/allocation.rst:63 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 " @@ -112,10 +114,59 @@ msgstr "" "usando a macro :c:macro:`Py_None`, o qual avalia como um ponteiro para este " "objeto." -#: ../../c-api/allocation.rst:73 -msgid ":c:func:`PyModule_Create`" -msgstr ":c:func:`PyModule_Create`" +#: ../../c-api/allocation.rst:70 +msgid ":ref:`moduleobjects`" +msgstr ":ref:`moduleobjects`" -#: ../../c-api/allocation.rst:74 +#: ../../c-api/allocation.rst:71 msgid "To allocate and create extension modules." msgstr "Para alocar e criar módulos de extensão." + +#: ../../c-api/allocation.rst:75 +msgid "Soft-deprecated aliases" +msgstr "Apelidos suavemente descontinuados" + +#: ../../c-api/allocation.rst:79 +msgid "" +"These are aliases to existing functions and macros. They exist solely for " +"backwards compatibility." +msgstr "" +"Esses são apelidos para funções e macros existentes. Eles existem unicamente " +"para fins de retrocompatibilidade." + +#: ../../c-api/allocation.rst:87 +msgid "Soft-deprecated alias" +msgstr "Apelido suavemente descontinuado" + +#: ../../c-api/allocation.rst:88 +msgid "Function" +msgstr "Função" + +#: ../../c-api/allocation.rst:90 +msgid ":c:macro:`PyObject_New`" +msgstr ":c:macro:`PyObject_New`" + +#: ../../c-api/allocation.rst:92 +msgid ":c:macro:`PyObject_NewVar`" +msgstr ":c:macro:`PyObject_NewVar`" + +#: ../../c-api/allocation.rst:94 +msgid ":c:func:`PyObject_Init`" +msgstr ":c:func:`PyObject_Init`" + +#: ../../c-api/allocation.rst:96 +msgid ":c:func:`PyObject_InitVar`" +msgstr ":c:func:`PyObject_InitVar`" + +#: ../../c-api/allocation.rst:98 +msgid ":c:func:`PyObject_Malloc`" +msgstr ":c:func:`PyObject_Malloc`" + +#: ../../c-api/allocation.rst:100 +msgid ":c:func:`PyObject_Realloc`" +msgstr ":c:func:`PyObject_Realloc`" + +#: ../../c-api/allocation.rst:102 ../../c-api/allocation.rst:104 +#: ../../c-api/allocation.rst:106 +msgid ":c:func:`PyObject_Free`" +msgstr ":c:func:`PyObject_Free`" diff --git a/c-api/apiabiversion.po b/c-api/apiabiversion.po index 49af33910..7babcba18 100644 --- a/c-api/apiabiversion.po +++ b/c-api/apiabiversion.po @@ -1,28 +1,25 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Welington Carlos , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Felipefpl, 2021 -# Rafael Fontenelle , 2023 +# python-doc bot, 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-24 14:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2025-09-15 15:19+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: python-doc bot, 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/arg.po b/c-api/arg.po index d34800172..a285c4dde 100644 --- a/c-api/arg.po +++ b/c-api/arg.po @@ -1,35 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Hildeberto Abreu Magalhães , 2021 -# Welington Carlos , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Adson Rodrigues , 2021 -# Rafael Marques , 2021 -# Caio Carvalho , 2021 -# Welliton Malta , 2023 -# Julia Rizza , 2023 -# Italo Penaforte , 2024 -# Adorilson Bezerra , 2024 -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 +# Rafael Fontenelle , 2026 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-29 04:06+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-17 18:27+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2026\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -39,26 +30,27 @@ msgstr "Análise de argumentos e construção de valores" #: ../../c-api/arg.rst:8 msgid "" -"These functions are useful when creating your own extensions functions and " -"methods. Additional information and examples are available in :ref:" -"`extending-index`." +"These functions are useful when creating your own extension functions and " +"methods. Additional information and examples are available " +"in :ref:`extending-index`." msgstr "" -"Essas funções são úteis ao criar funções e métodos das suas extensões. " -"Informações adicionais e exemplos estão disponíveis em :ref:`extending-" -"index`." +"Essas funções são úteis ao criar suas próprias funções e métodos de " +"extensão. Informações adicionais e exemplos estão disponíveis " +"em :ref:`extending-index`." #: ../../c-api/arg.rst:12 msgid "" -"The first three of these functions described, :c:func:`PyArg_ParseTuple`, :c:" -"func:`PyArg_ParseTupleAndKeywords`, and :c:func:`PyArg_Parse`, all use " -"*format strings* which are used to tell the function about the expected " -"arguments. The format strings use the same syntax for each of these " -"functions." +"The first three of these functions " +"described, :c:func:`PyArg_ParseTuple`, :c:func:`PyArg_ParseTupleAndKeywords`, " +"and :c:func:`PyArg_Parse`, all use *format strings* which are used to tell " +"the function about the expected arguments. The format strings use the same " +"syntax for each of these functions." msgstr "" -"As três primeiras funções descritas, :c:func:`PyArg_ParseTuple`, :c:func:" -"`PyArg_ParseTupleAndKeywords`, e :c:func:`PyArg_Parse`, todas usam a *string " -"de formatação* que informam à função sobre os argumentos esperados. As " -"strings de formato usam a mesma sintaxe para cada uma dessas funções." +"As três primeiras funções " +"descritas, :c:func:`PyArg_ParseTuple`, :c:func:`PyArg_ParseTupleAndKeywords`, " +"e :c:func:`PyArg_Parse`, todas usam a *string de formatação* que informam à " +"função sobre os argumentos esperados. As strings de formato usam a mesma " +"sintaxe para cada uma dessas funções." #: ../../c-api/arg.rst:19 msgid "Parsing arguments" @@ -129,13 +121,13 @@ msgid "" "call** :c:func:`PyBuffer_Release` after you have finished processing the " "data (or in any early abort case)." msgstr "" -"Formatos como ``y*`` e ``s*`` estão dentro de uma estrutura :c:type:" -"`Py_buffer`. Isso bloqueia o buffer subjacente para que o chamador possa " -"posteriormente usar o buffer, mesmo dentro de um bloco :c:type:" -"`Py_BEGIN_ALLOW_THREADS` sem que haja o risco de que dados mutáveis sejam " -"redimensionados ou destruídos. Dessa forma, **você precisa chamar** :c:func:" -"`PyBuffer_Release` depois de ter concluído o processamento de dados (ou em " -"qualquer caso de interrupção precoce)." +"Formatos como ``y*`` e ``s*`` estão dentro de uma " +"estrutura :c:type:`Py_buffer`. Isso bloqueia o buffer subjacente para que " +"o chamador possa posteriormente usar o buffer, mesmo dentro de um " +"bloco :c:type:`Py_BEGIN_ALLOW_THREADS` sem que haja o risco de que dados " +"mutáveis sejam redimensionados ou destruídos. Dessa forma, **você precisa " +"chamar** :c:func:`PyBuffer_Release` depois de ter concluído o processamento " +"de dados (ou em qualquer caso de interrupção precoce)." #: ../../c-api/arg.rst:57 msgid "" @@ -155,7 +147,7 @@ msgid "" "corresponding Python object, and shares the lifetime of this object. You " "won't have to release any memory yourself." msgstr "" -"Outros formatos usam um :class:`str` ou um :term:`objeto byte ou similar` " +"Outros formatos usam um :class:`str` ou um :term:`objeto bytes ou similar` " "somente leitura, como :class:`bytes`, e fornecem um ponteiro ``const char " "*`` para seu buffer. Nesse caso, o buffer é \"emprestado\": ele é gerenciado " "pelo objeto Python correspondente e compartilha o tempo de vida desse " @@ -163,16 +155,16 @@ msgstr "" #: ../../c-api/arg.rst:70 msgid "" -"To ensure that the underlying buffer may be safely borrowed, the object's :c:" -"member:`PyBufferProcs.bf_releasebuffer` field must be ``NULL``. This " -"disallows common mutable objects such as :class:`bytearray`, but also some " -"read-only objects such as :class:`memoryview` of :class:`bytes`." +"To ensure that the underlying buffer may be safely borrowed, the " +"object's :c:member:`PyBufferProcs.bf_releasebuffer` field must be ``NULL``. " +"This disallows common mutable objects such as :class:`bytearray`, but also " +"some read-only objects such as :class:`memoryview` of :class:`bytes`." msgstr "" "Para garantir que o buffer subjacente possa ser emprestado com segurança, o " "campo :c:member:`PyBufferProcs.bf_releasebuffer` do objeto deve ser " "``NULL``. Isso não permite objetos mutáveis comuns, como :class:`bytearray`, " -"mas também alguns objetos somente leitura, como :class:`memoryview` ou :" -"class:`bytes`." +"mas também alguns objetos somente leitura, como :class:`memoryview` " +"ou :class:`bytes`." #: ../../c-api/arg.rst:76 msgid "" @@ -209,13 +201,13 @@ msgstr "" msgid "" "This format does not accept :term:`bytes-like objects `. " "If you want to accept filesystem paths and convert them to C character " -"strings, it is preferable to use the ``O&`` format with :c:func:" -"`PyUnicode_FSConverter` as *converter*." +"strings, it is preferable to use the ``O&`` format " +"with :c:func:`PyUnicode_FSConverter` as *converter*." msgstr "" -"Esse formato não aceita :term:`objetos byte ou similar `. " -"Se você quer aceitar caminhos de arquivos do sistema e convertê-los para " -"strings em C, é preferível que use o formato ``O&`` com :c:func:" -"`PyUnicode_FSConverter` como *conversor*." +"Esse formato não aceita :term:`objetos bytes ou similares `. Se você quer aceitar caminhos de sistema de arquivos e convertê-" +"los para strings de caracteres em C, é preferível que use o formato ``O&`` " +"com :c:func:`PyUnicode_FSConverter` como *conversor*." #: ../../c-api/arg.rst:96 msgid "" @@ -227,9 +219,7 @@ msgstr "" #: ../../c-api/arg.rst:100 msgid "``s*`` (:class:`str` or :term:`bytes-like object`) [Py_buffer]" -msgstr "" -"``s*`` (:class:`str` ou :term:`objeto byte ou similar `) " -"[Py_buffer]" +msgstr "``s*`` (:class:`str` ou :term:`objeto bytes ou similar`) [Py_buffer]" #: ../../c-api/arg.rst:101 msgid "" @@ -238,17 +228,17 @@ msgid "" "resulting C string may contain embedded NUL bytes. Unicode objects are " "converted to C strings using ``'utf-8'`` encoding." msgstr "" -"Esse formato aceita tanto objetos Unicode quanto objetos byte ou similar. " +"Esse formato aceita tanto objetos Unicode quanto objetos bytes ou similares. " "Preenche uma estrutura :c:type:`Py_buffer` fornecida pelo chamador. Nesse " "caso, a string em C resultante pode conter bytes NUL embutidos. Objetos " "Unicode são convertidos para strings em C usando codificação ``'utf-8'``." #: ../../c-api/arg.rst:106 msgid "" -"``s#`` (:class:`str`, read-only :term:`bytes-like object`) [const char \\*, :" -"c:type:`Py_ssize_t`]" +"``s#`` (:class:`str`, read-only :term:`bytes-like object`) [const char " +"\\*, :c:type:`Py_ssize_t`]" msgstr "" -"``s#`` (:class:`str`, :term:`objeto byte ou similar ` " +"``s#`` (:class:`str`, :term:`objeto bytes ou similar ` " "somente leitura) [const char \\*, :c:type:`Py_ssize_t`]" #: ../../c-api/arg.rst:107 @@ -265,7 +255,7 @@ msgstr "" "pode conter bytes nulos embutidos. Objetos Unicode são convertidos para " "strings em C usando codificação ``'utf-8'``." -#: ../../c-api/arg.rst:113 ../../c-api/arg.rst:581 +#: ../../c-api/arg.rst:113 ../../c-api/arg.rst:598 msgid "``z`` (:class:`str` or ``None``) [const char \\*]" msgstr "``z`` (:class:`str` ou ``None``) [const char \\*]" @@ -274,45 +264,44 @@ msgid "" "Like ``s``, but the Python object may also be ``None``, in which case the C " "pointer is set to ``NULL``." msgstr "" -"Como ``s``, mas o objeto Python também pode ser ``None``, nesse caso o " +"Como ``s``, mas o objeto Python também pode ser ``None``, caso em que o " "ponteiro C é definido como ``NULL``." #: ../../c-api/arg.rst:117 msgid "" "``z*`` (:class:`str`, :term:`bytes-like object` or ``None``) [Py_buffer]" msgstr "" -"``z*`` (:class:`str`, :term:`objeto byte ou similar ` ou " -"``None``) [Py_buffer]" +"``z*`` (:class:`str`, :term:`objeto bytes ou similar` ou ``None``) " +"[Py_buffer]" #: ../../c-api/arg.rst:118 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``." msgstr "" -"Como ``s*``, mas o objeto Python também pode ser ``None``, nesse caso o " -"membro ``buf`` da estrutura :c:type:`Py_buffer` é definido como ``NULL``." +"Como ``s*``, mas o objeto Python também pode ser ``None``, caso em que o " +"membro ``buf`` da estrutura :c:type:`Py_buffer` é definida como ``NULL``." #: ../../c-api/arg.rst:121 msgid "" "``z#`` (:class:`str`, read-only :term:`bytes-like object` or ``None``) " "[const char \\*, :c:type:`Py_ssize_t`]" msgstr "" -"``z#`` (:class:`str`, :term:`objeto byte ou similar ` " -"somente leitura ou ``None``) [const char \\*, :c:type:`Py_ssize_t`]" +"``z#`` (:class:`str`, :term:`objeto bytes ou similar` somente leitura ou " +"``None``) [const char \\*, :c:type:`Py_ssize_t`]" #: ../../c-api/arg.rst:122 msgid "" "Like ``s#``, but the Python object may also be ``None``, in which case the C " "pointer is set to ``NULL``." msgstr "" -"Como ``s#``, mas o objeto Python também pode ser ``None``, nesse caso o " +"Como ``s#``, mas o objeto Python também pode ser ``None``, caso em que o " "ponteiro C é definido como ``NULL``." #: ../../c-api/arg.rst:125 msgid "``y`` (read-only :term:`bytes-like object`) [const char \\*]" msgstr "" -"``y`` (:term:`objeto byte ou similar ` somente leitura) " -"[const char \\*]" +"``y`` (:term:`objeto bytes ou similar` somente leitura) [const char \\*]" #: ../../c-api/arg.rst:126 msgid "" @@ -321,7 +310,7 @@ msgid "" "objects. The bytes buffer must not contain embedded null bytes; if it does, " "a :exc:`ValueError` exception is raised." msgstr "" -"Este formato converte um objeto byte ou similar para um ponteiro C para uma " +"Este formato converte um objeto bytes ou similar para um ponteiro C para uma " "string de caracteres :ref:`emprestada `; não aceita " "objetos Unicode. O buffer de bytes não pode conter bytes nulos embutidos; se " "isso ocorrer uma exceção :exc:`ValueError` será levantada." @@ -336,32 +325,31 @@ msgstr "" #: ../../c-api/arg.rst:136 msgid "``y*`` (:term:`bytes-like object`) [Py_buffer]" -msgstr "" -"``y*`` (:term:`objeto byte ou similar `) [Py_buffer]" +msgstr "``y*`` (:term:`objeto bytes ou similar`) [Py_buffer]" #: ../../c-api/arg.rst:137 msgid "" "This variant on ``s*`` doesn't accept Unicode objects, only bytes-like " "objects. **This is the recommended way to accept binary data.**" msgstr "" -"Esta variante em ``s*`` não aceita objetos unicode, apenas objetos byte ou " -"similar. **Esta é a maneira recomendada para aceitar dados binários.**" +"Esta variante em ``s*`` não aceita objetos unicode, apenas objetos bytes ou " +"similares. **Esta é a maneira recomendada para aceitar dados binários.**" #: ../../c-api/arg.rst:141 msgid "" -"``y#`` (read-only :term:`bytes-like object`) [const char \\*, :c:type:" -"`Py_ssize_t`]" +"``y#`` (read-only :term:`bytes-like object`) [const char " +"\\*, :c:type:`Py_ssize_t`]" msgstr "" -"``y#`` (:term:`objeto byte ou similar ` somente leitura) " -"[const char \\*, :c:type:`Py_ssize_t`]" +"``y#`` (:term:`objeto bytes ou similar` somente leitura) [const char " +"\\*, :c:type:`Py_ssize_t`]" #: ../../c-api/arg.rst:142 msgid "" "This variant on ``s#`` doesn't accept Unicode objects, only bytes-like " "objects." msgstr "" -"Esta variação de ``s#`` não aceita objetos Unicode, apenas objetos byte ou " -"similar." +"Esta variação de ``s#`` não aceita objetos Unicode, apenas objetos bytes ou " +"similares." #: ../../c-api/arg.rst:145 msgid "``S`` (:class:`bytes`) [PyBytesObject \\*]" @@ -384,14 +372,14 @@ msgstr "``Y`` (:class:`bytearray`) [PyByteArrayObject \\*]" #: ../../c-api/arg.rst:151 msgid "" "Requires that the Python object is a :class:`bytearray` object, without " -"attempting any conversion. Raises :exc:`TypeError` if the object is not a :" -"class:`bytearray` object. The C variable may also be declared as :c:expr:" -"`PyObject*`." +"attempting any conversion. Raises :exc:`TypeError` if the object is not " +"a :class:`bytearray` object. The C variable may also be declared " +"as :c:expr:`PyObject*`." msgstr "" "Exige que o objeto Python seja um objeto :class:`bytearray`, sem aceitar " -"qualquer conversão. Levanta :exc:`TypeError` se o objeto não é um objeto :" -"class:`bytearray`. A variável C apenas pode ser declarada como :c:expr:" -"`PyObject*`." +"qualquer conversão. Levanta :exc:`TypeError` se o objeto não é um " +"objeto :class:`bytearray`. A variável C apenas pode ser declarada " +"como :c:expr:`PyObject*`." #: ../../c-api/arg.rst:155 msgid "``U`` (:class:`str`) [PyObject \\*]" @@ -410,15 +398,14 @@ msgstr "" #: ../../c-api/arg.rst:160 msgid "``w*`` (read-write :term:`bytes-like object`) [Py_buffer]" msgstr "" -"``w*`` (:term:`objeto byte ou similar ` de leitura e " -"escrita) [Py_buffer]" +"``w*`` (:term:`objeto bytes ou similar` de leitura e escrita) [Py_buffer]" #: ../../c-api/arg.rst:161 msgid "" "This format accepts any object which implements the read-write buffer " "interface. It fills a :c:type:`Py_buffer` structure provided by the caller. " -"The buffer may contain embedded null bytes. The caller have to call :c:func:" -"`PyBuffer_Release` when it is done with the buffer." +"The buffer may contain embedded null bytes. The caller has to " +"call :c:func:`PyBuffer_Release` when it is done with the buffer." msgstr "" "Este formato aceita qualquer objeto que implemente a interface do buffer de " "leitura e escrita. Ele preenche uma estrutura :c:type:`Py_buffer` fornecida " @@ -461,13 +448,13 @@ msgstr "" msgid "" ":c:func:`PyArg_ParseTuple` will allocate a buffer of the needed size, copy " "the encoded data into this buffer and adjust *\\*buffer* to reference the " -"newly allocated storage. The caller is responsible for calling :c:func:" -"`PyMem_Free` to free the allocated buffer after use." +"newly allocated storage. The caller is responsible for " +"calling :c:func:`PyMem_Free` to free the allocated buffer after use." msgstr "" ":c:func:`PyArg_ParseTuple` alocará um buffer do tamanho necessário, copiará " "os dados codificados nesse buffer e ajustará *\\*buffer* para referenciar o " -"armazenamento recém-alocado. O chamador é responsável por chamar :c:func:" -"`PyMem_Free` para liberar o buffer alocado após o uso." +"armazenamento recém-alocado. O chamador é responsável por " +"chamar :c:func:`PyMem_Free` para liberar o buffer alocado após o uso." #: ../../c-api/arg.rst:183 msgid "" @@ -483,17 +470,17 @@ msgid "" "recoding them. Instead, the implementation assumes that the byte string " "object uses the encoding passed in as parameter." msgstr "" -"O mesmo que ``es``, exceto que os objetos strings de bytes são passados ​​sem " +"O mesmo que ``es``, exceto que os objetos strings de bytes são passados sem " "os recodificar. Em vez disso, a implementação presume que o objeto string de " "bytes usa a codificação passada como parâmetro." #: ../../c-api/arg.rst:188 msgid "" -"``es#`` (:class:`str`) [const char \\*encoding, char \\*\\*buffer, :c:type:" -"`Py_ssize_t` \\*buffer_length]" +"``es#`` (:class:`str`) [const char \\*encoding, char " +"\\*\\*buffer, :c:type:`Py_ssize_t` \\*buffer_length]" msgstr "" -"``es#`` (:class:`str`) [const char \\*encoding, char \\*\\*buffer, :c:type:" -"`Py_ssize_t` \\*buffer_length]" +"``es#`` (:class:`str`) [const char \\*encoding, char " +"\\*\\*buffer, :c:type:`Py_ssize_t` \\*buffer_length]" #: ../../c-api/arg.rst:189 msgid "" @@ -517,8 +504,8 @@ msgid "" "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 "" -"Exige três argumentos. O primeiro é usado apenas como entrada e deve ser a :" -"c:expr:`const char*` que aponta para o nome de uma codificação como uma " +"Exige três argumentos. O primeiro é usado apenas como entrada e deve ser " +"a :c:expr:`const char*` que aponta para o nome de uma codificação como uma " "string terminada em NUL ou ``NULL``, nesse caso a codificação ``'utf-8'`` é " "usada. Uma exceção será gerada se a codificação nomeada não for conhecida " "pelo Python. O segundo argumento deve ser um :c:expr:`char**`; o valor do " @@ -558,8 +545,8 @@ msgstr "" "alocado), :c:func:`PyArg_ParseTuple` irá usar essa localização como buffer e " "interpretar o valor inicial de *\\*buffer_length* como sendo o tamanho do " "buffer. Depois ela vai copiar os dados codificados para dentro do buffer e " -"terminá-lo com NUL. Se o buffer não for suficientemente grande, um :exc:" -"`ValueError` será definido." +"terminá-lo com NUL. Se o buffer não for suficientemente grande, " +"um :exc:`ValueError` será definido." #: ../../c-api/arg.rst:216 msgid "" @@ -583,7 +570,7 @@ msgid "" "recoding them. Instead, the implementation assumes that the byte string " "object uses the encoding passed in as parameter." msgstr "" -"O mesmo que ``es#``, exceto que os objetos strings de bytes são passados ​​sem " +"O mesmo que ``es#``, exceto que os objetos strings de bytes são passados sem " "que sejam recodificados. Em vez disso, a implementação presume que o objeto " "string de bytes usa a codificação passada como parâmetro." @@ -600,42 +587,71 @@ msgid "Numbers" msgstr "Números" #: ../../c-api/arg.rst:232 +msgid "" +"These formats allow representing Python numbers or single characters as C " +"numbers. Formats that require :class:`int`, :class:`float` " +"or :class:`complex` can also use the corresponding special " +"methods :meth:`~object.__index__`, :meth:`~object.__float__` " +"or :meth:`~object.__complex__` to convert the Python object to the required " +"type." +msgstr "" +"Esses formatos permitem representar números Python ou caracteres únicos como " +"números C. Formatos que exigem :class:`int`, :class:`float` " +"ou :class:`complex` também podem usar os métodos especiais " +"correspondentes :meth:`~object.__index__`, :meth:`~object.__float__` " +"ou :meth:`~object.__complex__` para converter o objeto Python para o tipo " +"necessário." + +#: ../../c-api/arg.rst:238 +msgid "" +"For signed integer formats, :exc:`OverflowError` is raised if the value is " +"out of range for the C type. For unsigned integer formats, no range checking " +"is done --- the most significant bits are silently truncated when the " +"receiving field is too small to receive the value." +msgstr "" +"Para formatos inteiros com sinal, :exc:`OverflowError` é levantada se o " +"valor estiver fora do intervalo para o tipo C. Para formatos inteiros não " +"assinados, nenhuma verificação de intervalo é feita --- os bits mais " +"significativos são silenciosamente truncados quando o campo de recebimento é " +"muito pequeno para receber o valor." + +#: ../../c-api/arg.rst:244 msgid "``b`` (:class:`int`) [unsigned char]" msgstr "``b`` (:class:`int`) [unsigned char]" -#: ../../c-api/arg.rst:233 +#: ../../c-api/arg.rst:245 msgid "" -"Convert a nonnegative Python integer to an unsigned tiny int, stored in a C :" -"c:expr:`unsigned char`." +"Convert a nonnegative Python integer to an unsigned tiny integer, stored in " +"a C :c:expr:`unsigned char`." msgstr "" "Converte um inteiro Python não negativo em um inteiro pequeno sem sinal " -"(unsigned tiny int), armazenado em um :c:expr:`unsigned char` do C." +"(unsigned tiny integer), armazenado em um :c:expr:`unsigned char` do C." -#: ../../c-api/arg.rst:236 ../../c-api/arg.rst:615 +#: ../../c-api/arg.rst:248 ../../c-api/arg.rst:632 msgid "``B`` (:class:`int`) [unsigned char]" msgstr "``B`` (:class:`int`) [unsigned char]" -#: ../../c-api/arg.rst:237 +#: ../../c-api/arg.rst:249 msgid "" -"Convert a Python integer to a tiny int without overflow checking, stored in " -"a C :c:expr:`unsigned char`." +"Convert a Python integer to a tiny integer without overflow checking, stored " +"in a C :c:expr:`unsigned char`." msgstr "" -"Converte um inteiro Python para um inteiro pequeno (tiny int) sem " +"Converte um inteiro Python para um inteiro pequeno (tiny integer) sem " "verificação de estouro, armazenado em um :c:expr:`unsigned char` do C." -#: ../../c-api/arg.rst:240 ../../c-api/arg.rst:609 +#: ../../c-api/arg.rst:252 ../../c-api/arg.rst:626 msgid "``h`` (:class:`int`) [short int]" msgstr "``h`` (:class:`int`) [short int]" -#: ../../c-api/arg.rst:241 +#: ../../c-api/arg.rst:253 msgid "Convert a Python integer to a C :c:expr:`short int`." msgstr "Converte um inteiro Python para um :c:expr:`short int` do C." -#: ../../c-api/arg.rst:243 ../../c-api/arg.rst:618 +#: ../../c-api/arg.rst:255 ../../c-api/arg.rst:635 msgid "``H`` (:class:`int`) [unsigned short int]" msgstr "``H`` (:class:`int`) [unsigned short int]" -#: ../../c-api/arg.rst:244 +#: ../../c-api/arg.rst:256 msgid "" "Convert a Python integer to a C :c:expr:`unsigned short int`, without " "overflow checking." @@ -643,19 +659,19 @@ msgstr "" "Converte um inteiro Python para um :c:expr:`unsigned short int` do C, sem " "verificação de estouro." -#: ../../c-api/arg.rst:247 ../../c-api/arg.rst:603 +#: ../../c-api/arg.rst:259 ../../c-api/arg.rst:620 msgid "``i`` (:class:`int`) [int]" msgstr "``i`` (:class:`int`) [int]" -#: ../../c-api/arg.rst:248 +#: ../../c-api/arg.rst:260 msgid "Convert a Python integer to a plain C :c:expr:`int`." msgstr "Converte um inteiro Python para um :c:expr:`int` simples do C." -#: ../../c-api/arg.rst:250 ../../c-api/arg.rst:621 +#: ../../c-api/arg.rst:262 ../../c-api/arg.rst:638 msgid "``I`` (:class:`int`) [unsigned int]" msgstr "``I`` (:class:`int`) [unsigned int]" -#: ../../c-api/arg.rst:251 +#: ../../c-api/arg.rst:263 msgid "" "Convert a Python integer to a C :c:expr:`unsigned int`, without overflow " "checking." @@ -663,19 +679,19 @@ msgstr "" "Converte um inteiro Python para um :c:expr:`unsigned int` do C, sem " "verificação de estouro." -#: ../../c-api/arg.rst:254 ../../c-api/arg.rst:612 +#: ../../c-api/arg.rst:266 ../../c-api/arg.rst:629 msgid "``l`` (:class:`int`) [long int]" msgstr "``l`` (:class:`int`) [long int]" -#: ../../c-api/arg.rst:255 +#: ../../c-api/arg.rst:267 msgid "Convert a Python integer to a C :c:expr:`long int`." msgstr "Converte um inteiro Python para um :c:expr:`long int` do C." -#: ../../c-api/arg.rst:257 ../../c-api/arg.rst:624 +#: ../../c-api/arg.rst:269 ../../c-api/arg.rst:641 msgid "``k`` (:class:`int`) [unsigned long]" msgstr "``k`` (:class:`int`) [unsigned long]" -#: ../../c-api/arg.rst:258 +#: ../../c-api/arg.rst:270 msgid "" "Convert a Python integer to a C :c:expr:`unsigned long` without overflow " "checking." @@ -683,19 +699,19 @@ msgstr "" "Converte um inteiro Python para um :c:expr:`unsigned long` do C sem " "verificação de estouro." -#: ../../c-api/arg.rst:261 ../../c-api/arg.rst:627 +#: ../../c-api/arg.rst:273 ../../c-api/arg.rst:644 msgid "``L`` (:class:`int`) [long long]" msgstr "``L`` (:class:`int`) [longo longo]" -#: ../../c-api/arg.rst:262 +#: ../../c-api/arg.rst:274 msgid "Convert a Python integer to a C :c:expr:`long long`." msgstr "Converte um inteiro Python para um :c:expr:`long long` do C." -#: ../../c-api/arg.rst:264 ../../c-api/arg.rst:630 +#: ../../c-api/arg.rst:276 ../../c-api/arg.rst:649 msgid "``K`` (:class:`int`) [unsigned long long]" msgstr "``K`` (:class:`int`) [unsigned long long]" -#: ../../c-api/arg.rst:265 +#: ../../c-api/arg.rst:277 msgid "" "Convert a Python integer to a C :c:expr:`unsigned long long` without " "overflow checking." @@ -703,35 +719,35 @@ msgstr "" "Converte um inteiro Python para um :c:expr:`unsigned long long` do C sem " "verificação de estouro." -#: ../../c-api/arg.rst:268 ../../c-api/arg.rst:633 +#: ../../c-api/arg.rst:280 ../../c-api/arg.rst:652 msgid "``n`` (:class:`int`) [:c:type:`Py_ssize_t`]" msgstr "``n`` (:class:`int`) [:c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:269 +#: ../../c-api/arg.rst:281 msgid "Convert a Python integer to a C :c:type:`Py_ssize_t`." msgstr "Converte um inteiro Python para um :c:type:`Py_ssize_t` do C." -#: ../../c-api/arg.rst:271 +#: ../../c-api/arg.rst:283 msgid "``c`` (:class:`bytes` or :class:`bytearray` of length 1) [char]" msgstr "``c`` (:class:`bytes` ou :class:`bytearray` de comprimento 1) [char]" -#: ../../c-api/arg.rst:272 +#: ../../c-api/arg.rst:284 msgid "" "Convert a Python byte, represented as a :class:`bytes` or :class:`bytearray` " "object of length 1, to a C :c:expr:`char`." msgstr "" -"Converte um byte Python, representado com um objeto :class:`byte` ou :class:" -"`bytearray` de comprimento 1, para um :c:expr:`char` do C." +"Converte um byte Python, representado com um objeto :class:`bytes` " +"ou :class:`bytearray` de comprimento 1, para um :c:expr:`char` do C." -#: ../../c-api/arg.rst:275 +#: ../../c-api/arg.rst:287 msgid "Allow :class:`bytearray` objects." msgstr "Permite objetos :class:`bytearray`." -#: ../../c-api/arg.rst:278 ../../c-api/arg.rst:640 +#: ../../c-api/arg.rst:290 ../../c-api/arg.rst:659 msgid "``C`` (:class:`str` of length 1) [int]" msgstr "``C`` (:class:`str` de comprimento 1) [int]" -#: ../../c-api/arg.rst:279 +#: ../../c-api/arg.rst:291 msgid "" "Convert a Python character, represented as a :class:`str` object of length " "1, to a C :c:expr:`int`." @@ -739,58 +755,58 @@ msgstr "" "Converte um caractere Python, representado como uma :class:`str` objeto de " "comprimento 1, para um :c:expr:`int` do C" -#: ../../c-api/arg.rst:282 ../../c-api/arg.rst:647 +#: ../../c-api/arg.rst:294 ../../c-api/arg.rst:666 msgid "``f`` (:class:`float`) [float]" msgstr "``f``` (:class:`float`) [float]" -#: ../../c-api/arg.rst:283 +#: ../../c-api/arg.rst:295 msgid "Convert a Python floating-point number to a C :c:expr:`float`." msgstr "" "Converte um número de ponto flutuante Python para um :c:expr:`float` do C." -#: ../../c-api/arg.rst:285 ../../c-api/arg.rst:644 +#: ../../c-api/arg.rst:297 ../../c-api/arg.rst:663 msgid "``d`` (:class:`float`) [double]" msgstr "``d`` (:class:`float`) [double]" -#: ../../c-api/arg.rst:286 +#: ../../c-api/arg.rst:298 msgid "Convert a Python floating-point number to a C :c:expr:`double`." msgstr "" "Converte um número de ponto flutuante Python para um :c:expr:`double` do C." -#: ../../c-api/arg.rst:288 +#: ../../c-api/arg.rst:300 msgid "``D`` (:class:`complex`) [Py_complex]" msgstr "``D`` (:class:`complex`) [Py_complex]" -#: ../../c-api/arg.rst:289 +#: ../../c-api/arg.rst:301 msgid "Convert a Python complex number to a C :c:type:`Py_complex` structure." msgstr "" "Converte um número complexo Python para uma estrutura C :c:type:`Py_complex`" -#: ../../c-api/arg.rst:292 +#: ../../c-api/arg.rst:304 msgid "Other objects" msgstr "Outros objetos" -#: ../../c-api/arg.rst:294 ../../c-api/arg.rst:653 +#: ../../c-api/arg.rst:306 ../../c-api/arg.rst:672 msgid "``O`` (object) [PyObject \\*]" msgstr "``O`` (objeto) [PyObject\\*]" -#: ../../c-api/arg.rst:295 +#: ../../c-api/arg.rst:307 msgid "" "Store a Python object (without any conversion) in a C object pointer. The C " -"program thus receives the actual object that was passed. A new :term:" -"`strong reference` to the object is not created (i.e. its reference count is " -"not increased). The pointer stored is not ``NULL``." +"program thus receives the actual object that was passed. A " +"new :term:`strong reference` to the object is not created (i.e. its " +"reference count is not increased). The pointer stored is not ``NULL``." msgstr "" "Armazena um objeto Python (sem qualquer conversão) em um ponteiro de objeto " -"C. O programa C então recebe o objeto real que foi passado. Uma nova :term:" -"`referência forte` ao objeto não é criado (isto é sua contagem de " +"C. O programa C então recebe o objeto real que foi passado. Uma " +"nova :term:`referência forte` ao objeto não é criado (isto é sua contagem de " "referências não é aumentada). O ponteiro armazenado não é ``NULL``." -#: ../../c-api/arg.rst:301 +#: ../../c-api/arg.rst:313 msgid "``O!`` (object) [*typeobject*, PyObject \\*]" msgstr "``O!`` (objeto) [*typeobject*, PyObject \\*]" -#: ../../c-api/arg.rst:302 +#: ../../c-api/arg.rst:314 msgid "" "Store a Python object in a C object pointer. This is similar to ``O``, but " "takes two C arguments: the first is the address of a Python type object, the " @@ -800,15 +816,15 @@ msgid "" msgstr "" "Armazena um objeto Python em um ponteiro de objeto C. Isso é similar a " "``O``, mas usa dois argumentos C: o primeiro é o endereço de um objeto do " -"tipo Python, o segundo é um endereço da variável C (de tipo :c:expr:" -"`PyObject*`) no qual o ponteiro do objeto está armazenado. Se o objeto " -"Python não tiver o tipo necessário, :exc:`TypeError` é levantada." +"tipo Python, o segundo é um endereço da variável C (de " +"tipo :c:expr:`PyObject*`) no qual o ponteiro do objeto está armazenado. Se o " +"objeto Python não tiver o tipo necessário, :exc:`TypeError` é levantada." -#: ../../c-api/arg.rst:310 ../../c-api/arg.rst:671 -msgid "``O&`` (object) [*converter*, *anything*]" -msgstr "``O&`` (objeto) [*converter*, *anything*]" +#: ../../c-api/arg.rst:322 +msgid "``O&`` (object) [*converter*, *address*]" +msgstr "``O&`` (objeto) [*converter*, *address*]" -#: ../../c-api/arg.rst:311 +#: ../../c-api/arg.rst:323 msgid "" "Convert a Python object to a C variable through a *converter* function. " "This takes two arguments: the first is a function, the second is the address " @@ -817,47 +833,60 @@ msgid "" msgstr "" "Converte um objeto Python em uma variável C através de uma função " "*converter*. Isso leva dois argumentos: o primeiro é a função, o segundo é o " -"endereço da variável C (de tipo arbitrário), convertendo para :c:expr:" -"`void*`. A função *converter* por sua vez, é chamada da seguinte maneira::" - -#: ../../c-api/arg.rst:318 -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 "" -"onde *object* é o objeto Python a ser convertido e *address* é o argumento :" -"c:expr:`void*` que foi passado para a função ``PyArg_Parse*``. O *status* " -"retornado deve ser ``1`` para uma conversão bem-sucedida e ``0`` se a " -"conversão falhar. Quando a conversão falha, a função *converter* deve " +"endereço da variável C (de tipo arbitrário), convertendo " +"para :c:expr:`void*`. A função *converter* por sua vez, é chamada da " +"seguinte maneira::" + +#: ../../c-api/arg.rst:328 +msgid "status = converter(object, address);" +msgstr "status = converter(object, address);" + +#: ../../c-api/arg.rst:330 +msgid "" +"where *object* is the Python object to be converted and *address* is " +"the :c:expr:`void*` argument that was passed to the ``PyArg_Parse*`` " +"function. The returned *status* should be ``1`` for a successful conversion " +"and ``0`` if the conversion has failed. When the conversion fails, the " +"*converter* function should raise an exception and leave the content of " +"*address* unmodified." +msgstr "" +"onde *object* é o objeto Python a ser convertido e *address* é o " +"argumento :c:expr:`void*` que foi passado para a função ``PyArg_Parse*``. O " +"*status* retornado deve ser ``1`` para uma conversão bem-sucedida e ``0`` se " +"a conversão falhar. Quando a conversão falha, a função *converter* deve " "levantar uma exceção e deixar o conteúdo de *address* inalterado." -#: ../../c-api/arg.rst:324 +#: ../../c-api/arg.rst:339 msgid "" -"If the *converter* returns ``Py_CLEANUP_SUPPORTED``, it may get called a " -"second time if the argument parsing eventually fails, giving the converter a " -"chance to release any memory that it had already allocated. In this second " -"call, the *object* parameter will be ``NULL``; *address* will have the same " -"value as in the original call." +"If the *converter* returns :c:macro:`!Py_CLEANUP_SUPPORTED`, it may get " +"called a second time if the argument parsing eventually fails, giving the " +"converter a chance to release any memory that it had already allocated. In " +"this second call, the *object* parameter will be ``NULL``; *address* will " +"have the same value as in the original call." msgstr "" -"Se o *converter* retornar ``Py_CLEANUP_SUPPORTED``, ele poderá ser chamado " -"uma segunda vez se a análise do argumento eventualmente falhar, dando ao " -"conversor a chance de liberar qualquer memória que já havia alocado. Nesta " -"segunda chamada, o parâmetro *object* será ``NULL``; *address* terá o mesmo " -"valor que na chamada original." +"Se o *converter* retornar :c:macro:`!Py_CLEANUP_SUPPORTED`, ele poderá ser " +"chamado uma segunda vez se a análise do argumento eventualmente falhar, " +"dando ao conversor a chance de liberar qualquer memória que já havia " +"alocado. Nesta segunda chamada, o parâmetro *object* será ``NULL``; " +"*address* terá o mesmo valor que na chamada original." -#: ../../c-api/arg.rst:330 -msgid "``Py_CLEANUP_SUPPORTED`` was added." -msgstr "109 ``Py_CLEANUP_SUPPORTED`` foi adicionado." +#: ../../c-api/arg.rst:345 +msgid "" +"Examples of converters: :c:func:`PyUnicode_FSConverter` " +"and :c:func:`PyUnicode_FSDecoder`." +msgstr "" +"Exemplos de conversores: :c:func:`PyUnicode_FSConverter` " +"e :c:func:`PyUnicode_FSDecoder`." + +#: ../../c-api/arg.rst:348 +msgid ":c:macro:`!Py_CLEANUP_SUPPORTED` was added." +msgstr ":c:macro:`!Py_CLEANUP_SUPPORTED` foi adicionado." -#: ../../c-api/arg.rst:333 +#: ../../c-api/arg.rst:351 msgid "``p`` (:class:`bool`) [int]" msgstr "``p`` (:class:`bool`) [int]" -#: ../../c-api/arg.rst:334 +#: ../../c-api/arg.rst:352 msgid "" "Tests the value passed in for truth (a boolean **p**\\ redicate) and " "converts the result to its equivalent C true/false integer value. Sets the " @@ -871,11 +900,11 @@ msgstr "" "Isso aceita qualquer valor válido do Python. Veja :ref:`truth` para obter " "mais informações sobre como o Python testa valores para a verdade." -#: ../../c-api/arg.rst:342 ../../c-api/arg.rst:677 +#: ../../c-api/arg.rst:360 ../../c-api/arg.rst:696 msgid "``(items)`` (:class:`tuple`) [*matching-items*]" msgstr "``(items)`` (:class:`tuple`) [*matching-items*]" -#: ../../c-api/arg.rst:343 +#: ../../c-api/arg.rst:361 msgid "" "The object must be a Python sequence whose length is the number of format " "units in *items*. The C arguments must correspond to the individual format " @@ -886,22 +915,7 @@ msgstr "" "unidades de formato individuais em *items*. As unidades de formato para " "sequências podem ser aninhadas." -#: ../../c-api/arg.rst:347 -msgid "" -"It is possible to pass \"long\" integers (integers whose value exceeds the " -"platform's :c:macro:`LONG_MAX`) however no proper range checking is done --- " -"the most significant bits are silently truncated when the receiving field is " -"too small to receive the value (actually, the semantics are inherited from " -"downcasts in C --- your mileage may vary)." -msgstr "" -"É possível passar inteiros \"long\" (inteiros em que o valor excede a " -"constante da plataforma :c:macro:`LONG_MAX`) contudo nenhuma checagem de " -"intervalo é propriamente feita -- os bits mais significativos são " -"silenciosamente truncados quando o campo de recebimento é muito pequeno para " -"receber o valor (na verdade, a semântica é herdada de downcasts no C -- seu " -"raio de ação pode variar)." - -#: ../../c-api/arg.rst:353 +#: ../../c-api/arg.rst:365 msgid "" "A few other characters have a meaning in a format string. These may not " "occur inside nested parentheses. They are:" @@ -909,46 +923,52 @@ msgstr "" "Alguns outros caracteres possuem significados na string de formatação. Isso " "pode não ocorrer dentro de parênteses aninhados. Eles são:" -#: ../../c-api/arg.rst:356 +#: ../../c-api/arg.rst:368 msgid "``|``" msgstr "``|``" -#: ../../c-api/arg.rst:357 +#: ../../c-api/arg.rst:369 msgid "" "Indicates that the remaining arguments in the Python argument list are " "optional. The C variables corresponding to optional arguments should be " "initialized to their default value --- when an optional argument is not " "specified, :c:func:`PyArg_ParseTuple` does not touch the contents of the " -"corresponding C variable(s)." +"corresponding C variable(s). For example, the format string ``\"OO|OO\"`` " +"corresponds to the Python signature ``f(a, b, c=None, d=None)``." msgstr "" "Indica que os argumentos restantes na lista de argumentos do Python são " "opcionais. As variáveis C correspondentes a argumentos opcionais devem ser " "inicializadas para seus valores padrão --- quando um argumento opcional não " "é especificado, :c:func:`PyArg_ParseTuple` não toca no conteúdo da(s) " -"variável(eis) C correspondente(s)." +"variável(eis) C correspondente(s). Por exemplo, a string de formato ``\"OO|" +"OO\"`` corresponde à assinatura Python ``f(a, b, c=None, d=None)``." -#: ../../c-api/arg.rst:363 +#: ../../c-api/arg.rst:377 msgid "``$``" msgstr "``$``" -#: ../../c-api/arg.rst:364 +#: ../../c-api/arg.rst:378 msgid "" ":c:func:`PyArg_ParseTupleAndKeywords` only: Indicates that the remaining " -"arguments in the Python argument list are keyword-only. Currently, all " -"keyword-only arguments must also be optional arguments, so ``|`` must always " -"be specified before ``$`` in the format string." -msgstr "" -":c:func:`PyArg_ParseTupleAndKeywords` apenas: Indica que os argumentos " -"restantes na lista de argumentos do Python são somente-nomeados. Atualmente, " -"todos os argumentos somente-nomeados devem ser também argumentos opcionais, " -"então ``|`` deve sempre ser especificado antes de ``$`` na string de " -"formatação." - -#: ../../c-api/arg.rst:372 +"arguments in the Python argument list are keyword-only. They are optional if " +"``|`` was specified before ``$``, and required otherwise. ``|`` cannot be " +"specified after ``$``. For example, the format string ``\"O|O$O\"`` " +"corresponds to the Python signature ``f(a, b=None, *, c=None)``, and the " +"format string ``\"OO$OO\"`` corresponds to ``f(a, b, *, c, d)``." +msgstr "" +"Apenas para :c:func:`PyArg_ParseTupleAndKeywords`: Indica que os argumentos " +"restantes na lista de argumentos do Python são argumentos somente-nomeado. " +"Eles são opcionais se ``|`` tiver sido especificado antes de ``$`` e " +"obrigatórios caso contrário. ``|`` não pode ser especificado após ``$``. Por " +"exemplo, a string de formato ``\"O|O$O\"`` corresponde à assinatura Python " +"``f(a, b=None, *, c=None)``, e a string de formato ``\"OO$OO\"`` corresponde " +"a ``f(a, b, *, c, d)``." + +#: ../../c-api/arg.rst:389 msgid "``:``" msgstr "``:``" -#: ../../c-api/arg.rst:373 +#: ../../c-api/arg.rst:390 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 " @@ -958,21 +978,21 @@ msgstr "" "usada como o nome da função nas mensagens de erro (o \"valor associado\" da " "exceção que :c:func:`PyArg_ParseTuple` levanta)." -#: ../../c-api/arg.rst:377 +#: ../../c-api/arg.rst:394 msgid "``;``" msgstr "``;``" -#: ../../c-api/arg.rst:378 +#: ../../c-api/arg.rst:395 msgid "" "The list of format units ends here; the string after the semicolon is used " -"as the error message *instead* of the default error message. ``:`` and ``;" -"`` mutually exclude each other." +"as the error message *instead* of the default error message. ``:`` and " +"``;`` mutually exclude each other." msgstr "" "A lista de unidades de formatação acaba aqui; a string após o ponto e " "vírgula é usada como a mensagem de erro *ao invés* da mensagem de erro " "padrão. ``:`` e ``;`` se excluem mutuamente." -#: ../../c-api/arg.rst:382 +#: ../../c-api/arg.rst:399 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 " @@ -982,7 +1002,7 @@ msgstr "" "chamador são referências *emprestadas*; não libera-as (isto é, não " "decremente a contagem de referências delas)!" -#: ../../c-api/arg.rst:386 +#: ../../c-api/arg.rst:403 msgid "" "Additional arguments passed to these functions must be addresses of " "variables whose type is determined by the format string; these are used to " @@ -998,7 +1018,7 @@ msgstr "" "parâmetros são usados como valores de entrada; eles devem concordar com o " "que é especificado para a unidade de formatação correspondente nesse caso." -#: ../../c-api/arg.rst:392 +#: ../../c-api/arg.rst:409 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 " @@ -1015,11 +1035,11 @@ msgstr "" "correspondentes àquela unidade e às unidades de formatação seguintes são " "deixadas intocadas." -#: ../../c-api/arg.rst:401 +#: ../../c-api/arg.rst:418 msgid "API Functions" msgstr "Funções da API" -#: ../../c-api/arg.rst:405 +#: ../../c-api/arg.rst:422 msgid "" "Parse the parameters of a function that takes only positional parameters " "into local variables. Returns true on success; on failure, it returns false " @@ -1029,7 +1049,7 @@ msgstr "" "em variáveis locais. Retorna verdadeiro em caso de sucesso; em caso de " "falha, retorna falso e levanta a exceção apropriada." -#: ../../c-api/arg.rst:412 +#: ../../c-api/arg.rst:429 msgid "" "Identical to :c:func:`PyArg_ParseTuple`, except that it accepts a va_list " "rather than a variable number of arguments." @@ -1037,7 +1057,7 @@ msgstr "" "Idêntico a :c:func:`PyArg_ParseTuple`, exceto que aceita uma va_list ao " "invés de um número variável de argumentos." -#: ../../c-api/arg.rst:418 +#: ../../c-api/arg.rst:435 msgid "" "Parse the parameters of a function that takes both positional and keyword " "parameters into local variables. The *keywords* argument is a ``NULL``-" @@ -1054,17 +1074,17 @@ msgstr "" "`. Retorna verdadeiro em caso de sucesso; em caso " "de falha, retorna falso e levanta a exceção apropriada." -#: ../../c-api/arg.rst:429 +#: ../../c-api/arg.rst:446 msgid "" -"The *keywords* parameter declaration is :c:expr:`char * const *` in C and :c:" -"expr:`const char * const *` in C++. This can be overridden with the :c:macro:" -"`PY_CXX_CONST` macro." +"The *keywords* parameter declaration is :c:expr:`char * const *` in C " +"and :c:expr:`const char * const *` in C++. This can be overridden with " +"the :c:macro:`PY_CXX_CONST` macro." msgstr "" -"A declaração do parâmetro *keywords* é :c:expr:`char * const *` em C e :c:" -"expr:`const char * const *` em C++. Isso pode ser substituído com a macro :" -"c:macro:`PY_CXX_CONST`." +"A declaração do parâmetro *keywords* é :c:expr:`char * const *` em C " +"e :c:expr:`const char * const *` em C++. Isso pode ser substituído com a " +"macro :c:macro:`PY_CXX_CONST`." -#: ../../c-api/arg.rst:433 +#: ../../c-api/arg.rst:450 msgid "" "Added support for :ref:`positional-only parameters `." @@ -1072,17 +1092,17 @@ msgstr "" "Adicionado suporte para :ref:`positional-only parameters `." -#: ../../c-api/arg.rst:437 +#: ../../c-api/arg.rst:454 msgid "" -"The *keywords* parameter has now type :c:expr:`char * const *` in C and :c:" -"expr:`const char * const *` in C++, instead of :c:expr:`char **`. Added " -"support for non-ASCII keyword parameter names." +"The *keywords* parameter has now type :c:expr:`char * const *` in C " +"and :c:expr:`const char * const *` in C++, instead of :c:expr:`char **`. " +"Added support for non-ASCII keyword parameter names." msgstr "" -"O parâmetro *keywords* é agora do tipo :c:expr:`char * const *` em C e :c:" -"expr:`const char * const *` em C++, no lugar de :c:expr:`char **`. " +"O parâmetro *keywords* é agora do tipo :c:expr:`char * const *` em C " +"e :c:expr:`const char * const *` em C++, no lugar de :c:expr:`char **`. " "Adicionado suporte para nomes de parâmetros nomeados não-ASCII." -#: ../../c-api/arg.rst:446 +#: ../../c-api/arg.rst:463 msgid "" "Identical to :c:func:`PyArg_ParseTupleAndKeywords`, except that it accepts a " "va_list rather than a variable number of arguments." @@ -1090,7 +1110,7 @@ msgstr "" "Idêntico a :c:func:`PyArg_ParseTupleAndKeywords`, exceto que aceita uma " "va_list ao invés de um número variável de argumentos." -#: ../../c-api/arg.rst:452 +#: ../../c-api/arg.rst:469 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 " @@ -1100,7 +1120,7 @@ msgstr "" "strings. Isso só é necessário se :c:func:`PyArg_ParseTupleAndKeywords` não é " "usado, já que o último já faz essa checagem." -#: ../../c-api/arg.rst:461 +#: ../../c-api/arg.rst:478 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 " @@ -1110,11 +1130,35 @@ msgstr "" "o converte em uma variável local. Retorna verdadeiro em caso de sucesso; em " "caso de falha, retorna falso e levanta a exceção apropriada." -#: ../../c-api/arg.rst:465 +#: ../../c-api/arg.rst:482 msgid "Example::" msgstr "Exemplo::" -#: ../../c-api/arg.rst:481 +#: ../../c-api/arg.rst:484 +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" +"}" +msgstr "" +"// Função usando a convenção de chamada ao método METH_O\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" +" // ... usar valor ...\n" +"}" + +#: ../../c-api/arg.rst:498 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 " @@ -1133,21 +1177,21 @@ msgid "" msgstr "" "Uma forma mais simples de recuperação de parâmetro que não usa uma string de " "formato para especificar os tipos de argumentos. Funções que usam este " -"método para recuperar seus parâmetros devem ser declaradas como :c:macro:" -"`METH_VARARGS` em tabelas de função ou método. A tupla contendo os " -"parâmetros reais deve ser passada como *args*; deve realmente ser uma tupla. " -"O comprimento da tupla deve ser de pelo menos *min* e não mais do que *max*; " -"*min* e *max* podem ser iguais. Argumentos adicionais devem ser passados " -"para a função, cada um dos quais deve ser um ponteiro para uma variável :c:" -"expr:`PyObject*`; eles serão preenchidos com os valores de *args*; eles " -"conterão :term:`referências emprestadas `. As variáveis " -"que correspondem a parâmetros opcionais não fornecidos por *args* não serão " -"preenchidas; estes devem ser inicializados pelo chamador. Esta função " -"retorna verdadeiro em caso de sucesso e falso se *args* não for uma tupla ou " -"contiver o número incorreto de elementos; uma exceção será definida se " -"houver uma falha." - -#: ../../c-api/arg.rst:496 +"método para recuperar seus parâmetros devem ser declaradas " +"como :c:macro:`METH_VARARGS` em tabelas de função ou método. A tupla " +"contendo os parâmetros reais deve ser passada como *args*; deve realmente " +"ser uma tupla. O comprimento da tupla deve ser de pelo menos *min* e não " +"mais do que *max*; *min* e *max* podem ser iguais. Argumentos adicionais " +"devem ser passados para a função, cada um dos quais deve ser um ponteiro " +"para uma variável :c:expr:`PyObject*`; eles serão preenchidos com os valores " +"de *args*; eles conterão :term:`referências emprestadas `. As variáveis que correspondem a parâmetros opcionais não " +"fornecidos por *args* não serão preenchidas; estes devem ser inicializados " +"pelo chamador. Esta função retorna verdadeiro em caso de sucesso e falso se " +"*args* não for uma tupla ou contiver o número incorreto de elementos; uma " +"exceção será definida se houver uma falha." + +#: ../../c-api/arg.rst:513 msgid "" "This is an example of the use of this function, taken from the sources for " "the :mod:`!_weakref` helper module for weak references::" @@ -1155,7 +1199,35 @@ msgstr "" "Este é um exemplo do uso dessa função, tirado das fontes do módulo auxiliar " "para referências fracas :mod:`!_weakref`::" -#: ../../c-api/arg.rst:512 +#: ../../c-api/arg.rst:516 +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 "" +"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" +"}" + +#: ../../c-api/arg.rst:529 msgid "" "The call to :c:func:`PyArg_UnpackTuple` in this example is entirely " "equivalent to this call to :c:func:`PyArg_ParseTuple`::" @@ -1163,7 +1235,11 @@ msgstr "" "A chamada à :c:func:`PyArg_UnpackTuple` neste exemplo é inteiramente " "equivalente à chamada para :c:func:`PyArg_ParseTuple`::" -#: ../../c-api/arg.rst:519 +#: ../../c-api/arg.rst:532 +msgid "PyArg_ParseTuple(args, \"O|O:ref\", &object, &callback)" +msgstr "PyArg_ParseTuple(args, \"O|O:ref\", &object, &callback)" + +#: ../../c-api/arg.rst:536 msgid "" "The value to be inserted, if any, before :c:expr:`char * const *` in the " "*keywords* parameter declaration of :c:func:`PyArg_ParseTupleAndKeywords` " @@ -1172,16 +1248,17 @@ msgid "" "to the desired value before including :file:`Python.h`." msgstr "" "O valor para ser inserido, se houver, antes de :c:expr:`char * const *` na " -"declaração do parâmetro *keywords* das funções :c:func:" -"`PyArg_ParseTupleAndKeywords` e :c:func:`PyArg_VaParseTupleAndKeywords`. Por " -"padrão, é vazio para C e ``const`` for C++ (:c:expr:`const char * const *`). " -"Para substituir, defina o valor desejado antes de incluir :file:`Python.h`." +"declaração do parâmetro *keywords* das " +"funções :c:func:`PyArg_ParseTupleAndKeywords` " +"e :c:func:`PyArg_VaParseTupleAndKeywords`. Por padrão, é vazio para C e " +"``const`` for C++ (:c:expr:`const char * const *`). Para substituir, defina " +"o valor desejado antes de incluir :file:`Python.h`." -#: ../../c-api/arg.rst:533 +#: ../../c-api/arg.rst:550 msgid "Building values" msgstr "Construindo valores" -#: ../../c-api/arg.rst:537 +#: ../../c-api/arg.rst:554 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 " @@ -1193,7 +1270,7 @@ msgstr "" "Retorna o valor ou ``NULL`` em caso de erro; uma exceção será levantada se " "``NULL`` for retornado." -#: ../../c-api/arg.rst:542 +#: ../../c-api/arg.rst:559 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 " @@ -1209,26 +1286,26 @@ msgstr "" "retornar uma tupla de tamanho 0 ou um, use parênteses na string de " "formatação." -#: ../../c-api/arg.rst:548 +#: ../../c-api/arg.rst:565 msgid "" "When memory buffers are passed as parameters to supply data to build " "objects, as for the ``s`` and ``s#`` formats, the required data is copied. " "Buffers provided by the caller are never referenced by the objects created " -"by :c:func:`Py_BuildValue`. In other words, if your code invokes :c:func:" -"`malloc` and passes the allocated memory to :c:func:`Py_BuildValue`, your " -"code is responsible for calling :c:func:`free` for that memory once :c:func:" -"`Py_BuildValue` returns." +"by :c:func:`Py_BuildValue`. In other words, if your code " +"invokes :c:func:`malloc` and passes the allocated memory " +"to :c:func:`Py_BuildValue`, your code is responsible for " +"calling :c:func:`free` for that memory once :c:func:`Py_BuildValue` returns." msgstr "" "Quando buffers de memória são passados como parâmetros para fornecer dados " "para construir objetos, como nos formatos ``s`` e ``s#``, os dados " "necessários são copiados. Buffers fornecidos pelo chamador nunca são " "referenciados pelos objetos criados por :c:func:`Py_BuildValue`. Em outras " "palavras, se o seu código invoca :c:func:`malloc` e passa a memória alocada " -"para :c:func:`Py_BuildValue`, seu código é responsável por chamar :c:func:" -"`free` para aquela memória uma vez que :c:func:`Py_BuildValue` tiver " -"retornado." +"para :c:func:`Py_BuildValue`, seu código é responsável por " +"chamar :c:func:`free` para aquela memória uma vez " +"que :c:func:`Py_BuildValue` tiver retornado." -#: ../../c-api/arg.rst:556 +#: ../../c-api/arg.rst:573 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 " @@ -1240,7 +1317,7 @@ msgstr "" "de formatação irá retornar; e a entrada em colchetes [quadrado] é o tipo " "do(s) valor(es) C a ser(em) passado(s)." -#: ../../c-api/arg.rst:560 +#: ../../c-api/arg.rst:577 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 " @@ -1251,11 +1328,11 @@ msgstr "" "pode ser usado para tornar strings de formatação longas um pouco mais " "legíveis." -#: ../../c-api/arg.rst:564 +#: ../../c-api/arg.rst:581 msgid "``s`` (:class:`str` or ``None``) [const char \\*]" msgstr "``s`` (:class:`str` ou ``None``) [const char \\*]" -#: ../../c-api/arg.rst:565 +#: ../../c-api/arg.rst:582 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." @@ -1264,13 +1341,13 @@ msgstr "" "usando codificação ``'utf-8'``. Se o ponteiro da string C é ``NULL``, " "``None`` é usado." -#: ../../c-api/arg.rst:568 +#: ../../c-api/arg.rst:585 msgid "" "``s#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "" "``s#`` (:class:`str` ou ``None``) [const char \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:569 +#: ../../c-api/arg.rst:586 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 " @@ -1280,11 +1357,11 @@ msgstr "" "usando a codificação ``'utf-8'``. Se o ponteiro da string C é ``NULL``, o " "comprimento é ignorado e ``None`` é retornado." -#: ../../c-api/arg.rst:573 +#: ../../c-api/arg.rst:590 msgid "``y`` (:class:`bytes`) [const char \\*]" msgstr "``y`` (:class:`bytes`) [const char \\*]" -#: ../../c-api/arg.rst:574 +#: ../../c-api/arg.rst:591 msgid "" "This converts a C string to a Python :class:`bytes` object. If the C string " "pointer is ``NULL``, ``None`` is returned." @@ -1292,11 +1369,11 @@ msgstr "" "Isso converte uma string C para um objeto Python :class:`bytes`. Se o " "ponteiro da string C é ``NULL``, ``None`` é retornado." -#: ../../c-api/arg.rst:577 +#: ../../c-api/arg.rst:594 msgid "``y#`` (:class:`bytes`) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "``y#`` (:class:`bytes`) [const char \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:578 +#: ../../c-api/arg.rst:595 msgid "" "This converts a C string and its lengths to a Python object. If the C " "string pointer is ``NULL``, ``None`` is returned." @@ -1304,25 +1381,25 @@ msgstr "" "Isso converte uma string C e seu comprimento para um objeto Python. Se o " "ponteiro da string C é ``NULL``, ``None`` é retornado." -#: ../../c-api/arg.rst:582 ../../c-api/arg.rst:598 +#: ../../c-api/arg.rst:599 ../../c-api/arg.rst:615 msgid "Same as ``s``." msgstr "O mesmo de ``s``." -#: ../../c-api/arg.rst:584 +#: ../../c-api/arg.rst:601 msgid "" "``z#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "" "``z#`` (:class:`str` ou ``None``) [const char \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:585 ../../c-api/arg.rst:601 +#: ../../c-api/arg.rst:602 ../../c-api/arg.rst:618 msgid "Same as ``s#``." msgstr "O mesmo de ``s#``." -#: ../../c-api/arg.rst:587 +#: ../../c-api/arg.rst:604 msgid "``u`` (:class:`str`) [const wchar_t \\*]" msgstr "``u`` (:class:`str`) [const wchar_t \\*]" -#: ../../c-api/arg.rst:588 +#: ../../c-api/arg.rst:605 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 " @@ -1332,11 +1409,11 @@ msgstr "" "(UTF-16 ou UCS-4) para um objeto Python Unicode. Se o ponteiro do buffer " "Unicode é ``NULL``, ``None`` é retornado." -#: ../../c-api/arg.rst:592 +#: ../../c-api/arg.rst:609 msgid "``u#`` (:class:`str`) [const wchar_t \\*, :c:type:`Py_ssize_t`]" msgstr "``u#`` (:class:`str`) [const wchar_t \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:593 +#: ../../c-api/arg.rst:610 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 " @@ -1346,141 +1423,141 @@ msgstr "" "um objeto Python Unicode. Se o ponteiro do buffer Unicode é ``NULL``, o " "comprimento é ignorado e ``None`` é retornado." -#: ../../c-api/arg.rst:597 +#: ../../c-api/arg.rst:614 msgid "``U`` (:class:`str` or ``None``) [const char \\*]" msgstr "``U`` (:class:`str` ou ``None``) [const char \\*]" -#: ../../c-api/arg.rst:600 +#: ../../c-api/arg.rst:617 msgid "" "``U#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "" "``U#`` (:class:`str` ou ``None``) [const char \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:604 +#: ../../c-api/arg.rst:621 msgid "Convert a plain C :c:expr:`int` to a Python integer object." msgstr "Converte um simples :c:expr:`int` do C em um objeto inteiro do Python." -#: ../../c-api/arg.rst:606 +#: ../../c-api/arg.rst:623 msgid "``b`` (:class:`int`) [char]" msgstr "``b`` (:class:`int`) [char]" -#: ../../c-api/arg.rst:607 +#: ../../c-api/arg.rst:624 msgid "Convert a plain C :c:expr:`char` to a Python integer object." msgstr "" "Converte um simples :c:expr:`char` do C em um objeto inteiro do Python." -#: ../../c-api/arg.rst:610 +#: ../../c-api/arg.rst:627 msgid "Convert a plain C :c:expr:`short int` to a Python integer object." msgstr "" "Converte um simples :c:expr:`short int` do C em um objeto inteiro do Python." -#: ../../c-api/arg.rst:613 +#: ../../c-api/arg.rst:630 msgid "Convert a C :c:expr:`long int` to a Python integer object." msgstr "Converte um :c:expr:`long int` do C em um objeto inteiro do Python." -#: ../../c-api/arg.rst:616 +#: ../../c-api/arg.rst:633 msgid "Convert a C :c:expr:`unsigned char` to a Python integer object." msgstr "" "Converte um :c:expr:`unsigned char` do C em um objeto inteiro do Python." -#: ../../c-api/arg.rst:619 +#: ../../c-api/arg.rst:636 msgid "Convert a C :c:expr:`unsigned short int` to a Python integer object." msgstr "" "Converte um :c:expr:`unsigned short int` do C em um objeto inteiro do Python." -#: ../../c-api/arg.rst:622 +#: ../../c-api/arg.rst:639 msgid "Convert a C :c:expr:`unsigned int` to a Python integer object." msgstr "" "Converte um :c:expr:`unsigned int` do C em um objeto inteiro do Python." -#: ../../c-api/arg.rst:625 +#: ../../c-api/arg.rst:642 msgid "Convert a C :c:expr:`unsigned long` to a Python integer object." msgstr "" "Converte um :c:expr:`unsigned long` do C em um objeto inteiro do Python." -#: ../../c-api/arg.rst:628 +#: ../../c-api/arg.rst:645 msgid "Convert a C :c:expr:`long long` to a Python integer object." msgstr "Converte um :c:expr:`long long` do C em um objeto inteiro do Python." -#: ../../c-api/arg.rst:631 +#: ../../c-api/arg.rst:650 msgid "Convert a C :c:expr:`unsigned long long` to a Python integer object." msgstr "" "Converte um :c:expr:`unsigned long long` do C em um objeto inteiro do Python." -#: ../../c-api/arg.rst:634 +#: ../../c-api/arg.rst:653 msgid "Convert a C :c:type:`Py_ssize_t` to a Python integer." msgstr "Converte um :c:type:`Py_ssize_t` do C em um objeto inteiro do Python." -#: ../../c-api/arg.rst:636 +#: ../../c-api/arg.rst:655 msgid "``c`` (:class:`bytes` of length 1) [char]" msgstr "``c`` (:class:`bytes` de comprimento 1) [char]" -#: ../../c-api/arg.rst:637 +#: ../../c-api/arg.rst:656 msgid "" "Convert a C :c:expr:`int` representing a byte to a Python :class:`bytes` " "object of length 1." msgstr "" -"Converte um :c:expr:`int` representando um byte do C em um objeto :class:" -"`bytes` de comprimento 1 do Python." +"Converte um :c:expr:`int` representando um byte do C em um " +"objeto :class:`bytes` de comprimento 1 do Python." -#: ../../c-api/arg.rst:641 +#: ../../c-api/arg.rst:660 msgid "" "Convert a C :c:expr:`int` representing a character to Python :class:`str` " "object of length 1." msgstr "" -"Converte um :c:expr:`int` representando um caractere do C em um objeto :" -"class:`str` de comprimento 1 do Python." +"Converte um :c:expr:`int` representando um caractere do C em um " +"objeto :class:`str` de comprimento 1 do Python." -#: ../../c-api/arg.rst:645 +#: ../../c-api/arg.rst:664 msgid "Convert a C :c:expr:`double` to a Python floating-point number." msgstr "" "Converte um :c:expr:`double` do C em um número ponto flutuante do Python." -#: ../../c-api/arg.rst:648 +#: ../../c-api/arg.rst:667 msgid "Convert a C :c:expr:`float` to a Python floating-point number." msgstr "" "Converte um :c:expr:`float` do C em um número ponto flutuante do Python." -#: ../../c-api/arg.rst:650 +#: ../../c-api/arg.rst:669 msgid "``D`` (:class:`complex`) [Py_complex \\*]" msgstr "``D`` (:class:`complex`) [Py_complex \\*]" -#: ../../c-api/arg.rst:651 +#: ../../c-api/arg.rst:670 msgid "Convert a C :c:type:`Py_complex` structure to a Python complex number." msgstr "" "Converte uma estrutura :c:type:`Py_complex` do C em um número complexo do " "Python." -#: ../../c-api/arg.rst:654 +#: ../../c-api/arg.rst:673 msgid "" "Pass a Python object untouched but create a new :term:`strong reference` to " "it (i.e. its reference count is incremented by one). If the object passed in " "is a ``NULL`` pointer, it is assumed that this was caused because the call " -"producing the argument found an error and set an exception. Therefore, :c:" -"func:`Py_BuildValue` will return ``NULL`` but won't raise an exception. If " -"no exception has been raised yet, :exc:`SystemError` is set." +"producing the argument found an error and set an exception. " +"Therefore, :c:func:`Py_BuildValue` will return ``NULL`` but won't raise an " +"exception. If no exception has been raised yet, :exc:`SystemError` is set." msgstr "" "Passa um objeto Python intocado, mas cria uma nova :term:`referência forte` " "a ele (isto é, sua contagem de referências é incrementada por um). Se o " "objeto passado é um ponteiro ``NULL``, presume-se que isso foi causado " "porque a chamada que produziu o argumento encontrou um erro e definiu uma " "exceção. Portanto, :c:func:`Py_BuildValue` irá retornar ``NULL`` mas não irá " -"levantar uma exceção. Se nenhuma exceção foi levantada ainda, :exc:" -"`SystemError` é definida." +"levantar uma exceção. Se nenhuma exceção foi levantada " +"ainda, :exc:`SystemError` é definida." -#: ../../c-api/arg.rst:663 +#: ../../c-api/arg.rst:682 msgid "``S`` (object) [PyObject \\*]" msgstr "``S`` (objeto) [PyObject \\*]" -#: ../../c-api/arg.rst:664 +#: ../../c-api/arg.rst:683 msgid "Same as ``O``." msgstr "O mesmo que ``O``." -#: ../../c-api/arg.rst:666 +#: ../../c-api/arg.rst:685 msgid "``N`` (object) [PyObject \\*]" msgstr "``N`` (objeto) [PyObject \\*]" -#: ../../c-api/arg.rst:667 +#: ../../c-api/arg.rst:686 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 " @@ -1490,19 +1567,23 @@ msgstr "" "Útil quando o objeto é criado por uma chamada a um construtor de objeto na " "lista de argumento." -#: ../../c-api/arg.rst:672 +#: ../../c-api/arg.rst:690 +msgid "``O&`` (object) [*converter*, *anything*]" +msgstr "``O&`` (objeto) [*converter*, *anything*]" + +#: ../../c-api/arg.rst:691 msgid "" "Convert *anything* to a Python object through a *converter* function. The " -"function is called with *anything* (which should be compatible with :c:expr:" -"`void*`) as its argument and should return a \"new\" Python object, or " -"``NULL`` if an error occurred." +"function is called with *anything* (which should be compatible " +"with :c:expr:`void*`) as its argument and should return a \"new\" Python " +"object, or ``NULL`` if an error occurred." msgstr "" "Converte *anything* para um objeto Python através de uma função *converter*. " -"A função é chamada com *anything* (que deve ser compatível com o :c:expr:" -"`void*`) como argumento e deve retornar um \"novo\" objeto Python, ou " -"``NULL`` se um erro ocorreu." +"A função é chamada com *anything* (que deve ser compatível com " +"o :c:expr:`void*`) como argumento e deve retornar um \"novo\" objeto Python, " +"ou ``NULL`` se um erro ocorreu." -#: ../../c-api/arg.rst:678 +#: ../../c-api/arg.rst:697 msgid "" "Convert a sequence of C values to a Python tuple with the same number of " "items." @@ -1510,11 +1591,11 @@ msgstr "" "Converte uma sequência de valores C para uma tupla Python com o mesmo número " "de itens." -#: ../../c-api/arg.rst:680 +#: ../../c-api/arg.rst:699 msgid "``[items]`` (:class:`list`) [*matching-items*]" msgstr "``[items]`` (:class:`list`) [*matching-items*]" -#: ../../c-api/arg.rst:681 +#: ../../c-api/arg.rst:700 msgid "" "Convert a sequence of C values to a Python list with the same number of " "items." @@ -1522,11 +1603,11 @@ msgstr "" "Converte uma sequência de valores C para uma lista Python com o mesmo número " "de itens." -#: ../../c-api/arg.rst:683 +#: ../../c-api/arg.rst:702 msgid "``{items}`` (:class:`dict`) [*matching-items*]" msgstr "``{items}`` (:class:`dict`) [*matching-items*]" -#: ../../c-api/arg.rst:684 +#: ../../c-api/arg.rst:703 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 " @@ -1536,7 +1617,7 @@ msgstr "" "valores consecutivos do C adiciona um item ao dicionário, servindo como " "chave e valor, respectivamente." -#: ../../c-api/arg.rst:688 +#: ../../c-api/arg.rst:707 msgid "" "If there is an error in the format string, the :exc:`SystemError` exception " "is set and ``NULL`` returned." @@ -1544,7 +1625,7 @@ msgstr "" "Se existir um erro na string de formatação, a exceção :exc:`SystemError` é " "definida e ``NULL`` é retornado." -#: ../../c-api/arg.rst:693 +#: ../../c-api/arg.rst:712 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 70cefcc72..a5281ab62 100644 --- a/c-api/bool.po +++ b/c-api/bool.po @@ -1,26 +1,25 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Julio Biason, 2023 -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-31 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: python-doc bot, 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -58,8 +57,8 @@ msgstr "" #: ../../c-api/bool.rst:28 msgid "" -"The Python ``False`` object. This object has no methods and is :term:" -"`immortal`." +"The Python ``False`` object. This object has no methods and " +"is :term:`immortal`." msgstr "" "O objeto Python ``False``. Este objeto não tem métodos e é :term:`imortal`." @@ -69,8 +68,8 @@ msgstr ":c:data:`Py_False` é :term:`imortal`." #: ../../c-api/bool.rst:37 msgid "" -"The Python ``True`` object. This object has no methods and is :term:" -"`immortal`." +"The Python ``True`` object. This object has no methods and " +"is :term:`immortal`." msgstr "" "O objeto Python ``True``. Este objeto não tem métodos e é :term:`imortal`." diff --git a/c-api/buffer.po b/c-api/buffer.po index dcfa980ce..8c3803e28 100644 --- a/c-api/buffer.po +++ b/c-api/buffer.po @@ -1,58 +1,47 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# (Douglas da Silva) , 2021 -# Julio Gadioli Soares , 2021 -# felipe caridade fernandes , 2021 -# Danielle Farias , 2021 -# Julia Rizza , 2021 -# Nícolas Prado , 2021 -# Leandro Braga , 2021 -# Ana Carolina Dias, 2022 -# Marco Rougeth , 2023 -# Julio Biason, 2023 -# Victor D. G., 2023 -# Adorilson Bezerra , 2024 -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 +# Rafael Fontenelle , 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-05 14:16+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../c-api/buffer.rst:11 msgid "Buffer Protocol" -msgstr "Protocolo de Buffer" +msgstr "Protocolo de buffer" #: ../../c-api/buffer.rst:18 msgid "" "Certain objects available in Python wrap access to an underlying memory " -"array or *buffer*. Such objects include the built-in :class:`bytes` and :" -"class:`bytearray`, and some extension types like :class:`array.array`. Third-" -"party libraries may define their own types for special purposes, such as " -"image processing or numeric analysis." +"array or *buffer*. Such objects include the built-in :class:`bytes` " +"and :class:`bytearray`, and some extension types like :class:`array.array`. " +"Third-party libraries may define their own types for special purposes, such " +"as image processing or numeric analysis." msgstr "" "Certos objetos disponíveis no Python envolvem o acesso a um vetor ou " -"*buffer* de memória subjacente. Esses objetos incluem as :class:`bytes` e :" -"class:`bytearray` embutidas, e alguns tipos de extensão como :class:`array." -"array`. As bibliotecas de terceiros podem definir seus próprios tipos para " -"fins especiais, como processamento de imagem ou análise numérica." +"*buffer* de memória subjacente. Esses objetos incluem as " +"classes :class:`bytes` e :class:`bytearray` embutidas, e alguns tipos de " +"extensão como :class:`array.array`. As bibliotecas de terceiros podem " +"definir seus próprios tipos para fins especiais, como processamento de " +"imagem ou análise numérica." #: ../../c-api/buffer.rst:24 msgid "" @@ -68,31 +57,35 @@ msgstr "" #: ../../c-api/buffer.rst:29 msgid "" -"Python provides such a facility at the C level in the form of the :ref:" -"`buffer protocol `. This protocol has two sides:" +"Python provides such a facility at the C and Python level in the form of " +"the :ref:`buffer protocol `. This protocol has two sides:" msgstr "" -"Python fornece essa facilidade no nível C sob a forma de :ref:`protocolo de " -"buffer `. Este protocolo tem dois lados:" +"Python fornece essa facilidade no nível C e Python sob a forma " +"de :ref:`protocolo de buffer `. Este protocolo tem dois lados:" #: ../../c-api/buffer.rst:34 msgid "" "on the producer side, a type can export a \"buffer interface\" which allows " "objects of that type to expose information about their underlying buffer. " -"This interface is described in the section :ref:`buffer-structs`;" +"This interface is described in the section :ref:`buffer-structs`; for Python " +"see :ref:`python-buffer-protocol`." msgstr "" "do lado do produtor, um tipo pode exportar uma \"interface de buffer\" que " "permite que objetos desse tipo exponham informações sobre o buffer " -"subjacente. Esta interface é descrita na seção :ref:`buffer-structs`;" +"subjacente. Esta interface é descrita na seção :ref:`buffer-structs`; para " +"Python, consulte :ref:`python-buffer-protocol`." -#: ../../c-api/buffer.rst:38 +#: ../../c-api/buffer.rst:39 msgid "" "on the consumer side, several means are available to obtain a pointer to the " -"raw underlying data of an object (for example a method parameter)." +"raw underlying data of an object (for example a method parameter). For " +"Python see :class:`memoryview`." msgstr "" "do lado do consumidor, vários meios estão disponíveis para obter o ponteiro " -"para os dados subjacentes de um objeto (por exemplo, um parâmetro de método)." +"para os dados subjacentes de um objeto (por exemplo, um parâmetro de " +"método). Para Python, consulte :class:`memoryview`." -#: ../../c-api/buffer.rst:41 +#: ../../c-api/buffer.rst:43 msgid "" "Simple objects such as :class:`bytes` and :class:`bytearray` expose their " "underlying buffer in byte-oriented form. Other forms are possible; for " @@ -104,28 +97,28 @@ msgstr "" "exemplo, os elementos expostos por uma :class:`array.array` podem ser " "valores de vários bytes." -#: ../../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` " -"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 " -"objects to selectively allow or reject exporting of read-write and read-only " -"buffers." -msgstr "" -"Um exemplo de interface de um consumidor de buffer é o método :meth:`~io." -"BufferedIOBase.write` de objetos arquivo: qualquer objeto que possa exportar " -"uma série de bytes por meio da interface de buffer pode ser gravado em um " -"arquivo. Enquanto o :meth:`!write` precisa apenas de acesso de somente " -"leitura ao conteúdo interno do objeto passado, outros métodos, como :meth:" -"`~io.BufferedIOBase.readinto`, precisam de acesso de somente escrita ao " -"conteúdo interno. A interface de buffer permite que o objetos possam " -"permitir ou rejeitar a exportação para buffers de leitura e escrita ou " -"somente leitura." - -#: ../../c-api/buffer.rst:53 +#: ../../c-api/buffer.rst:47 +msgid "" +"An example consumer of the buffer interface is " +"the :meth:`~io.BufferedIOBase.write` method of file objects: any object that " +"can export a series of bytes 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 objects to selectively allow or " +"reject exporting of read-write and read-only buffers." +msgstr "" +"Um exemplo de interface de um consumidor de buffer é o " +"método :meth:`~io.BufferedIOBase.write` de objetos arquivo: qualquer objeto " +"que possa exportar uma série de bytes por meio da interface de buffer pode " +"ser gravado em um arquivo. Enquanto o :meth:`!write` precisa apenas de " +"acesso somente de leitura ao conteúdo interno do objeto passado, outros " +"métodos, como :meth:`~io.BufferedIOBase.readinto`, precisam de acesso " +"somente de escrita ao conteúdo interno. A interface de buffer permite que os " +"objetos possam permitir ou rejeitar a exportação para buffers de leitura e " +"escrita ou somente leitura." + +#: ../../c-api/buffer.rst:55 msgid "" "There are two ways for a consumer of the buffer interface to acquire a " "buffer over a target object:" @@ -133,33 +126,41 @@ msgstr "" "Existem duas maneiras para um consumidor da interface de buffer adquirir um " "buffer em um objeto alvo:" -#: ../../c-api/buffer.rst:56 +#: ../../c-api/buffer.rst:58 msgid "call :c:func:`PyObject_GetBuffer` with the right parameters;" -msgstr "chamada de :c:func:`PyObject_GetBuffer` com os parâmetros certos;" +msgstr "chamar :c:func:`PyObject_GetBuffer` com os parâmetros certos;" -#: ../../c-api/buffer.rst:58 +#: ../../c-api/buffer.rst:60 msgid "" "call :c:func:`PyArg_ParseTuple` (or one of its siblings) with one of the " "``y*``, ``w*`` or ``s*`` :ref:`format codes `." msgstr "" -"chamada de :c:func:`PyArg_ParseTuple` (ou um dos seus irmãos) com um dos :" -"ref:`códigos de formatação ` ``y*``, ``w*`` ou ``s*``." +"chamar :c:func:`PyArg_ParseTuple` (ou um dos seus irmãos) com um " +"dos :ref:`códigos de formatação ` ``y*``, ``w*`` ou ``s*``." -#: ../../c-api/buffer.rst:61 +#: ../../c-api/buffer.rst:63 msgid "" "In both cases, :c:func:`PyBuffer_Release` must be called when the buffer " "isn't needed anymore. Failure to do so could lead to various issues such as " "resource leaks." msgstr "" "Em ambos os casos, :c:func:`PyBuffer_Release` deve ser chamado quando o " -"buffer não é mais necessário. A falta de tal pode levar a várias questões, " +"buffer não é mais necessário. A falta de tal pode levar a vários problemas, " "tais como vazamentos de recursos." #: ../../c-api/buffer.rst:69 +msgid "" +"The buffer protocol is now accessible in Python, see :ref:`python-buffer-" +"protocol` and :class:`memoryview`." +msgstr "" +"O protocolo de buffer agora está acessível em Python, veja :ref:`python-" +"buffer-protocol` e :class:`memoryview`." + +#: ../../c-api/buffer.rst:75 msgid "Buffer structure" msgstr "Estrutura de Buffer" -#: ../../c-api/buffer.rst:71 +#: ../../c-api/buffer.rst:77 msgid "" "Buffer structures (or simply \"buffers\") are useful as a way to expose the " "binary data from another object to the Python programmer. They can also be " @@ -180,7 +181,7 @@ msgstr "" "operacional, ou pode ser usado para transmitir dados estruturados no formato " "nativo e formato de memória." -#: ../../c-api/buffer.rst:80 +#: ../../c-api/buffer.rst:86 msgid "" "Contrary to most data types exposed by the Python interpreter, buffers are " "not :c:type:`PyObject` pointers but rather simple C structures. This allows " @@ -194,17 +195,17 @@ msgstr "" "simples. Quando um invólucro genérico em torno de um buffer é necessário, um " "objeto :ref:`memoryview ` pode ser criado." -#: ../../c-api/buffer.rst:86 +#: ../../c-api/buffer.rst:92 msgid "" "For short instructions how to write an exporting object, see :ref:`Buffer " -"Object Structures `. For obtaining a buffer, see :c:func:" -"`PyObject_GetBuffer`." +"Object Structures `. For obtaining a buffer, " +"see :c:func:`PyObject_GetBuffer`." msgstr "" "Para obter instruções curtas sobre como escrever um objeto exportador, " "consulte :ref:`Buffer Object Structures `. Para obter um " "buffer, veja :c:func:`PyObject_GetBuffer`." -#: ../../c-api/buffer.rst:94 +#: ../../c-api/buffer.rst:100 msgid "" "A pointer to the start of the logical structure described by the buffer " "fields. This can be any location within the underlying physical memory block " @@ -213,10 +214,11 @@ msgid "" msgstr "" "Um ponteiro para o início da estrutura lógica descrita pelos campos do " "buffer. Este pode ser qualquer local dentro do bloco de memória física " -"subjacente do exportador. Por exemplo, com negativo :c:member:`~Py_buffer." -"strides` o valor pode apontar para o final do bloco de memória." +"subjacente do exportador. Por exemplo, com " +"negativo :c:member:`~Py_buffer.strides` o valor pode apontar para o final do " +"bloco de memória." -#: ../../c-api/buffer.rst:99 +#: ../../c-api/buffer.rst:105 msgid "" "For :term:`contiguous` arrays, the value points to the beginning of the " "memory block." @@ -224,7 +226,7 @@ msgstr "" "Para vetores :term:`contíguos `, o valor aponta para o início do " "bloco de memória." -#: ../../c-api/buffer.rst:104 +#: ../../c-api/buffer.rst:110 msgid "" "A new reference to the exporting object. The reference is owned by the " "consumer and automatically released (i.e. reference count decremented) and " @@ -233,21 +235,21 @@ msgid "" msgstr "" "Uma nova referência ao objeto sendo exporta. A referência pertence ao " "consumidor e é automaticamente liberada (por exemplo, a contagem de " -"referências é decrementada) e é atribuída para ``NULL`` por :c:func:" -"`PyBuffer_Release`. O campo é equivalmente ao valor de retorno de qualquer " -"função do padrão C-API." +"referências é decrementada) e é atribuída para ``NULL`` " +"por :c:func:`PyBuffer_Release`. O campo equivale ao valor de retorno de " +"qualquer função padrão da API C." -#: ../../c-api/buffer.rst:111 +#: ../../c-api/buffer.rst:117 msgid "" -"As a special case, for *temporary* buffers that are wrapped by :c:func:" -"`PyMemoryView_FromBuffer` or :c:func:`PyBuffer_FillInfo` this field is " -"``NULL``. In general, exporting objects MUST NOT use this scheme." +"As a special case, for *temporary* buffers that are wrapped " +"by :c:func:`PyMemoryView_FromBuffer` or :c:func:`PyBuffer_FillInfo` this " +"field is ``NULL``. In general, exporting objects MUST NOT use this scheme." msgstr "" -"Como um caso especial, para buffers *temporários* que são encapsulados por :" -"c:func:`PyMemoryView_FromBuffer` ou :c:func:`PyBuffer_FillInfo` esse campo é " -"``NULL``. Em geral, objetos exportadores NÃO DEVEM usar esse esquema." +"Como um caso especial, para buffers *temporários* que são encapsulados " +"por :c:func:`PyMemoryView_FromBuffer` ou :c:func:`PyBuffer_FillInfo` esse " +"campo é ``NULL``. Em geral, objetos exportadores NÃO DEVEM usar esse esquema." -#: ../../c-api/buffer.rst:118 +#: ../../c-api/buffer.rst:124 msgid "" "``product(shape) * itemsize``. For contiguous arrays, this is the length of " "the underlying memory block. For non-contiguous arrays, it is the length " @@ -259,19 +261,19 @@ msgstr "" "que a estrutura lógica teria se fosse copiado para uma representação " "contígua." -#: ../../c-api/buffer.rst:123 +#: ../../c-api/buffer.rst:129 msgid "" "Accessing ``((char *)buf)[0] up to ((char *)buf)[len-1]`` is only valid if " "the buffer has been obtained by a request that guarantees contiguity. In " -"most cases such a request will be :c:macro:`PyBUF_SIMPLE` or :c:macro:" -"`PyBUF_WRITABLE`." +"most cases such a request will be :c:macro:`PyBUF_SIMPLE` " +"or :c:macro:`PyBUF_WRITABLE`." msgstr "" "Acessando ``((char *)buf)[0] up to ((char *)buf)[len-1]`` só é válido se o " "buffer tiver sido obtido por uma solicitação que garanta a contiguidade. Na " -"maioria dos casos, esse pedido será :c:macro:`PyBUF_SIMPLE` ou :c:macro:" -"`PyBUF_WRITABLE`." +"maioria dos casos, esse pedido será :c:macro:`PyBUF_SIMPLE` " +"ou :c:macro:`PyBUF_WRITABLE`." -#: ../../c-api/buffer.rst:129 +#: ../../c-api/buffer.rst:135 msgid "" "An indicator of whether the buffer is read-only. This field is controlled by " "the :c:macro:`PyBUF_WRITABLE` flag." @@ -279,48 +281,51 @@ msgstr "" "Um indicador de se o buffer é somente leitura. Este campo é controlado pelo " "sinalizador :c:macro:`PyBUF_WRITABLE`." -#: ../../c-api/buffer.rst:134 +#: ../../c-api/buffer.rst:140 msgid "" -"Item size in bytes of a single element. Same as the value of :func:`struct." -"calcsize` called on non-``NULL`` :c:member:`~Py_buffer.format` values." +"Item size in bytes of a single element. Same as the value " +"of :func:`struct.calcsize` called on non-" +"``NULL`` :c:member:`~Py_buffer.format` values." msgstr "" -"O tamanho do item em bytes de um único elemento. O mesmo que o valor de :" -"func:`struct.calcsize` chamado em valores não ``NULL`` de :c:member:" -"`~Py_buffer.format`." +"O tamanho do item em bytes de um único elemento. O mesmo que o valor " +"de :func:`struct.calcsize` chamado em valores não ``NULL`` " +"de :c:member:`~Py_buffer.format`." -#: ../../c-api/buffer.rst:137 +#: ../../c-api/buffer.rst:143 msgid "" -"Important exception: If a consumer requests a buffer without the :c:macro:" -"`PyBUF_FORMAT` flag, :c:member:`~Py_buffer.format` will be set to " -"``NULL``, but :c:member:`~Py_buffer.itemsize` still has the value for the " -"original format." +"Important exception: If a consumer requests a buffer without " +"the :c:macro:`PyBUF_FORMAT` flag, :c:member:`~Py_buffer.format` will be set " +"to ``NULL``, but :c:member:`~Py_buffer.itemsize` still has the value for " +"the original format." msgstr "" -"Exceção importante: Se um consumidor requisita um buffer sem sinalizador :c:" -"macro:`PyBUF_FORMAT`, :c:member:`~Py_buffer.format` será definido como " -"``NULL``, mas :c:member:`~Py_buffer.itemsize` ainda terá seu valor para o " -"formato original." +"Exceção importante: Se um consumidor requisita um buffer sem " +"sinalizador :c:macro:`PyBUF_FORMAT`, :c:member:`~Py_buffer.format` será " +"definido como ``NULL``, mas :c:member:`~Py_buffer.itemsize` ainda terá seu " +"valor para o formato original." -#: ../../c-api/buffer.rst:142 +#: ../../c-api/buffer.rst:148 msgid "" "If :c:member:`~Py_buffer.shape` is present, the equality ``product(shape) * " -"itemsize == len`` still holds and the consumer can use :c:member:`~Py_buffer." -"itemsize` to navigate the buffer." +"itemsize == len`` still holds and the consumer can " +"use :c:member:`~Py_buffer.itemsize` to navigate the buffer." msgstr "" "Se :c:member:`~Py_buffer.shape` está presente, a igualdade ``product(shape) " -"* itemsize == len`` ainda é válida e o usuário pode usar :c:member:" -"`~Py_buffer.itemsize` para navegar o buffer." +"* itemsize == len`` ainda é válida e o usuário pode " +"usar :c:member:`~Py_buffer.itemsize` para navegar o buffer." -#: ../../c-api/buffer.rst:146 +#: ../../c-api/buffer.rst:152 msgid "" -"If :c:member:`~Py_buffer.shape` is ``NULL`` as a result of a :c:macro:" -"`PyBUF_SIMPLE` or a :c:macro:`PyBUF_WRITABLE` request, the consumer must " -"disregard :c:member:`~Py_buffer.itemsize` and assume ``itemsize == 1``." +"If :c:member:`~Py_buffer.shape` is ``NULL`` as a result of " +"a :c:macro:`PyBUF_SIMPLE` or a :c:macro:`PyBUF_WRITABLE` request, the " +"consumer must disregard :c:member:`~Py_buffer.itemsize` and assume " +"``itemsize == 1``." msgstr "" -"Se :c:member:`~Py_buffer.shape` é ``NULL`` como resultado de uma :c:macro:" -"`PyBUF_SIMPLE` ou uma requisição :c:macro:`PyBUF_WRITABLE`, o consumidor " -"deve ignorar :c:member:`~Py_buffer.itemsize` e presumir ``itemsize == 1``." +"Se :c:member:`~Py_buffer.shape` é ``NULL`` como resultado de " +"uma :c:macro:`PyBUF_SIMPLE` ou uma requisição :c:macro:`PyBUF_WRITABLE`, o " +"consumidor deve ignorar :c:member:`~Py_buffer.itemsize` e presumir " +"``itemsize == 1``." -#: ../../c-api/buffer.rst:152 +#: ../../c-api/buffer.rst:158 msgid "" "A *NULL* terminated string in :mod:`struct` module style syntax describing " "the contents of a single item. If this is ``NULL``, ``\"B\"`` (unsigned " @@ -330,37 +335,39 @@ msgstr "" "descrevendo os conteúdos de um único item. Se isso é ``NULL``, ``\"B\"`` " "(unsigned bytes) é presumido." -#: ../../c-api/buffer.rst:156 +#: ../../c-api/buffer.rst:162 msgid "This field is controlled by the :c:macro:`PyBUF_FORMAT` flag." msgstr "Este campo é controlado pelo sinalizador :c:macro:`PyBUF_FORMAT`." -#: ../../c-api/buffer.rst:160 +#: ../../c-api/buffer.rst:166 msgid "" "The number of dimensions the memory represents as an n-dimensional array. If " "it is ``0``, :c:member:`~Py_buffer.buf` points to a single item representing " -"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`." +"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`." msgstr "" "O número de dimensões de memória representado como um array n-dimensional. " "Se for ``0``, :c:member:`~Py_buffer.buf` aponta para um único elemento " -"representando um escalar. Neste caso, :c:member:`~Py_buffer.shape`, :c:" -"member:`~Py_buffer.strides` e :c:member:`~Py_buffer.suboffsets` DEVEM ser " -"``NULL``. O número máximo de dimensões é dado por :c:macro:`PyBUF_MAX_NDIM`." +"representando um escalar. Neste " +"caso, :c:member:`~Py_buffer.shape`, :c:member:`~Py_buffer.strides` " +"e :c:member:`~Py_buffer.suboffsets` DEVEM ser ``NULL``. O número máximo de " +"dimensões é dado por :c:macro:`PyBUF_MAX_NDIM`." -#: ../../c-api/buffer.rst:168 +#: ../../c-api/buffer.rst:174 msgid "" "An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim` " "indicating the shape of the memory as an n-dimensional array. Note that " -"``shape[0] * ... * shape[ndim-1] * itemsize`` MUST be equal to :c:member:" -"`~Py_buffer.len`." +"``shape[0] * ... * shape[ndim-1] * itemsize`` MUST be equal " +"to :c:member:`~Py_buffer.len`." msgstr "" -"Uma matriz de :c:type:`Py_ssize_t` do comprimento :c:member:`~Py_buffer." -"ndim` indicando a forma da memória como uma matriz n-dimensional. Observe " -"que a forma ``shape[0] * ... * shape[ndim-1] * itemsize`` DEVE ser igual a :" -"c:member:`~Py_buffer.len`." +"Uma matriz de :c:type:`Py_ssize_t` do " +"comprimento :c:member:`~Py_buffer.ndim` indicando a forma da memória como " +"uma matriz n-dimensional. Observe que a forma ``shape[0] * ... * " +"shape[ndim-1] * itemsize`` DEVE ser igual a :c:member:`~Py_buffer.len`." -#: ../../c-api/buffer.rst:173 +#: ../../c-api/buffer.rst:179 msgid "" "Shape values are restricted to ``shape[n] >= 0``. The case ``shape[n] == 0`` " "requires special attention. See `complex arrays`_ for further information." @@ -368,11 +375,11 @@ msgstr "" "Os valores da forma são restritos a ``shape[n] >= 0``. The case ``shape[n] " "== 0`` requer atenção especial. Veja `complex arrays`_ para mais informações." -#: ../../c-api/buffer.rst:177 +#: ../../c-api/buffer.rst:183 msgid "The shape array is read-only for the consumer." msgstr "A forma de acesso a matriz é de somente leitura para o usuário." -#: ../../c-api/buffer.rst:181 +#: ../../c-api/buffer.rst:187 msgid "" "An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim` " "giving the number of bytes to skip to get to a new element in each dimension." @@ -381,7 +388,7 @@ msgstr "" "dando o número de bytes para saltar para obter um novo elemento em cada " "dimensão." -#: ../../c-api/buffer.rst:185 +#: ../../c-api/buffer.rst:191 msgid "" "Stride values can be any integer. For regular arrays, strides are usually " "positive, but a consumer MUST be able to handle the case ``strides[n] <= " @@ -392,11 +399,11 @@ msgstr "" "capaz de lidar com o caso ``strides[n] <= 0``. Veja `complex arrays`_ para " "mais informações." -#: ../../c-api/buffer.rst:189 +#: ../../c-api/buffer.rst:195 msgid "The strides array is read-only for the consumer." msgstr "A matriz de passos é somente leitura para o consumidor." -#: ../../c-api/buffer.rst:193 +#: ../../c-api/buffer.rst:199 msgid "" "An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim`. If " "``suboffsets[n] >= 0``, the values stored along the nth dimension are " @@ -404,14 +411,14 @@ msgid "" "pointer after de-referencing. A suboffset value that is negative indicates " "that no de-referencing should occur (striding in a contiguous memory block)." msgstr "" -"Uma matriz de :c:type:`Py_ssize_t` de comprimento :c:member:`~Py_buffer." -"ndim`. Se ``suboffsets[n] >= 0``, os valores armazenados ao longo da n-ésima " -"dimensão são ponteiros e o valor suboffset determina quantos bytes para " -"adicionar a cada ponteiro após desreferenciar. Um valor de suboffset que é " -"negativo indica que não deve ocorrer desreferenciação (caminhando em um " -"bloco de memória contíguo)." +"Uma matriz de :c:type:`Py_ssize_t` de " +"comprimento :c:member:`~Py_buffer.ndim`. Se ``suboffsets[n] >= 0``, os " +"valores armazenados ao longo da n-ésima dimensão são ponteiros e o valor " +"suboffset determina quantos bytes para adicionar a cada ponteiro após " +"desreferenciar. Um valor de suboffset que é negativo indica que não deve " +"ocorrer desreferenciação (caminhando em um bloco de memória contíguo)." -#: ../../c-api/buffer.rst:200 +#: ../../c-api/buffer.rst:206 msgid "" "If all suboffsets are negative (i.e. no de-referencing is needed), then this " "field must be ``NULL`` (the default value)." @@ -419,7 +426,7 @@ msgstr "" "Se todos os subconjuntos forem negativos (ou seja, não é necessário fazer " "referência), então este campo deve ser ``NULL`` (o valor padrão)." -#: ../../c-api/buffer.rst:203 +#: ../../c-api/buffer.rst:209 msgid "" "This type of array representation is used by the Python Imaging Library " "(PIL). See `complex arrays`_ for further information how to access elements " @@ -429,11 +436,11 @@ msgstr "" "(PIL). Veja `complex arrays`_ para obter mais informações sobre como acessar " "elementos dessa matriz.a matriz." -#: ../../c-api/buffer.rst:207 +#: ../../c-api/buffer.rst:213 msgid "The suboffsets array is read-only for the consumer." msgstr "A matriz de subconjuntos é somente leitura para o consumidor." -#: ../../c-api/buffer.rst:211 +#: ../../c-api/buffer.rst:217 msgid "" "This is for use internally by the exporting object. For example, this might " "be re-cast as an integer by the exporter and used to store flags about " @@ -446,26 +453,26 @@ msgstr "" "ser liberados quando o buffer é liberado. O consumidor NÃO DEVE alterar esse " "valor." -#: ../../c-api/buffer.rst:218 +#: ../../c-api/buffer.rst:224 msgid "Constants:" msgstr "Constantes:" -#: ../../c-api/buffer.rst:222 +#: ../../c-api/buffer.rst:228 msgid "" "The maximum number of dimensions the memory represents. Exporters MUST " "respect this limit, consumers of multi-dimensional buffers SHOULD be able to " "handle up to :c:macro:`!PyBUF_MAX_NDIM` dimensions. Currently set to 64." msgstr "" "O número máximo de dimensões que a memória representa. Exportadores DEVEM " -"respeitar esse limite, consumidores de buffers multi-dimensionais DEVEM ser " -"capazes de liader com até :c:macro:`!PyBUF_MAX_NDIM` dimensões. Atualmente " +"respeitar esse limite, consumidores de buffers multidimensionais DEVEM ser " +"capazes de lidar com até :c:macro:`!PyBUF_MAX_NDIM` dimensões. Atualmente " "definido como 64." -#: ../../c-api/buffer.rst:231 +#: ../../c-api/buffer.rst:237 msgid "Buffer request types" msgstr "Tipos de solicitação do buffer" -#: ../../c-api/buffer.rst:233 +#: ../../c-api/buffer.rst:239 msgid "" "Buffers are usually obtained by sending a buffer request to an exporting " "object via :c:func:`PyObject_GetBuffer`. Since the complexity of the logical " @@ -478,46 +485,53 @@ msgstr "" "consumidor usa o argumento *flags* para especificar o tipo de buffer exato " "que pode manipular." -#: ../../c-api/buffer.rst:238 +#: ../../c-api/buffer.rst:244 msgid "" "All :c:type:`Py_buffer` fields are unambiguously defined by the request type." msgstr "" "Todos os campos :c:type:`Py_buffer` são definidos de forma não-ambígua pelo " "tipo de requisição." -#: ../../c-api/buffer.rst:242 +#: ../../c-api/buffer.rst:248 msgid "request-independent fields" msgstr "campos independentes do pedido" -#: ../../c-api/buffer.rst:243 +#: ../../c-api/buffer.rst:249 msgid "" "The following fields are not influenced by *flags* and must always be filled " -"in with the correct values: :c:member:`~Py_buffer.obj`, :c:member:" -"`~Py_buffer.buf`, :c:member:`~Py_buffer.len`, :c:member:`~Py_buffer." -"itemsize`, :c:member:`~Py_buffer.ndim`." +"in with the correct " +"values: :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`." msgstr "" "Os seguintes campos não são influenciados por *flags* e devem sempre ser " -"preenchidos com os valores corretos: :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`." +"preenchidos com os valores " +"corretos: :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:249 +#: ../../c-api/buffer.rst:254 msgid "readonly, format" msgstr "apenas em formato" -#: ../../c-api/buffer.rst:253 +#: ../../c-api/buffer.rst:258 msgid "" "Controls the :c:member:`~Py_buffer.readonly` field. If set, the exporter " "MUST provide a writable buffer or else report failure. Otherwise, the " "exporter MAY provide either a read-only or writable buffer, but the choice " -"MUST be consistent for all consumers." +"MUST be consistent for all consumers. For example, :c:expr:`PyBUF_SIMPLE | " +"PyBUF_WRITABLE` can be used to request a simple writable buffer." msgstr "" -"Controla o campo :c:member:`~Py_buffer.readonly`. Se configurado, o " -"exportador DEVE fornecer um buffer gravável ou então reportar falha. Caso " -"contrário, o exportador pode fornecer um buffer de somente leitura ou " -"gravável, mas a escolha DEVE ser consistente para todos os consumidores." +"Controla o campo :c:member:`~Py_buffer.readonly` . Se configurado, o " +"exportador DEVE fornecer um buffer gravável ou então relatar falha. Do " +"contrário, o exportador PODE fornecer um buffer somente leitura ou um buffer " +"gravável , mas a escolha DEVE ser consistente para todos os consumidores. " +"Por exemplo, :c:expr:`PyBUF_SIMPLE | PyBUF_WRITABLE` pode ser usado para " +"requisitar um buffer simples gravável." -#: ../../c-api/buffer.rst:260 +#: ../../c-api/buffer.rst:266 +msgid "This is a :term:`soft deprecated` alias to :c:macro:`PyBUF_WRITABLE`." +msgstr "" +"Este é um apelido :term:`suavemente descontinuado` " +"para :c:macro:`PyBUF_WRITABLE`." + +#: ../../c-api/buffer.rst:270 msgid "" "Controls the :c:member:`~Py_buffer.format` field. If set, this field MUST be " "filled in correctly. Otherwise, this field MUST be ``NULL``." @@ -526,32 +540,34 @@ msgstr "" "DEVE ser preenchido corretamente. Caso contrário, este campo DEVE ser " "``NULL``." -#: ../../c-api/buffer.rst:264 +#: ../../c-api/buffer.rst:274 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:" -"`PyBUF_WRITABLE` can be used as a stand-alone flag to request a simple " -"writable buffer." +"section. Since :c:macro:`PyBUF_SIMPLE` is defined as " +"0, :c:macro:`PyBUF_WRITABLE` can be used as a stand-alone flag to request a " +"simple writable buffer." msgstr "" -"::c:macro:`PyBUF_WRITABLE` pode ser \\|'d para qualquer um dos sinalizadores " -"na próxima seção. Uma vez que :c:macro:`PyBUF_WRITABLE` é definido como 0, :" -"c:macro:`PyBUF_WRITABLE` pode ser usado como uma bandeira autônoma para " +":c:macro:`PyBUF_WRITABLE` pode ser \\|'d para qualquer um dos sinalizadores " +"na próxima seção. Uma vez que :c:macro:`PyBUF_SIMPLE` é definido como " +"0, :c:macro:`PyBUF_WRITABLE` pode ser usado como uma bandeira autônoma para " "solicitar um buffer simples gravável." -#: ../../c-api/buffer.rst:268 +#: ../../c-api/buffer.rst:278 msgid "" -":c:macro:`PyBUF_FORMAT` can be \\|'d to any of the flags except :c:macro:" -"`PyBUF_SIMPLE`. The latter already implies format ``B`` (unsigned bytes)." +":c:macro:`PyBUF_FORMAT` must be \\|'d to any of the flags " +"except :c:macro:`PyBUF_SIMPLE`, because the latter already implies format " +"``B`` (unsigned bytes). :c:macro:`!PyBUF_FORMAT` cannot be used on its own." msgstr "" -":c:macro:`PyBUF_FORMAT` pode ser \\|'d para qualquer um dos sinalizadores, " -"exceto :c:macro:`PyBUF_SIMPLE`. O último já implica o formato ``B`` (bytes " -"não assinados)." +":c:macro:`PyBUF_FORMAT` deve ser \\|'d para qualquer um dos sinalizadores " +"exceto :c:macro:`PyBUF_SIMPLE`, uma vez que este já indica que o formato " +"``B`` (unsigned bytes). :c:macro:`!PyBUF_FORMAT` não pode ser utilizado " +"sozinho." -#: ../../c-api/buffer.rst:273 +#: ../../c-api/buffer.rst:284 msgid "shape, strides, suboffsets" msgstr "forma, avanços, suboffsets" -#: ../../c-api/buffer.rst:275 +#: ../../c-api/buffer.rst:286 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 " @@ -561,57 +577,57 @@ msgstr "" "ordem decrescente de complexidade. Observe que cada bandeira contém todos os " "bits das bandeiras abaixo." -#: ../../c-api/buffer.rst:282 ../../c-api/buffer.rst:306 -#: ../../c-api/buffer.rst:331 +#: ../../c-api/buffer.rst:293 ../../c-api/buffer.rst:317 +#: ../../c-api/buffer.rst:342 msgid "Request" msgstr "Solicitação" -#: ../../c-api/buffer.rst:282 ../../c-api/buffer.rst:306 -#: ../../c-api/buffer.rst:331 +#: ../../c-api/buffer.rst:293 ../../c-api/buffer.rst:317 +#: ../../c-api/buffer.rst:342 msgid "shape" msgstr "Forma" -#: ../../c-api/buffer.rst:282 ../../c-api/buffer.rst:306 -#: ../../c-api/buffer.rst:331 +#: ../../c-api/buffer.rst:293 ../../c-api/buffer.rst:317 +#: ../../c-api/buffer.rst:342 msgid "strides" msgstr "Avanços" -#: ../../c-api/buffer.rst:282 ../../c-api/buffer.rst:306 -#: ../../c-api/buffer.rst:331 +#: ../../c-api/buffer.rst:293 ../../c-api/buffer.rst:317 +#: ../../c-api/buffer.rst:342 msgid "suboffsets" msgstr "subconjuntos" -#: ../../c-api/buffer.rst:284 ../../c-api/buffer.rst:286 -#: ../../c-api/buffer.rst:288 ../../c-api/buffer.rst:308 -#: ../../c-api/buffer.rst:310 ../../c-api/buffer.rst:312 -#: ../../c-api/buffer.rst:314 ../../c-api/buffer.rst:333 -#: ../../c-api/buffer.rst:335 ../../c-api/buffer.rst:337 -#: ../../c-api/buffer.rst:339 ../../c-api/buffer.rst:341 -#: ../../c-api/buffer.rst:343 ../../c-api/buffer.rst:345 -#: ../../c-api/buffer.rst:347 +#: ../../c-api/buffer.rst:295 ../../c-api/buffer.rst:297 +#: ../../c-api/buffer.rst:299 ../../c-api/buffer.rst:319 +#: ../../c-api/buffer.rst:321 ../../c-api/buffer.rst:323 +#: ../../c-api/buffer.rst:325 ../../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:356 +#: ../../c-api/buffer.rst:358 msgid "yes" msgstr "sim" -#: ../../c-api/buffer.rst:284 ../../c-api/buffer.rst:333 -#: ../../c-api/buffer.rst:335 +#: ../../c-api/buffer.rst:295 ../../c-api/buffer.rst:344 +#: ../../c-api/buffer.rst:346 msgid "if needed" msgstr "se necessário" -#: ../../c-api/buffer.rst:286 ../../c-api/buffer.rst:288 -#: ../../c-api/buffer.rst:290 ../../c-api/buffer.rst:308 -#: ../../c-api/buffer.rst:310 ../../c-api/buffer.rst:312 -#: ../../c-api/buffer.rst:314 ../../c-api/buffer.rst:337 -#: ../../c-api/buffer.rst:339 ../../c-api/buffer.rst:341 -#: ../../c-api/buffer.rst:343 ../../c-api/buffer.rst:345 -#: ../../c-api/buffer.rst:347 +#: ../../c-api/buffer.rst:297 ../../c-api/buffer.rst:299 +#: ../../c-api/buffer.rst:301 ../../c-api/buffer.rst:319 +#: ../../c-api/buffer.rst:321 ../../c-api/buffer.rst:323 +#: ../../c-api/buffer.rst:325 ../../c-api/buffer.rst:348 +#: ../../c-api/buffer.rst:350 ../../c-api/buffer.rst:352 +#: ../../c-api/buffer.rst:354 ../../c-api/buffer.rst:356 +#: ../../c-api/buffer.rst:358 msgid "NULL" msgstr "NULL" -#: ../../c-api/buffer.rst:297 +#: ../../c-api/buffer.rst:308 msgid "contiguity requests" msgstr "requisições contíguas" -#: ../../c-api/buffer.rst:299 +#: ../../c-api/buffer.rst:310 msgid "" "C or Fortran :term:`contiguity ` can be explicitly requested, " "with and without stride information. Without stride information, the buffer " @@ -621,32 +637,32 @@ msgstr "" "solicitadas, com ou sem informação de avanço. Sem informação de avanço, o " "buffer deve ser C-contíguo." -#: ../../c-api/buffer.rst:306 ../../c-api/buffer.rst:331 +#: ../../c-api/buffer.rst:317 ../../c-api/buffer.rst:342 msgid "contig" msgstr "contig" -#: ../../c-api/buffer.rst:308 ../../c-api/buffer.rst:314 -#: ../../c-api/buffer.rst:345 ../../c-api/buffer.rst:347 +#: ../../c-api/buffer.rst:319 ../../c-api/buffer.rst:325 +#: ../../c-api/buffer.rst:356 ../../c-api/buffer.rst:358 msgid "C" msgstr "C" -#: ../../c-api/buffer.rst:310 +#: ../../c-api/buffer.rst:321 msgid "F" msgstr "F" -#: ../../c-api/buffer.rst:312 +#: ../../c-api/buffer.rst:323 msgid "C or F" msgstr "C ou F" -#: ../../c-api/buffer.rst:314 +#: ../../c-api/buffer.rst:325 msgid ":c:macro:`PyBUF_ND`" msgstr ":c:macro:`PyBUF_ND`" -#: ../../c-api/buffer.rst:319 +#: ../../c-api/buffer.rst:330 msgid "compound requests" msgstr "requisições compostas" -#: ../../c-api/buffer.rst:321 +#: ../../c-api/buffer.rst:332 msgid "" "All possible requests are fully defined by some combination of the flags in " "the previous section. For convenience, the buffer protocol provides " @@ -657,7 +673,7 @@ msgstr "" "protocolo do buffer fornece combinações frequentemente utilizadas como " "sinalizadores únicos." -#: ../../c-api/buffer.rst:325 +#: ../../c-api/buffer.rst:336 msgid "" "In the following table *U* stands for undefined contiguity. The consumer " "would have to call :c:func:`PyBuffer_IsContiguous` to determine contiguity." @@ -665,61 +681,63 @@ msgstr "" "Na seguinte tabela *U* significa contiguidade indefinida. O consumidor deve " "chamar :c:func:`PyBuffer_IsContiguous` para determinar a contiguidade." -#: ../../c-api/buffer.rst:331 +#: ../../c-api/buffer.rst:342 msgid "readonly" msgstr "readonly" -#: ../../c-api/buffer.rst:331 +#: ../../c-api/buffer.rst:342 msgid "format" -msgstr "formato" +msgstr "format" -#: ../../c-api/buffer.rst:333 ../../c-api/buffer.rst:335 -#: ../../c-api/buffer.rst:337 ../../c-api/buffer.rst:339 -#: ../../c-api/buffer.rst:341 ../../c-api/buffer.rst:343 +#: ../../c-api/buffer.rst:344 ../../c-api/buffer.rst:346 +#: ../../c-api/buffer.rst:348 ../../c-api/buffer.rst:350 +#: ../../c-api/buffer.rst:352 ../../c-api/buffer.rst:354 msgid "U" msgstr "U" -#: ../../c-api/buffer.rst:333 ../../c-api/buffer.rst:337 -#: ../../c-api/buffer.rst:341 ../../c-api/buffer.rst:345 +#: ../../c-api/buffer.rst:344 ../../c-api/buffer.rst:348 +#: ../../c-api/buffer.rst:352 ../../c-api/buffer.rst:356 msgid "0" msgstr "0" -#: ../../c-api/buffer.rst:335 ../../c-api/buffer.rst:339 -#: ../../c-api/buffer.rst:343 ../../c-api/buffer.rst:347 +#: ../../c-api/buffer.rst:346 ../../c-api/buffer.rst:350 +#: ../../c-api/buffer.rst:354 ../../c-api/buffer.rst:358 msgid "1 or 0" msgstr "1 ou 0" -#: ../../c-api/buffer.rst:352 +#: ../../c-api/buffer.rst:363 msgid "Complex arrays" msgstr "Vetores Complexos" -#: ../../c-api/buffer.rst:355 +#: ../../c-api/buffer.rst:366 msgid "NumPy-style: shape and strides" msgstr "Estilo NumPy: forma e avanços" -#: ../../c-api/buffer.rst:357 +#: ../../c-api/buffer.rst:368 msgid "" -"The logical structure of NumPy-style arrays is defined by :c:member:" -"`~Py_buffer.itemsize`, :c:member:`~Py_buffer.ndim`, :c:member:`~Py_buffer." -"shape` and :c:member:`~Py_buffer.strides`." +"The logical structure of NumPy-style arrays is defined " +"by :c:member:`~Py_buffer.itemsize`, :c:member:`~Py_buffer.ndim`, :c:member:`~Py_buffer.shape` " +"and :c:member:`~Py_buffer.strides`." msgstr "" -"A estrutura lógica de vetores do estilo NumPy é definida por :c:member:" -"`~Py_buffer.itemsize`, :c:member:`~Py_buffer.ndim`, :c:member:`~Py_buffer." -"shape` e :c:member:`~Py_buffer.strides`." +"A estrutura lógica de vetores do estilo NumPy é definida " +"por :c:member:`~Py_buffer.itemsize`, :c:member:`~Py_buffer.ndim`, :c:member:`~Py_buffer.shape` " +"e :c:member:`~Py_buffer.strides`." -#: ../../c-api/buffer.rst:360 +#: ../../c-api/buffer.rst:371 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 " -"that case, both :c:member:`~Py_buffer.shape` and :c:member:`~Py_buffer." -"strides` are ``NULL``." +"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 that case, " +"both :c:member:`~Py_buffer.shape` and :c:member:`~Py_buffer.strides` are " +"``NULL``." msgstr "" -"Se ``ndim == 0``, a localização da memória apontada para :c:member:" -"`~Py_buffer.buf` é interpretada como um escalar de tamanho :c:member:" -"`~Py_buffer.itemsize`. Nesse caso, ambos :c:member:`~Py_buffer.shape` e :c:" -"member:`~Py_buffer.strides` são ``NULL``." +"Se ``ndim == 0``, a localização da memória apontada " +"para :c:member:`~Py_buffer.buf` é interpretada como um escalar de " +"tamanho :c:member:`~Py_buffer.itemsize`. Nesse caso, " +"ambos :c:member:`~Py_buffer.shape` e :c:member:`~Py_buffer.strides` são " +"``NULL``." -#: ../../c-api/buffer.rst:364 +#: ../../c-api/buffer.rst:375 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-" @@ -729,7 +747,17 @@ msgstr "" "vetor C n-dimensional padrão. Caso contrário, o consumidor deve acessar um " "vetor n-dimensional como a seguir:" -#: ../../c-api/buffer.rst:374 +#: ../../c-api/buffer.rst:379 +msgid "" +"ptr = (char *)buf + indices[0] * strides[0] + ... + indices[n-1] * " +"strides[n-1];\n" +"item = *((typeof(item) *)ptr);" +msgstr "" +"ptr = (char *)buf + indices[0] * strides[0] + ... + indices[n-1] * " +"strides[n-1];\n" +"item = *((typeof(item) *)ptr);" + +#: ../../c-api/buffer.rst:385 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 " @@ -739,11 +767,65 @@ msgstr "" "localização dentro do bloco de memória em si. Um exportador pode verificar a " "validade de um buffer com essa função:" -#: ../../c-api/buffer.rst:408 +#: ../../c-api/buffer.rst:389 +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 "" +"def verify_structure(memlen, itemsize, ndim, shape, strides, offset):\n" +" \"\"\"Verifica se os parâmetros representa um vetor válido dentro\n" +" dos limites da memória alocada:\n" +" char *mem: início do bloco de memória física\n" +" memlen: comprimento do bloco de memória física\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" + +#: ../../c-api/buffer.rst:419 msgid "PIL-style: shape, strides and suboffsets" msgstr "Estilo-PIL: forma, avanços e suboffsets" -#: ../../c-api/buffer.rst:410 +#: ../../c-api/buffer.rst:421 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 " @@ -762,7 +844,7 @@ msgstr "" "matrizes ``char x[2][3]`` que podem estar localizadas em qualquer lugar na " "memória." -#: ../../c-api/buffer.rst:419 +#: ../../c-api/buffer.rst:430 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`` " @@ -772,11 +854,39 @@ msgstr "" "apontada por um índice N-dimensional onde existem ambos passos e " "subconjuntos não-``NULL``::" -#: ../../c-api/buffer.rst:438 +#: ../../c-api/buffer.rst:434 +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 "" +"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" +"}" + +#: ../../c-api/buffer.rst:449 msgid "Buffer-related functions" msgstr "Funções relacionadas ao Buffer" -#: ../../c-api/buffer.rst:442 +#: ../../c-api/buffer.rst:453 msgid "" "Return ``1`` if *obj* supports the buffer interface otherwise ``0``. When " "``1`` is returned, it doesn't guarantee that :c:func:`PyObject_GetBuffer` " @@ -786,18 +896,18 @@ msgstr "" "Quando ``1`` é retornado, isso não garante que :c:func:`PyObject_GetBuffer` " "será bem sucedida. Esta função é sempre bem sucedida." -#: ../../c-api/buffer.rst:449 +#: ../../c-api/buffer.rst:460 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 :exc:`BufferError`, set ``view->obj`` to ``NULL`` and return ``-1``." msgstr "" "Envia uma requisição ao *exporter* para preencher a *view* conforme " "especificado por *flags*. Se o exporter não conseguir prover um buffer do " "tipo especificado, ele DEVE levantar :exc:`BufferError`, definir ``view-" ">obj`` para ``NULL`` e retornar ``-1``." -#: ../../c-api/buffer.rst:454 +#: ../../c-api/buffer.rst:465 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 " @@ -810,19 +920,19 @@ msgstr "" "DEVE se referir a este objeto em vez de *exporter* (Veja :ref:`Buffer Object " "Structures `)." -#: ../../c-api/buffer.rst:459 +#: ../../c-api/buffer.rst:470 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:" -"`free`. Thus, after the consumer is done with the buffer, :c:func:" -"`PyBuffer_Release` must be called exactly once." +"to :c:func:`PyBuffer_Release`, similar to :c:func:`malloc` " +"and :c:func:`free`. Thus, after the consumer is done with the " +"buffer, :c:func:`PyBuffer_Release` must be called exactly once." msgstr "" "Chamadas bem sucedidas para :c:func:`PyObject_GetBuffer` devem ser " -"emparelhadas a chamadas para :c:func:`PyBuffer_Release`, similar para :c:" -"func:`malloc` e :c:func:`free`. Assim, após o consumidor terminar com o " -"buffer, :c:func:`PyBuffer_Release` deve ser chamado exatamente uma vez." +"emparelhadas a chamadas para :c:func:`PyBuffer_Release`, similar " +"para :c:func:`malloc` e :c:func:`free`. Assim, após o consumidor terminar " +"com o buffer, :c:func:`PyBuffer_Release` deve ser chamado exatamente uma vez." -#: ../../c-api/buffer.rst:467 +#: ../../c-api/buffer.rst:478 msgid "" "Release the buffer *view* and release the :term:`strong reference` (i.e. " "decrement the reference count) to the view's supporting object, ``view-" @@ -834,23 +944,24 @@ msgstr "" "``view->obj``. Esta função DEVE ser chamada quando o buffer não estiver mais " "sendo usado, ou o vazamento de referências pode acontecer." -#: ../../c-api/buffer.rst:472 +#: ../../c-api/buffer.rst:483 msgid "" -"It is an error to call this function on a buffer that was not obtained via :" -"c:func:`PyObject_GetBuffer`." +"It is an error to call this function on a buffer that was not obtained " +"via :c:func:`PyObject_GetBuffer`." msgstr "" -"É um erro chamar essa função em um buffer que não foi obtido via :c:func:" -"`PyObject_GetBuffer`." +"É um erro chamar essa função em um buffer que não foi obtido " +"via :c:func:`PyObject_GetBuffer`." -#: ../../c-api/buffer.rst:478 +#: ../../c-api/buffer.rst:489 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:member:`~Py_buffer.itemsize` " +"from :c:member:`~Py_buffer.format`. On error, raise an exception and return " +"-1." msgstr "" -"Retorna o :c:member:`~Py_buffer.itemsize` implícito de :c:member:`~Py_buffer." -"format`. Em erro, levantar e exceção e retornar -1." +"Retorna o :c:member:`~Py_buffer.itemsize` implícito " +"de :c:member:`~Py_buffer.format`. Em erro, levantar e exceção e retornar -1." -#: ../../c-api/buffer.rst:486 +#: ../../c-api/buffer.rst:497 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 " @@ -862,7 +973,7 @@ msgstr "" "``'F'``) ou qualquer outra (*order* é ``'A'``). Retorna ``0`` caso " "contrário. Essa função é sempre bem sucedida." -#: ../../c-api/buffer.rst:493 +#: ../../c-api/buffer.rst:504 msgid "" "Get the memory area pointed to by the *indices* inside the given *view*. " "*indices* must point to an array of ``view->ndim`` indices." @@ -870,7 +981,7 @@ msgstr "" "Recebe a área de memória apontada pelos *indices* dentro da *view* dada. " "*indices* deve apontar para um array de ``view->ndim`` índices." -#: ../../c-api/buffer.rst:499 +#: ../../c-api/buffer.rst:510 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 " @@ -880,7 +991,7 @@ msgstr "" "``'F'`` (para ordenação estilo C ou estilo Fortran). Retorna ``0`` em caso " "de sucesso e ``-1`` em caso de erro." -#: ../../c-api/buffer.rst:506 +#: ../../c-api/buffer.rst:517 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 " @@ -891,11 +1002,11 @@ msgstr "" "qualquer uma). O retorno é ``0`` em caso de sucesso e ``-1`` em caso de " "falha." -#: ../../c-api/buffer.rst:510 +#: ../../c-api/buffer.rst:521 msgid "This function fails if *len* != *src->len*." msgstr "Esta função falha se *len* != *src->len*." -#: ../../c-api/buffer.rst:515 +#: ../../c-api/buffer.rst:526 msgid "" "Copy data from *src* to *dest* buffer. Can convert between C-style and or " "Fortran-style buffers." @@ -903,11 +1014,11 @@ msgstr "" "Copia os dados do buffer *src* para o buffer *dest*. Pode converter entre " "buffers de estilo C e/ou estilo Fortran." -#: ../../c-api/buffer.rst:518 +#: ../../c-api/buffer.rst:529 msgid "``0`` is returned on success, ``-1`` on error." msgstr "``0`` é retornado em caso de sucesso, ``-1`` em caso de erro." -#: ../../c-api/buffer.rst:522 +#: ../../c-api/buffer.rst:533 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 " @@ -917,7 +1028,7 @@ msgstr "" "(estilo C se *order* é ``'C'`` ou estilo Fortran se *order* for ``'F'``) da " "forma dada com o número dado de bytes por elemento." -#: ../../c-api/buffer.rst:529 +#: ../../c-api/buffer.rst:540 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 " @@ -927,7 +1038,7 @@ msgstr "" "tamanho *len* com capacidade de escrita definida de acordo com *readonly*. " "*buf* é interpretada como uma sequência de bytes sem sinal." -#: ../../c-api/buffer.rst:533 +#: ../../c-api/buffer.rst:544 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-" @@ -937,7 +1048,7 @@ msgstr "" "*view* como especificado por *flags*, a não ser que *buf* seja designado " "como somente leitura e :c:macro:`PyBUF_WRITABLE` esteja definido em *flags*." -#: ../../c-api/buffer.rst:537 +#: ../../c-api/buffer.rst:548 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 " @@ -947,7 +1058,7 @@ msgstr "" "*exporter* e retorna 0. Caso contrário, levante :exc:`BufferError` , defina " "``view->obj`` para ``NULL`` e retorne ``-1`` ;" -#: ../../c-api/buffer.rst:541 +#: ../../c-api/buffer.rst:552 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 " @@ -978,14 +1089,14 @@ msgstr "objeto buffer" msgid "PyBufferProcs (C type)" msgstr "PyBufferProcs (tipo C)" -#: ../../c-api/buffer.rst:294 +#: ../../c-api/buffer.rst:305 msgid "contiguous" msgstr "contíguo" -#: ../../c-api/buffer.rst:294 +#: ../../c-api/buffer.rst:305 msgid "C-contiguous" msgstr "contíguo C" -#: ../../c-api/buffer.rst:294 +#: ../../c-api/buffer.rst:305 msgid "Fortran contiguous" msgstr "contíguo Fortran" diff --git a/c-api/bytearray.po b/c-api/bytearray.po index cc26922a9..60a25a054 100644 --- a/c-api/bytearray.po +++ b/c-api/bytearray.po @@ -1,26 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# msilvavieira, 2021 -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 +# Rafael Fontenelle , 2026 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-08-09 16:36+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-27 21:02+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2026\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -34,7 +34,19 @@ msgid "" msgstr "" "Esse subtipo de :c:type:`PyObject` representa um objeto Python bytearray." -#: ../../c-api/bytearray.rst:18 +#: ../../c-api/bytearray.rst:17 +msgid "" +"The internal buffer of :c:type:`PyByteArrayObject` always includes an extra " +"trailing null byte for compatibility with null terminated C strings. This " +"extra byte is not counted in :c:func:`PyByteArray_Size` nor in the *len* " +"arguments of the functions below." +msgstr "" +"O buffer interno de :c:type:`PyByteArrayObject` sempre inclui um byte nulo " +"adicional ao final para compatibilidade com strings C terminadas em nulo. " +"Esse byte extra não é contabilizado em :c:func:`PyByteArray_Size` nem nos " +"argumentos *len* das funções abaixo." + +#: ../../c-api/bytearray.rst:24 msgid "" "This instance of :c:type:`PyTypeObject` represents the Python bytearray " "type; it is the same object as :class:`bytearray` in the Python layer." @@ -42,11 +54,11 @@ msgstr "" "Essa instância de :c:type:`PyTypeObject` representa um tipo Python " "bytearray; é o mesmo objeto que o :class:`bytearray` na camada Python." -#: ../../c-api/bytearray.rst:23 +#: ../../c-api/bytearray.rst:29 msgid "Type check macros" msgstr "Macros para verificação de tipo" -#: ../../c-api/bytearray.rst:27 +#: ../../c-api/bytearray.rst:33 msgid "" "Return true if the object *o* is a bytearray object or an instance of a " "subtype of the bytearray type. This function always succeeds." @@ -54,7 +66,7 @@ msgstr "" "Retorna verdadeiro se o objeto *o* for um objeto bytearray ou se for uma " "instância de um subtipo do tipo bytearray. Esta função sempre tem sucesso." -#: ../../c-api/bytearray.rst:33 +#: ../../c-api/bytearray.rst:39 msgid "" "Return true if the object *o* is a bytearray object, but not an instance of " "a subtype of the bytearray type. This function always succeeds." @@ -62,41 +74,41 @@ msgstr "" "Retorna verdadeiro se o objeto *o* for um objeto bytearray, mas não uma " "instância de um subtipo do tipo bytearray. Esta função sempre tem sucesso." -#: ../../c-api/bytearray.rst:38 +#: ../../c-api/bytearray.rst:44 msgid "Direct API functions" msgstr "Funções diretas da API" -#: ../../c-api/bytearray.rst:42 +#: ../../c-api/bytearray.rst:48 msgid "" -"Return a new bytearray object from any object, *o*, that implements the :ref:" -"`buffer protocol `." +"Return a new bytearray object from any object, *o*, that implements " +"the :ref:`buffer protocol `." msgstr "" "Retorna um novo objeto bytearray, *o*, que implementa o :ref:`protocolo de " "buffer`." -#: ../../c-api/bytearray.rst:45 ../../c-api/bytearray.rst:52 -#: ../../c-api/bytearray.rst:59 +#: ../../c-api/bytearray.rst:51 ../../c-api/bytearray.rst:58 +#: ../../c-api/bytearray.rst:65 msgid "On failure, return ``NULL`` with an exception set." msgstr "Em caso de falha, retorna ``NULL`` com uma exceção definida." -#: ../../c-api/bytearray.rst:50 +#: ../../c-api/bytearray.rst:56 msgid "Create a new bytearray object from *string* and its length, *len*." msgstr "" "Cria um novo objeto bytearray a partir de *string* e seu comprimento, *len*." -#: ../../c-api/bytearray.rst:57 +#: ../../c-api/bytearray.rst:63 msgid "" "Concat bytearrays *a* and *b* and return a new bytearray with the result." msgstr "" "Concatena os bytearrays *a* e *b* e retorna um novo bytearray com o " "resultado." -#: ../../c-api/bytearray.rst:64 +#: ../../c-api/bytearray.rst:70 msgid "Return the size of *bytearray* after checking for a ``NULL`` pointer." msgstr "" "Retorna o tamanho de *bytearray* após verificar se há um ponteiro ``NULL``." -#: ../../c-api/bytearray.rst:69 +#: ../../c-api/bytearray.rst:75 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." @@ -105,24 +117,24 @@ msgstr "" "verificar um ponteiro ``NULL``. O array retornado sempre tem um byte nulo " "extra acrescentado." -#: ../../c-api/bytearray.rst:76 +#: ../../c-api/bytearray.rst:82 msgid "Resize the internal buffer of *bytearray* to *len*." msgstr "Redimensiona o buffer interno de *bytearray* para o tamanho *len*." -#: ../../c-api/bytearray.rst:79 +#: ../../c-api/bytearray.rst:85 msgid "Macros" msgstr "Macros" -#: ../../c-api/bytearray.rst:81 +#: ../../c-api/bytearray.rst:87 msgid "These macros trade safety for speed and they don't check pointers." msgstr "" "Estas macros trocam segurança por velocidade e não verificam os ponteiros." -#: ../../c-api/bytearray.rst:85 +#: ../../c-api/bytearray.rst:91 msgid "Similar to :c:func:`PyByteArray_AsString`, but without error checking." msgstr "Similar a :c:func:`PyByteArray_AsString`, mas sem verificação de erro." -#: ../../c-api/bytearray.rst:90 +#: ../../c-api/bytearray.rst:96 msgid "Similar to :c:func:`PyByteArray_Size`, but without error checking." msgstr "Similar a :c:func:`PyByteArray_Size`, mas sem verificação de erro." diff --git a/c-api/bytes.po b/c-api/bytes.po index eb16cc821..7f3cc0bc9 100644 --- a/c-api/bytes.po +++ b/c-api/bytes.po @@ -1,32 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Tiago Henrique , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Julio Gadioli Soares , 2021 -# Marco Rougeth , 2023 -# Rafael Fontenelle , 2023 -# Victor D. G., 2023 -# Adorilson Bezerra , 2024 +# Rafael Fontenelle , 2025 +# python-doc bot, 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-31 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Adorilson Bezerra , 2024\n" +"POT-Creation-Date: 2026-10-25 19:05+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: python-doc bot, 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -42,13 +36,21 @@ msgstr "" "Estas funções levantam :exc:`TypeError` quando se espera um parâmetro bytes " "e são chamados com um parâmetro que não é bytes." -#: ../../c-api/bytes.rst:16 +#: ../../c-api/bytes.rst:13 +msgid "" +"The internal buffer of :c:type:`PyBytesObject` always includes an extra " +"trailing null byte for compatibility with null terminated C strings. This " +"extra byte is not counted in :c:func:`PyBytes_Size` nor in the various " +"*length* and *size* arguments of the functions below." +msgstr "" + +#: ../../c-api/bytes.rst:23 msgid "This subtype of :c:type:`PyObject` represents a Python bytes object." msgstr "" "Esta é uma instância de :c:type:`PyObject` representando o objeto bytes do " "Python." -#: ../../c-api/bytes.rst:21 +#: ../../c-api/bytes.rst:28 msgid "" "This instance of :c:type:`PyTypeObject` represents the Python bytes type; it " "is the same object as :class:`bytes` in the Python layer." @@ -56,7 +58,7 @@ msgstr "" "Esta instância de :c:type:`PyTypeObject` representa o tipo de bytes Python; " "é o mesmo objeto que :class:`bytes` na camada de Python." -#: ../../c-api/bytes.rst:27 +#: ../../c-api/bytes.rst:34 msgid "" "Return true if the object *o* is a bytes object or an instance of a subtype " "of the bytes type. This function always succeeds." @@ -64,7 +66,7 @@ msgstr "" "Retorna verdadeiro se o objeto *o* for um objeto bytes ou se for uma " "instância de um subtipo do tipo bytes. Esta função sempre tem sucesso." -#: ../../c-api/bytes.rst:33 +#: ../../c-api/bytes.rst:40 msgid "" "Return true if the object *o* is a bytes object, but not an instance of a " "subtype of the bytes type. This function always succeeds." @@ -72,7 +74,7 @@ msgstr "" "Retorna verdadeiro se o objeto *o* for um objeto bytes, mas não uma " "instância de um subtipo do tipo bytes. Esta função sempre tem sucesso." -#: ../../c-api/bytes.rst:39 +#: ../../c-api/bytes.rst:46 msgid "" "Return a new bytes object with a copy of the string *v* as value on success, " "and ``NULL`` on failure. The parameter *v* must not be ``NULL``; it will " @@ -82,7 +84,7 @@ msgstr "" "caso de sucesso e ``NULL`` em caso de falha. O parâmetro *v* não deve ser " "``NULL`` e isso não será verificado." -#: ../../c-api/bytes.rst:46 +#: ../../c-api/bytes.rst:53 msgid "" "Return a new bytes object with a copy of the string *v* as value and length " "*len* on success, and ``NULL`` on failure. If *v* is ``NULL``, the contents " @@ -92,7 +94,7 @@ msgstr "" "comprimento *len* em caso de sucesso e ``NULL`` em caso de falha. Se *v* for " "``NULL``, o conteúdo do objeto bytes não será inicializado." -#: ../../c-api/bytes.rst:53 +#: ../../c-api/bytes.rst:60 msgid "" "Take a C :c:func:`printf`\\ -style *format* string and a variable number of " "arguments, calculate the size of the resulting Python bytes object and " @@ -107,148 +109,148 @@ msgstr "" "devem ser tipos C e devem corresponder exatamente aos caracteres de formato " "na string *format*. Os seguintes formatos de caracteres são permitidos:" -#: ../../c-api/bytes.rst:65 +#: ../../c-api/bytes.rst:72 msgid "Format Characters" msgstr "Caracteres Formatados" -#: ../../c-api/bytes.rst:65 +#: ../../c-api/bytes.rst:72 msgid "Type" msgstr "Tipo" -#: ../../c-api/bytes.rst:65 +#: ../../c-api/bytes.rst:72 msgid "Comment" msgstr "Comentário" -#: ../../c-api/bytes.rst:67 +#: ../../c-api/bytes.rst:74 msgid "``%%``" msgstr "``%%``" -#: ../../c-api/bytes.rst:67 +#: ../../c-api/bytes.rst:74 msgid "*n/a*" msgstr "*n/d*" -#: ../../c-api/bytes.rst:67 +#: ../../c-api/bytes.rst:74 msgid "The literal % character." msgstr "O caractere literal %." -#: ../../c-api/bytes.rst:69 +#: ../../c-api/bytes.rst:76 msgid "``%c``" msgstr "``%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:76 ../../c-api/bytes.rst:79 ../../c-api/bytes.rst:97 +#: ../../c-api/bytes.rst:100 msgid "int" msgstr "int" -#: ../../c-api/bytes.rst:69 +#: ../../c-api/bytes.rst:76 msgid "A single byte, represented as a C int." msgstr "Um único byte, representado como um C int." -#: ../../c-api/bytes.rst:72 +#: ../../c-api/bytes.rst:79 msgid "``%d``" msgstr "``%d``" -#: ../../c-api/bytes.rst:72 +#: ../../c-api/bytes.rst:79 msgid "Equivalent to ``printf(\"%d\")``. [1]_" msgstr "Equivalente a ``printf(\"%d\")``. [1]_" -#: ../../c-api/bytes.rst:75 +#: ../../c-api/bytes.rst:82 msgid "``%u``" msgstr "``%u``" -#: ../../c-api/bytes.rst:75 +#: ../../c-api/bytes.rst:82 msgid "unsigned int" msgstr "unsigned int" -#: ../../c-api/bytes.rst:75 +#: ../../c-api/bytes.rst:82 msgid "Equivalent to ``printf(\"%u\")``. [1]_" msgstr "Equivalente a ``printf(\"%u\")``. [1]_" -#: ../../c-api/bytes.rst:78 +#: ../../c-api/bytes.rst:85 msgid "``%ld``" msgstr "``%ld``" -#: ../../c-api/bytes.rst:78 +#: ../../c-api/bytes.rst:85 msgid "long" msgstr "long" -#: ../../c-api/bytes.rst:78 +#: ../../c-api/bytes.rst:85 msgid "Equivalent to ``printf(\"%ld\")``. [1]_" msgstr "Equivalente a ``printf(\"%ld\")``. [1]_" -#: ../../c-api/bytes.rst:81 +#: ../../c-api/bytes.rst:88 msgid "``%lu``" msgstr "``%lu``" -#: ../../c-api/bytes.rst:81 +#: ../../c-api/bytes.rst:88 msgid "unsigned long" msgstr "unsigned long" -#: ../../c-api/bytes.rst:81 +#: ../../c-api/bytes.rst:88 msgid "Equivalent to ``printf(\"%lu\")``. [1]_" msgstr "Equivalente a ``printf(\"%lu\")``. [1]_" -#: ../../c-api/bytes.rst:84 +#: ../../c-api/bytes.rst:91 msgid "``%zd``" msgstr "``%zd``" -#: ../../c-api/bytes.rst:84 +#: ../../c-api/bytes.rst:91 msgid ":c:type:`\\ Py_ssize_t`" msgstr ":c:type:`\\ Py_ssize_t`" -#: ../../c-api/bytes.rst:84 +#: ../../c-api/bytes.rst:91 msgid "Equivalent to ``printf(\"%zd\")``. [1]_" msgstr "Equivalente a ``printf(\"%zd\")``. [1]_" -#: ../../c-api/bytes.rst:87 +#: ../../c-api/bytes.rst:94 msgid "``%zu``" msgstr "``%zu``" -#: ../../c-api/bytes.rst:87 +#: ../../c-api/bytes.rst:94 msgid "size_t" msgstr "size_t" -#: ../../c-api/bytes.rst:87 +#: ../../c-api/bytes.rst:94 msgid "Equivalent to ``printf(\"%zu\")``. [1]_" msgstr "Equivalente a ``printf(\"%zu\")``. [1]_" -#: ../../c-api/bytes.rst:90 +#: ../../c-api/bytes.rst:97 msgid "``%i``" msgstr "``%i``" -#: ../../c-api/bytes.rst:90 +#: ../../c-api/bytes.rst:97 msgid "Equivalent to ``printf(\"%i\")``. [1]_" msgstr "Equivalente a ``printf(\"%i\")``. [1]_" -#: ../../c-api/bytes.rst:93 +#: ../../c-api/bytes.rst:100 msgid "``%x``" msgstr "``%x``" -#: ../../c-api/bytes.rst:93 +#: ../../c-api/bytes.rst:100 msgid "Equivalent to ``printf(\"%x\")``. [1]_" msgstr "Equivalente a ``printf(\"%x\")``. [1]_" -#: ../../c-api/bytes.rst:96 +#: ../../c-api/bytes.rst:103 msgid "``%s``" msgstr "``%s``" -#: ../../c-api/bytes.rst:96 +#: ../../c-api/bytes.rst:103 msgid "const char\\*" msgstr "const char\\*" -#: ../../c-api/bytes.rst:96 +#: ../../c-api/bytes.rst:103 msgid "A null-terminated C character array." msgstr "Uma matriz de caracteres C com terminação nula." -#: ../../c-api/bytes.rst:99 +#: ../../c-api/bytes.rst:106 msgid "``%p``" msgstr "``%p``" -#: ../../c-api/bytes.rst:99 +#: ../../c-api/bytes.rst:106 msgid "const void\\*" msgstr "const void\\*" -#: ../../c-api/bytes.rst:99 +#: ../../c-api/bytes.rst:106 msgid "" "The hex representation of a C pointer. Mostly equivalent to " "``printf(\"%p\")`` except that it is guaranteed to start with the literal " @@ -258,7 +260,7 @@ msgstr "" "``printf(\"%p\")`` exceto que é garantido que comece com o literal ``0x`` " "independentemente do que o ``printf`` da plataforma ceda." -#: ../../c-api/bytes.rst:108 +#: ../../c-api/bytes.rst:115 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." @@ -267,7 +269,7 @@ msgstr "" "de formato seja copiado como é para o objeto resultante e todos os " "argumentos extras sejam descartados." -#: ../../c-api/bytes.rst:111 +#: ../../c-api/bytes.rst:118 msgid "" "For integer specifiers (d, u, ld, lu, zd, zu, i, x): the 0-conversion flag " "has effect even when a precision is given." @@ -275,7 +277,7 @@ msgstr "" "Para especificadores de número inteiro (d, u, ld, lu, zd, zu, i, x): o " "sinalizador de conversão 0 tem efeito mesmo quando uma precisão é fornecida." -#: ../../c-api/bytes.rst:117 +#: ../../c-api/bytes.rst:124 msgid "" "Identical to :c:func:`PyBytes_FromFormat` except that it takes exactly two " "arguments." @@ -283,7 +285,7 @@ msgstr "" "Idêntico a :c:func:`PyBytes_FromFormat` exceto que é preciso exatamente dois " "argumentos." -#: ../../c-api/bytes.rst:123 +#: ../../c-api/bytes.rst:130 msgid "" "Return the bytes representation of object *o* that implements the buffer " "protocol." @@ -291,23 +293,23 @@ msgstr "" "Retorna a representação de bytes do objeto *o* que implementa o protocolo de " "buffer." -#: ../../c-api/bytes.rst:129 +#: ../../c-api/bytes.rst:136 msgid "Return the length of the bytes in bytes object *o*." msgstr "Retorna o comprimento dos bytes em objeto bytes *o*." -#: ../../c-api/bytes.rst:134 +#: ../../c-api/bytes.rst:141 msgid "Similar to :c:func:`PyBytes_Size`, but without error checking." msgstr "Similar a :c:func:`PyBytes_Size`, mas sem verificação de erro." -#: ../../c-api/bytes.rst:139 +#: ../../c-api/bytes.rst:146 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 " "buffer is always null, regardless of whether there are any other null " "bytes. The data must not be modified in any way, unless the object was just " "created using ``PyBytes_FromStringAndSize(NULL, size)``. It must not be " -"deallocated. If *o* is not a bytes object at all, :c:func:" -"`PyBytes_AsString` returns ``NULL`` and raises :exc:`TypeError`." +"deallocated. If *o* is not a bytes object at " +"all, :c:func:`PyBytes_AsString` returns ``NULL`` and raises :exc:`TypeError`." msgstr "" "Retorna um ponteiro para o conteúdo de *o*. O ponteiro se refere ao buffer " "interno de *o*, que consiste em ``len(o) + 1`` bytes. O último byte no " @@ -317,11 +319,11 @@ msgstr "" "desalocado. Se *o* não é um objeto de bytes, :c:func:`PyBytes_AsString` " "retorna ``NULL`` e levanta :exc:`TypeError`." -#: ../../c-api/bytes.rst:151 +#: ../../c-api/bytes.rst:158 msgid "Similar to :c:func:`PyBytes_AsString`, but without error checking." msgstr "Similar a :c:func:`PyBytes_AsString`, mas sem verificação de erro." -#: ../../c-api/bytes.rst:156 +#: ../../c-api/bytes.rst:163 msgid "" "Return the null-terminated contents of the object *obj* through the output " "variables *buffer* and *length*. Returns ``0`` on success." @@ -329,17 +331,17 @@ msgstr "" "Retorna os conteúdos terminados nulos do objeto *obj* através das variáveis " "de saída *buffer* e *length*. Retorna ``0`` em caso de sucesso." -#: ../../c-api/bytes.rst:160 +#: ../../c-api/bytes.rst:167 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 " "raised." msgstr "" "Se *length* for ``NULL``, o objeto bytes não poderá conter bytes nulos " -"incorporados; se isso acontecer, a função retornará ``-1`` e a :exc:" -"`ValueError` será levantado." +"incorporados; se isso acontecer, a função retornará ``-1`` e " +"a :exc:`ValueError` será levantado." -#: ../../c-api/bytes.rst:164 +#: ../../c-api/bytes.rst:171 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 " @@ -355,7 +357,7 @@ msgstr "" "Se *obj* não é um objeto bytes, :c:func:`PyBytes_AsStringAndSize` retorna " "``-1`` e levanta :exc:`TypeError`." -#: ../../c-api/bytes.rst:171 +#: ../../c-api/bytes.rst:178 msgid "" "Previously, :exc:`TypeError` was raised when embedded null bytes were " "encountered in the bytes object." @@ -363,22 +365,17 @@ msgstr "" "Anteriormente :exc:`TypeError` era levantado quando os bytes nulos " "incorporados eram encontrados no objeto bytes." -#: ../../c-api/bytes.rst:178 +#: ../../c-api/bytes.rst:185 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 " -"to the old value of *bytes* will be stolen. If the new object cannot be " -"created, the old reference to *bytes* will still be discarded and the value " -"of *\\*bytes* will be set to ``NULL``; the appropriate exception will be set." +"appended to *bytes*; the caller will own the new reference. The reference to " +"the old value of *bytes* will be \":term:`stolen `\". If the new " +"object cannot be created, the old reference to *bytes* will still be " +"\"stolen\", the value of *\\*bytes* will be set to ``NULL``, and the " +"appropriate exception will be set." msgstr "" -"Cria um novo objeto de bytes em *\\*bytes* contendo o conteúdo de *newpart* " -"anexado a *bytes*; o chamador será o proprietário da nova referência. A " -"referência ao valor antigo de *bytes* será roubada. Se o novo objeto não " -"puder ser criado, a antiga referência a *bytes* ainda será descartada e o " -"valor de *\\*bytes* será definido como ``NULL``; a exceção apropriada será " -"definida." - -#: ../../c-api/bytes.rst:187 + +#: ../../c-api/bytes.rst:195 msgid "" "Create a new bytes object in *\\*bytes* containing the contents of *newpart* " "appended to *bytes*. This version releases the :term:`strong reference` to " @@ -388,7 +385,7 @@ msgstr "" "anexado a bytes. Esta versão libera a :term:`strong reference` (referência " "forte) para newpart (ou seja, decrementa a contagem de referências a ele).\"" -#: ../../c-api/bytes.rst:194 +#: ../../c-api/bytes.rst:202 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 " @@ -406,13 +403,84 @@ msgstr "" "o novo tamanho desejado. Em caso de sucesso, *\\*bytes* mantém o objeto de " "bytes redimensionados e ``0`` é retornado; o endereço em *\\*bytes* pode " "diferir do seu valor de entrada. Se a realocação falhar, o objeto de bytes " -"originais em *\\*bytes* é desalocado, *\\*bytes* é definido como ``NULL``, :" -"exc:`MemoryError` é definido e ``-1`` é retornado." +"originais em *\\*bytes* é desalocado, *\\*bytes* é definido como " +"``NULL``, :exc:`MemoryError` é definido e ``-1`` é retornado." + +#: ../../c-api/bytes.rst:216 +msgid "" +"Get the string representation of *bytes*. This function is currently used to " +"implement :meth:`!bytes.__repr__` in Python." +msgstr "" +"Obtém a representação em string de *bytes*. Esta função é atualmente usada " +"para implementar :meth:`!bytes.__repr__` em Python." + +#: ../../c-api/bytes.rst:219 +msgid "" +"This function does not do type checking; it is undefined behavior to pass " +"*bytes* as a non-bytes object or ``NULL``." +msgstr "" +"Esta função não realiza verificação de tipo; é um comportamento indefinido " +"passar *bytes* como um objeto que não seja do tipo bytes ou ``NULL``." + +#: ../../c-api/bytes.rst:222 +msgid "" +"If *smartquotes* is true, the representation will use a double-quoted string " +"instead of single-quoted string when single-quotes are present in *bytes*. " +"For example, the byte string ``'Python'`` would be represented as " +"``b\"'Python'\"`` when *smartquotes* is true, or ``b'\\'Python\\''`` when it " +"is false." +msgstr "" +"Se *smartquotes* for verdadeiro, a representação usará uma string entre " +"aspas duplas em vez de aspas simples quando aspas simples estiverem " +"presentes em *bytes*. Por exemplo, a string de bytes ``'Python'`` seria " +"representada como ``b\"'Python'\"`` quando *smartquotes* for verdadeiro, ou " +"``b'\\'Python\\''`` quando for falso." + +#: ../../c-api/bytes.rst:228 +msgid "" +"On success, this function returns a :term:`strong reference` to " +"a :class:`str` object containing the representation. On failure, this " +"returns ``NULL`` with an exception set." +msgstr "" +"Em caso de sucesso, esta função retorna uma :term:`referência forte` a um " +"objeto :class:`str` contendo a representação. Em caso de falha, ela retorna " +"``NULL`` com uma exceção definida." + +#: ../../c-api/bytes.rst:235 +msgid "" +"Unescape a backslash-escaped string *s*. *s* must not be ``NULL``. *len* " +"must be the size of *s*." +msgstr "" +"Remove um string *s* que foi escapada com contrabarra. *s* não pode ser " +"``NULL``. *len* deve ser o tamanho de *s*." + +#: ../../c-api/bytes.rst:238 +msgid "" +"*errors* must be one of ``\"strict\"``, ``\"replace\"``, or ``\"ignore\"``. " +"If *errors* is ``NULL``, then ``\"strict\"`` is used by default." +msgstr "" +"*errors* deve ser um dos seguintes valores: ``\"strict\"``, ``\"replace\"`` " +"ou ``\"ignore\"``. Se *errors* for ``NULL``, o valor padrão será " +"``\"strict\"``." + +#: ../../c-api/bytes.rst:241 +msgid "" +"On success, this function returns a :term:`strong reference` to a " +"Python :class:`bytes` object containing the unescaped string. On failure, " +"this function returns ``NULL`` with an exception set." +msgstr "" +"Em caso de sucesso, esta função retorna uma :term:`referência forte` a um " +"objeto Python :class:`bytes` contendo a string sem escape. Em caso de falha, " +"esta função retorna ``NULL`` com uma exceção definida." + +#: ../../c-api/bytes.rst:245 +msgid "*unicode* and *recode_encoding* are now unused." +msgstr "*unicode* e *recode_encoding* não são mais usadas." -#: ../../c-api/bytes.rst:11 +#: ../../c-api/bytes.rst:18 msgid "object" msgstr "objeto" -#: ../../c-api/bytes.rst:11 +#: ../../c-api/bytes.rst:18 msgid "bytes" msgstr "bytes" diff --git a/c-api/call.po b/c-api/call.po index e9470409d..30c625650 100644 --- a/c-api/call.po +++ b/c-api/call.po @@ -1,32 +1,27 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Renan Lopes , 2024 -# Alexandre B A Villares, 2024 -# Mozart Dias Martins, 2024 -# Adorilson Bezerra , 2024 -# Flávio Neves, 2024 -# Claudio Rogerio Carvalho Filho , 2024 -# Ana Carolina Dias, 2024 -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 +# Angelo Siqueira, 2026 +# Rafael Fontenelle , 2026 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-17 14:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2026\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -51,6 +46,12 @@ msgstr "" "Instâncias de classe que definem :c:member:`~PyTypeObject.tp_call` são " "chamáveis. A assinatura do slot é::" +#: ../../c-api/call.rst:17 +msgid "" +"PyObject *tp_call(PyObject *callable, PyObject *args, PyObject *kwargs);" +msgstr "" +"PyObject *tp_call(PyObject *callable, PyObject *args, PyObject *kwargs);" + #: ../../c-api/call.rst:19 msgid "" "A call is made using a tuple for the positional arguments and a dict for the " @@ -66,20 +67,21 @@ msgstr "" #: ../../c-api/call.rst:25 msgid "" -"This convention is not only used by *tp_call*: :c:member:`~PyTypeObject." -"tp_new` and :c:member:`~PyTypeObject.tp_init` also pass arguments this way." +"This convention is not only used by " +"*tp_call*: :c:member:`~PyTypeObject.tp_new` " +"and :c:member:`~PyTypeObject.tp_init` also pass arguments this way." msgstr "" -"Esta convenção não é somente usada por *tp_call*: :c:member:`~PyTypeObject." -"tp_new` e :c:member:`~PyTypeObject.tp_init` também passam argumento dessa " -"forma." +"Esta convenção não é somente usada por " +"*tp_call*: :c:member:`~PyTypeObject.tp_new` " +"e :c:member:`~PyTypeObject.tp_init` também passam argumento dessa forma." #: ../../c-api/call.rst:29 msgid "" "To call an object, use :c:func:`PyObject_Call` or another :ref:`call API " "`." msgstr "" -"Para chamar um objeto, use :c:func:`PyObject_Call` ou outra :ref:`call API " -"`." +"Para chamar um objeto, use :c:func:`PyObject_Call` ou outra :ref:`API de " +"chamada `." #: ../../c-api/call.rst:36 msgid "The Vectorcall Protocol" @@ -97,30 +99,31 @@ msgstr "" msgid "" "As rule of thumb, CPython will prefer the vectorcall for internal calls if " "the callable supports it. However, this is not a hard rule. Additionally, " -"some third-party extensions use *tp_call* directly (rather than using :c:" -"func:`PyObject_Call`). Therefore, a class supporting vectorcall must also " -"implement :c:member:`~PyTypeObject.tp_call`. Moreover, the callable must " -"behave the same regardless of which protocol is used. The recommended way to " -"achieve this is by setting :c:member:`~PyTypeObject.tp_call` to :c:func:" -"`PyVectorcall_Call`. This bears repeating:" -msgstr "" -"Como regra de bolso. CPython vai preferir o vectorcall para invocações " -"internas se o chamável suportar. Entretanto, isso não é uma regra rígida. " -"Ademais, alguma extensões de terceiros usam diretamente *tp_call* (em vez " -"de utilizar :c:func:`PyObject_Call`). Portanto, uma classe que suporta " +"some third-party extensions use *tp_call* directly (rather than " +"using :c:func:`PyObject_Call`). Therefore, a class supporting vectorcall " +"must also implement :c:member:`~PyTypeObject.tp_call`. Moreover, the " +"callable must behave the same regardless of which protocol is used. The " +"recommended way to achieve this is by " +"setting :c:member:`~PyTypeObject.tp_call` to :c:func:`PyVectorcall_Call`. " +"This bears repeating:" +msgstr "" +"Como regra de ouro, CPython vai preferir o vectorcall para chamadas internas " +"se o chamável suportar. Entretanto, isso não é uma regra rígida. Ademais, " +"alguma extensões de terceiros usam *tp_call* diretamente (em vez de " +"utilizar :c:func:`PyObject_Call`). Portanto, uma classe que suporta " "vectorcall precisa também implementar :c:member:`~PyTypeObject.tp_call`. " "Além disso, o chamável precisa se comportar da mesma forma independe de qual " -"protocolo é utilizado. A forma recomendada de alcançar isso é definindo :c:" -"member:`~PyTypeObject.tp_call` para :c:func:`PyVectorcall_Call`. Vale a pena " -"repetir:" +"protocolo é utilizado. A forma recomendada de alcançar isso é " +"definindo :c:member:`~PyTypeObject.tp_call` " +"para :c:func:`PyVectorcall_Call`. Vale a pena repetir:" #: ../../c-api/call.rst:57 msgid "" -"A class supporting vectorcall **must** also implement :c:member:" -"`~PyTypeObject.tp_call` with the same semantics." +"A class supporting vectorcall **must** also " +"implement :c:member:`~PyTypeObject.tp_call` with the same semantics." msgstr "" -"Uma classe que suporte vectorcall também **precisa** implementar :c:member:" -"`~PyTypeObject.tp_call` com a mesma semântica." +"Uma classe que suporte vectorcall também **precisa** " +"implementar :c:member:`~PyTypeObject.tp_call` com a mesma semântica." #: ../../c-api/call.rst:62 msgid "" @@ -131,12 +134,12 @@ msgid "" "versions, vectorcall should only be used with :c:macro:`immutable " "` or static types." msgstr "" -"O sinalizador :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` agora é removida da " +"O sinalizador :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` agora é removido da " "classe quando o método :py:meth:`~object.__call__` está reatribuído. " "(Internamente, isso apenas define :c:member:`~PyTypeObject.tp_call`, e " -"portanto, pode fazê-lo comportar-se de forma diferente da função vetorcall. " -"Em versões anteriores do Python, vectorcall só deve ser usado com tipos :c:" -"macro:`imutáveis ` ou estáticos." +"portanto, pode fazê-lo comportar-se de forma diferente da função vectorcall. " +"Em versões anteriores do Python, vectorcall só deve ser usado com " +"tipos :c:macro:`imutáveis ` ou estáticos." #: ../../c-api/call.rst:69 msgid "" @@ -152,17 +155,17 @@ msgstr "" #: ../../c-api/call.rst:74 msgid "" -"Classes can implement the vectorcall protocol by enabling the :c:macro:" -"`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:" +"Classes can implement the vectorcall protocol by enabling " +"the :c:macro:`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 "" -"Classes podem implementar o protocolo vectorcall ativando o sinalizador :c:" -"macro:`Py_TPFLAGS_HAVE_VECTORCALL` e configurando :c:member:`~PyTypeObject." -"tp_vectorcall_offset` para o offset dentro da estrutura do objeto onde uma " -"*vectorcallfunc* aparece. Este é um ponteiro para uma função com a seguinte " -"assinatura:" +"Classes podem implementar o protocolo vectorcall ativando o " +"sinalizador :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` e " +"configurando :c:member:`~PyTypeObject.tp_vectorcall_offset` para o offset " +"dentro da estrutura do objeto onde uma *vectorcallfunc* aparece. Este é um " +"ponteiro para uma função com a seguinte assinatura:" #: ../../c-api/call.rst:82 msgid "*callable* is the object being called." @@ -235,10 +238,10 @@ msgid "" "include a prepended *self* argument) very efficiently." msgstr "" "Sempre que podem realizar a um custo tão baixo (sem alocações adicionais), " -"invocadores são encorajados a usar :c:macro:" -"`PY_VECTORCALL_ARGUMENTS_OFFSET`. Isso permitirá invocados como métodos " -"vinculados a instâncias fazerem suas próprias invocações (o que inclui um " -"argumento *self*) muito eficientemente." +"invocadores são encorajados a " +"usar :c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`. Isso permitirá invocados " +"como métodos vinculados a instâncias fazerem suas próprias invocações (o que " +"inclui um argumento *self*) muito eficientemente." #: ../../c-api/call.rst:113 msgid "" @@ -246,9 +249,9 @@ msgid "" "call>` function as with any other callable. :c:func:`PyObject_Vectorcall` " "will usually be most efficient." msgstr "" -"Para invocar um objeto que implementa vectorcall, utilize a função :ref:" -"`call API ` como qualquer outra invocável. :c:func:" -"`PyObject_Vectorcall` será normalmente mais eficiente." +"Para invocar um objeto que implementa vectorcall, utilize a " +"função :ref:`call API ` como qualquer outra " +"invocável. :c:func:`PyObject_Vectorcall` será normalmente mais eficiente." #: ../../c-api/call.rst:119 msgid "Recursion Control" @@ -257,12 +260,13 @@ msgstr "Controle de recursão" #: ../../c-api/call.rst:121 msgid "" "When using *tp_call*, callees do not need to worry about :ref:`recursion " -"`: CPython uses :c:func:`Py_EnterRecursiveCall` and :c:func:" -"`Py_LeaveRecursiveCall` for calls made using *tp_call*." +"`: CPython uses :c:func:`Py_EnterRecursiveCall` " +"and :c:func:`Py_LeaveRecursiveCall` for calls made using *tp_call*." msgstr "" -"Quando utilizando *tp_call*, invocadores não precisam se preocupar sobre :" -"ref:`recursão `: CPython usa :c:func:`Py_EnterRecursiveCall` e :c:" -"func:`Py_LeaveRecursiveCall` para chamadas utilizando *tp_call*." +"Quando utilizando *tp_call*, invocadores não precisam se preocupar " +"sobre :ref:`recursão `: CPython " +"usa :c:func:`Py_EnterRecursiveCall` e :c:func:`Py_LeaveRecursiveCall` para " +"chamadas utilizando *tp_call*." #: ../../c-api/call.rst:126 msgid "" @@ -286,6 +290,10 @@ msgstr "" "Dado um argumento de chamada de vetor *nargsf*, retorna o número real de " "argumentos. Atualmente equivalente a::" +#: ../../c-api/call.rst:140 +msgid "(Py_ssize_t)(nargsf & ~PY_VECTORCALL_ARGUMENTS_OFFSET)" +msgstr "(Py_ssize_t)(nargsf & ~PY_VECTORCALL_ARGUMENTS_OFFSET)" + #: ../../c-api/call.rst:142 msgid "" "However, the function ``PyVectorcall_NARGS`` should be used to allow for " @@ -324,15 +332,16 @@ msgstr "" #: ../../c-api/call.rst:164 msgid "" -"This is a specialized function, intended to be put in the :c:member:" -"`~PyTypeObject.tp_call` slot or be used in an implementation of ``tp_call``. " -"It does not check the :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag and it does " -"not fall back to ``tp_call``." +"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 not fall back to ``tp_call``." msgstr "" -"Esta é uma função especializada, feita para ser colocada no slot :c:member:" -"`~PyTypeObject.tp_call` ou usada em uma implementação de ``tp_call``. Ela " -"não verifica o sinalizador :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` e não " -"retorna para ``tp_call``." +"Esta é uma função especializada, feita para ser colocada no " +"slot :c:member:`~PyTypeObject.tp_call` ou usada em uma implementação de " +"``tp_call``. Ela não verifica o " +"sinalizador :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` e não retorna para " +"``tp_call``." #: ../../c-api/call.rst:175 msgid "Object Calling API" @@ -425,7 +434,7 @@ msgstr ":c:func:`PyObject_CallFunction`" #: ../../c-api/call.rst:197 ../../c-api/call.rst:199 msgid "format" -msgstr "formato" +msgstr "format" #: ../../c-api/call.rst:199 msgid ":c:func:`PyObject_CallMethod`" @@ -499,7 +508,7 @@ msgstr "" #: ../../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:345 ../../c-api/call.rst:360 ../../c-api/call.rst:399 msgid "" "Return the result of the call on success, or raise an exception and return " "*NULL* on failure." @@ -556,11 +565,11 @@ msgstr "" #: ../../c-api/call.rst:276 msgid "" -"Note that if you only pass :c:expr:`PyObject *` args, :c:func:" -"`PyObject_CallFunctionObjArgs` is a faster alternative." +"Note that if you only pass :c:expr:`PyObject *` " +"args, :c:func:`PyObject_CallFunctionObjArgs` is a faster alternative." msgstr "" -"Note que se você apenas passa argumentos :c:expr:`PyObject *`, :c:func:" -"`PyObject_CallFunctionObjArgs` é uma alternativa mais rápida." +"Note que se você apenas passa argumentos :c:expr:`PyObject " +"*`, :c:func:`PyObject_CallFunctionObjArgs` é uma alternativa mais rápida." #: ../../c-api/call.rst:279 msgid "The type of *format* was changed from ``char *``." @@ -573,8 +582,8 @@ msgid "" "format string that should produce a tuple." msgstr "" "Chama o método chamado *name* do objeto *obj* com um número variável de " -"argumentos C. Os argumentos C são descritos com uma string de formato :c:" -"func:`Py_BuildValue` que deve produzir uma tupla." +"argumentos C. Os argumentos C são descritos com uma string de " +"formato :c:func:`Py_BuildValue` que deve produzir uma tupla." #: ../../c-api/call.rst:289 msgid "The format can be *NULL*, indicating that no arguments are provided." @@ -589,11 +598,11 @@ msgstr "" #: ../../c-api/call.rst:297 msgid "" -"Note that if you only pass :c:expr:`PyObject *` args, :c:func:" -"`PyObject_CallMethodObjArgs` is a faster alternative." +"Note that if you only pass :c:expr:`PyObject *` " +"args, :c:func:`PyObject_CallMethodObjArgs` is a faster alternative." msgstr "" -"Note que se você apenas passa argumentos :c:expr:`PyObject *`, :c:func:" -"`PyObject_CallMethodObjArgs` é uma alternativa mais rápida." +"Note que se você apenas passa argumentos :c:expr:`PyObject " +"*`, :c:func:`PyObject_CallMethodObjArgs` é uma alternativa mais rápida." #: ../../c-api/call.rst:300 msgid "The types of *name* and *format* were changed from ``char *``." @@ -601,9 +610,9 @@ msgstr "Os tipos de *name* e *format* foram mudados de ``char *``." #: ../../c-api/call.rst:306 msgid "" -"Call a callable Python object *callable*, with a variable number of :c:expr:" -"`PyObject *` arguments. The arguments are provided as a variable number of " -"parameters followed by *NULL*." +"Call a callable Python object *callable*, with a variable number " +"of :c:expr:`PyObject *` arguments. The arguments are provided as a variable " +"number of parameters followed by *NULL*." msgstr "" "Chama um objeto Python chamável de *callable*, com um número variável de " "argumentos :c:expr:`PyObject *`. Os argumentos são providos como um número " @@ -645,17 +654,29 @@ msgstr "" "Chama um método do objeto Python *obj* com um argumento posicional *arg*, " "onde o nome do método é fornecido como um objeto string do Python em *name*." -#: ../../c-api/call.rst:353 +#: ../../c-api/call.rst:355 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*." +"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 "" -"Chama um objeto Python chamável *callable*. Os argumentos são os mesmos de :" -"c:type:`vectorcallfunc`. Se *callable* tiver suporte a vectorcall_, isso " +"Chama um objeto Python chamável *callable*. Os argumentos são os mesmos " +"de :c:type:`vectorcallfunc`. Se *callable* tiver suporte a vectorcall_, isso " "chamará diretamente a função vectorcall armazenada em *callable*." -#: ../../c-api/call.rst:365 +#: ../../c-api/call.rst:363 +msgid "as ``_PyObject_Vectorcall``" +msgstr "como ``_PyObject_Vectorcall``" + +#: ../../c-api/call.rst:367 +msgid "" +"Renamed to the current name, without the leading underscore. The old " +"provisional name is :term:`soft deprecated`." +msgstr "" +"Renomeado para o nome atual, sem o sublinhado no início. O nome provisório " +"antigo está :term:`suavemente descontinuado`." + +#: ../../c-api/call.rst:372 msgid "" "Call *callable* with positional arguments passed exactly as in the " "vectorcall_ protocol, but with keyword arguments passed as a dictionary " @@ -665,7 +686,7 @@ msgstr "" "protocolo vectorcall_, mas com argumentos nomeados passados como um " "dicionário *kwdict*. O array *args* contém apenas os argumentos posicionais." -#: ../../c-api/call.rst:369 +#: ../../c-api/call.rst:376 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 " @@ -677,27 +698,27 @@ msgstr "" "chamador já tiver um dicionário pronto para usar para os argumentos " "nomeados, mas não uma tupla para os argumentos posicionais." -#: ../../c-api/call.rst:379 +#: ../../c-api/call.rst:386 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 " -"temporarily be changed. Keyword arguments can be passed just like in :c:func:" -"`PyObject_Vectorcall`." +"*nargsf* is the number of positional arguments including *args[0]*, " +"plus :c:macro:`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 "" "Chama um método usando a convenção de chamada vectorcall. O nome do método é " "dado como uma string Python *name*. O objeto cujo método é chamado é " "*args[0]*, e o array *args* começando em *args[1]* representa os argumentos " "da chamada. Deve haver pelo menos um argumento posicional. *nargsf* é o " -"número de argumentos posicionais incluindo *args[0]*, mais :c:macro:" -"`PY_VECTORCALL_ARGUMENTS_OFFSET` se o valor de ``args[0]`` puder ser " -"alterado temporariamente. Argumentos nomeados podem ser passados como em :c:" -"func:`PyObject_Vectorcall`." +"número de argumentos posicionais incluindo *args[0]*, " +"mais :c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET` se o valor de ``args[0]`` " +"puder ser alterado temporariamente. Argumentos nomeados podem ser passados " +"como em :c:func:`PyObject_Vectorcall`." -#: ../../c-api/call.rst:388 +#: ../../c-api/call.rst:395 msgid "" "If the object has the :c:macro:`Py_TPFLAGS_METHOD_DESCRIPTOR` feature, this " "will call the unbound method object with the full *args* vector as arguments." @@ -706,11 +727,11 @@ msgstr "" "chamar o objeto de método não vinculado com o vetor *args* inteiro como " "argumentos." -#: ../../c-api/call.rst:399 +#: ../../c-api/call.rst:406 msgid "Call Support API" msgstr "API de suporte a chamadas" -#: ../../c-api/call.rst:403 +#: ../../c-api/call.rst:410 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 c77038510..e0144f6e9 100644 --- a/c-api/capsule.po +++ b/c-api/capsule.po @@ -1,25 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 +# Rafael Fontenelle , 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-17 14:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -37,26 +38,38 @@ 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 which need to pass an opaque value (as a :c:expr:`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 "" "Este subtipo de :c:type:`PyObject` representa um valor opaco, útil para " -"módulos de extensão C que precisam passar um valor opaco (como ponteiro :c:" -"expr:`void*`) através do código Python para outro código C . É " +"módulos de extensão C que precisam passar um valor opaco (como " +"ponteiro :c:expr:`void*`) através do código Python para outro código C . É " "frequentemente usado para disponibilizar um ponteiro de função C definido em " "um módulo para outros módulos, para que o mecanismo de importação regular " "possa ser usado para acessar APIs C definidas em módulos carregados " "dinamicamente." #: ../../c-api/capsule.rst:27 +msgid "" +"The type object corresponding to capsule objects. This is the same object " +"as :class:`types.CapsuleType` in the Python layer." +msgstr "" +"O objeto de tipo correspondente aos objetos cápsula. Este é o mesmo objeto " +"que :class:`types.CapsuleType` na camada Python." + +#: ../../c-api/capsule.rst:33 msgid "The type of a destructor callback for a capsule. Defined as::" msgstr "" "O tipo de um retorno de chamada destruidor para uma cápsula. Definido como::" -#: ../../c-api/capsule.rst:31 +#: ../../c-api/capsule.rst:35 +msgid "typedef void (*PyCapsule_Destructor)(PyObject *);" +msgstr "typedef void (*PyCapsule_Destructor)(PyObject *);" + +#: ../../c-api/capsule.rst:37 msgid "" "See :c:func:`PyCapsule_New` for the semantics of PyCapsule_Destructor " "callbacks." @@ -64,7 +77,7 @@ msgstr "" "Veja :c:func:`PyCapsule_New` para a semântica dos retornos de chamada " "PyCapsule_Destructor." -#: ../../c-api/capsule.rst:37 +#: ../../c-api/capsule.rst:43 msgid "" "Return true if its argument is a :c:type:`PyCapsule`. This function always " "succeeds." @@ -72,7 +85,7 @@ msgstr "" "Retorna true se seu argumento é um :c:type:`PyCapsule`. Esta função sempre " "tem sucesso." -#: ../../c-api/capsule.rst:43 +#: ../../c-api/capsule.rst:49 msgid "" "Create a :c:type:`PyCapsule` encapsulating the *pointer*. The *pointer* " "argument may not be ``NULL``." @@ -80,11 +93,11 @@ msgstr "" "Cria um :c:type:`PyCapsule` que encapsula o *ponteiro*. O argumento " "*pointer* pode não ser ``NULL``." -#: ../../c-api/capsule.rst:46 +#: ../../c-api/capsule.rst:52 msgid "On failure, set an exception and return ``NULL``." msgstr "Em caso de falha, define uma exceção e retorna ``NULL``." -#: ../../c-api/capsule.rst:48 +#: ../../c-api/capsule.rst:54 msgid "" "The *name* string may either be ``NULL`` or a pointer to a valid C string. " "If non-``NULL``, this string must outlive the capsule. (Though it is " @@ -94,7 +107,7 @@ msgstr "" "Se não for ``NULL``, essa string deverá sobreviver à cápsula. (Embora seja " "permitido liberá-lo dentro do *descructor*.)" -#: ../../c-api/capsule.rst:52 +#: ../../c-api/capsule.rst:58 msgid "" "If the *destructor* argument is not ``NULL``, it will be called with the " "capsule as its argument when it is destroyed." @@ -102,7 +115,7 @@ msgstr "" "Se o argumento *destructor* não for ``NULL``, ele será chamado com a cápsula " "como argumento quando for destruído." -#: ../../c-api/capsule.rst:55 +#: ../../c-api/capsule.rst:61 msgid "" "If this capsule will be stored as an attribute of a module, the *name* " "should be specified as ``modulename.attributename``. This will enable other " @@ -112,7 +125,7 @@ msgstr "" "ser especificado como ``modulename.attributename``. Isso permitirá que " "outros módulos importem a cápsula usando :c:func:`PyCapsule_Import`." -#: ../../c-api/capsule.rst:62 +#: ../../c-api/capsule.rst:68 msgid "" "Retrieve the *pointer* stored in the capsule. On failure, set an exception " "and return ``NULL``." @@ -120,7 +133,7 @@ msgstr "" "Recupera o *pointer* armazenado na cápsula. Em caso de falha, define uma " "exceção e retorna ``NULL``." -#: ../../c-api/capsule.rst:65 +#: ../../c-api/capsule.rst:71 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 " @@ -132,7 +145,7 @@ msgstr "" "também deve ser ``NULL``. Python usa a função C :c:func:`!strcmp` para " "comparar nomes de cápsulas." -#: ../../c-api/capsule.rst:73 +#: ../../c-api/capsule.rst:79 msgid "" "Return the current destructor stored in the capsule. On failure, set an " "exception and return ``NULL``." @@ -140,17 +153,17 @@ msgstr "" "Retorna o destruidor atual armazenado na cápsula. Em caso de falha, define " "uma exceção e retorna ``NULL``." -#: ../../c-api/capsule.rst:76 +#: ../../c-api/capsule.rst:82 msgid "" "It is legal for a capsule to have a ``NULL`` destructor. This makes a " -"``NULL`` return code somewhat ambiguous; use :c:func:`PyCapsule_IsValid` or :" -"c:func:`PyErr_Occurred` to disambiguate." +"``NULL`` return code somewhat ambiguous; use :c:func:`PyCapsule_IsValid` " +"or :c:func:`PyErr_Occurred` to disambiguate." msgstr "" "É legal para uma cápsula ter um destruidor ``NULL``. Isso torna um código de " -"retorno ``NULL`` um tanto ambíguo; use :c:func:`PyCapsule_IsValid` ou :c:" -"func:`PyErr_Occurred` para desambiguar." +"retorno ``NULL`` um tanto ambíguo; use :c:func:`PyCapsule_IsValid` " +"ou :c:func:`PyErr_Occurred` para desambiguar." -#: ../../c-api/capsule.rst:83 +#: ../../c-api/capsule.rst:89 msgid "" "Return the current context stored in the capsule. On failure, set an " "exception and return ``NULL``." @@ -158,17 +171,17 @@ msgstr "" "Retorna o contexto atual armazenado na cápsula. Em caso de falha, define uma " "exceção e retorna ``NULL``." -#: ../../c-api/capsule.rst:86 +#: ../../c-api/capsule.rst:92 msgid "" "It is legal for a capsule to have a ``NULL`` context. This makes a ``NULL`` " -"return code somewhat ambiguous; use :c:func:`PyCapsule_IsValid` or :c:func:" -"`PyErr_Occurred` to disambiguate." +"return code somewhat ambiguous; use :c:func:`PyCapsule_IsValid` " +"or :c:func:`PyErr_Occurred` to disambiguate." msgstr "" "É legal para uma cápsula ter um contexto ``NULL``. Isso torna um código de " -"retorno ``NULL`` um tanto ambíguo; use :c:func:`PyCapsule_IsValid` ou :c:" -"func:`PyErr_Occurred` para desambiguar." +"retorno ``NULL`` um tanto ambíguo; use :c:func:`PyCapsule_IsValid` " +"ou :c:func:`PyErr_Occurred` para desambiguar." -#: ../../c-api/capsule.rst:93 +#: ../../c-api/capsule.rst:99 msgid "" "Return the current name stored in the capsule. On failure, set an exception " "and return ``NULL``." @@ -176,17 +189,17 @@ msgstr "" "Retorna o nome atual armazenado na cápsula. Em caso de falha, define uma " "exceção e retorna ``NULL``." -#: ../../c-api/capsule.rst:96 +#: ../../c-api/capsule.rst:102 msgid "" "It is legal for a capsule to have a ``NULL`` name. This makes a ``NULL`` " -"return code somewhat ambiguous; use :c:func:`PyCapsule_IsValid` or :c:func:" -"`PyErr_Occurred` to disambiguate." +"return code somewhat ambiguous; use :c:func:`PyCapsule_IsValid` " +"or :c:func:`PyErr_Occurred` to disambiguate." msgstr "" "É legal para uma cápsula ter um nome ``NULL``. Isso torna um código de " -"retorno ``NULL`` um tanto ambíguo; use :c:func:`PyCapsule_IsValid` ou :c:" -"func:`PyErr_Occurred` para desambiguar." +"retorno ``NULL`` um tanto ambíguo; use :c:func:`PyCapsule_IsValid` " +"ou :c:func:`PyErr_Occurred` para desambiguar." -#: ../../c-api/capsule.rst:103 +#: ../../c-api/capsule.rst:109 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 " @@ -198,7 +211,15 @@ msgstr "" "``module.attribute``. O *name* armazenado na cápsula deve corresponder " "exatamente a essa string." -#: ../../c-api/capsule.rst:108 +#: ../../c-api/capsule.rst:114 +msgid "" +"This function splits *name* on the ``.`` character, and imports the first " +"element. It then processes further elements using attribute lookups." +msgstr "" +"Esta função divide *name* no caractere ``.`` e importa o primeiro elemento. " +"Em seguida, processa os elementos seguintes usando pesquisas de atributos." + +#: ../../c-api/capsule.rst:117 msgid "" "Return the capsule's internal *pointer* on success. On failure, set an " "exception and return ``NULL``." @@ -206,11 +227,23 @@ msgstr "" "Retorna o ponteiro interno *pointer* da cápsula com sucesso. Em caso de " "falha, define uma exceção e retorna ``NULL``." -#: ../../c-api/capsule.rst:111 +#: ../../c-api/capsule.rst:122 +msgid "" +"If *name* points to an attribute of some submodule or subpackage, this " +"submodule or subpackage must be previously imported using other means (for " +"example, by using :c:func:`PyImport_ImportModule`) for the attribute lookups " +"to succeed." +msgstr "" +"Se *name* apontar para um atributo de algum submódulo ou subpacote, esse " +"submódulo ou subpacote deverá ser importado previamente usando outros meios " +"(por exemplo, usando :c:func:`PyImport_ImportModule`) para que as pesquisas " +"de atributos sejam bem-sucedidas." + +#: ../../c-api/capsule.rst:127 msgid "*no_block* has no effect anymore." msgstr "*no_block* não tem mais efeito." -#: ../../c-api/capsule.rst:117 +#: ../../c-api/capsule.rst:133 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`` " @@ -224,7 +257,7 @@ msgstr "" "parâmetro *name*. (Consulte :c:func:`PyCapsule_GetPointer` para obter " "informações sobre como os nomes das cápsulas são comparados.)" -#: ../../c-api/capsule.rst:123 +#: ../../c-api/capsule.rst:139 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 " @@ -234,7 +267,7 @@ msgstr "" "verdadeiro, as chamadas para qualquer um dos acessadores (qualquer função " "que comece com ``PyCapsule_Get``) terão êxito garantido." -#: ../../c-api/capsule.rst:127 +#: ../../c-api/capsule.rst:143 msgid "" "Return a nonzero value if the object is valid and matches the name passed " "in. Return ``0`` otherwise. This function will not fail." @@ -242,23 +275,23 @@ msgstr "" "Retorna um valor diferente de zero se o objeto for válido e corresponder ao " "nome passado. Retorna ``0`` caso contrário. Esta função não falhará." -#: ../../c-api/capsule.rst:133 +#: ../../c-api/capsule.rst:149 msgid "Set the context pointer inside *capsule* to *context*." msgstr "Define o ponteiro de contexto dentro de *capsule* para *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:151 ../../c-api/capsule.rst:158 +#: ../../c-api/capsule.rst:167 ../../c-api/capsule.rst:175 msgid "" "Return ``0`` on success. Return nonzero and set an exception on failure." msgstr "" "Retorna ``0`` em caso de sucesso. Retorna diferente de zero e define uma " "exceção em caso de falha." -#: ../../c-api/capsule.rst:140 +#: ../../c-api/capsule.rst:156 msgid "Set the destructor inside *capsule* to *destructor*." msgstr "Define o destrutor dentro de *capsule* para *destructor*." -#: ../../c-api/capsule.rst:147 +#: ../../c-api/capsule.rst:163 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 " @@ -268,7 +301,7 @@ msgstr "" "deve sobreviver à cápsula. Se o *name* anterior armazenado na cápsula não " "era ``NULL``, nenhuma tentativa será feita para liberá-lo." -#: ../../c-api/capsule.rst:156 +#: ../../c-api/capsule.rst:172 msgid "" "Set the void pointer inside *capsule* to *pointer*. The pointer may not be " "``NULL``." diff --git a/c-api/cell.po b/c-api/cell.po index 736a871da..cf31c80e9 100644 --- a/c-api/cell.po +++ b/c-api/cell.po @@ -1,25 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 +# Rafael Fontenelle , 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-12 14:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2025-11-05 15:17+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -31,17 +32,17 @@ msgstr "Objeto célula" msgid "" "\"Cell\" objects are used to implement variables referenced by multiple " "scopes. For each such variable, a cell object is created to store the value; " -"the local variables of each stack frame that references the value contains a " +"the local variables of each stack frame that references the value contain a " "reference to the cells from outer scopes which also use that variable. When " "the value is accessed, the value contained in the cell is used instead of " "the cell object itself. This de-referencing of the cell object requires " "support from the generated byte-code; these are not automatically de-" "referenced when accessed. Cell objects are not likely to be useful elsewhere." msgstr "" -"Objetos \"cell\" são usados ​​para implementar variáveis ​​referenciadas por " +"Objetos \"cell\" são usados para implementar variáveis referenciadas por " "múltiplos escopos. Para cada variável, um objeto célula é criado para " -"armazenar o valor; as variáveis ​​locais de cada quadro de pilha que " -"referencia o valor contém uma referência para as células de escopos externos " +"armazenar o valor; as variáveis locais de cada quadro de pilha que " +"referencia o valor contêm uma referência para as células de escopos externos " "que também usam essa variável. Quando o valor é acessado, o valor contido na " "célula é usado em vez do próprio objeto da célula. Essa des-referência do " "objeto da célula requer suporte do código de bytes gerado; estes não são " diff --git a/c-api/code.po b/c-api/code.po index 87c7e2e58..22eb5d4e6 100644 --- a/c-api/code.po +++ b/c-api/code.po @@ -1,27 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# PAULO NASCIMENTO, 2024 -# Welliton Malta , 2024 -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 +# Rafael Fontenelle , 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-06-28 14:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -49,8 +48,8 @@ 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 :ref:`code object `." msgstr "" "Esta é uma instância de :c:type:`PyTypeObject` representando o :ref:`objeto " "código ` Python." @@ -64,14 +63,22 @@ msgstr "" "função sempre tem sucesso." #: ../../c-api/code.rst:35 -msgid "Return the number of free variables in a code object." -msgstr "Retorna o número de variáveis livres em um objeto código." +msgid "" +"Return the number of :term:`free (closure) variables ` in " +"a code object." +msgstr "" +"Retorna o número de :term:`variáveis livres (de clausura) ` em um objeto código." -#: ../../c-api/code.rst:39 -msgid "Return the position of the first free variable in a code object." -msgstr "Retorna a posição da primeira variável livre em um objeto código." +#: ../../c-api/code.rst:40 +msgid "" +"Return the position of the first :term:`free (closure) variable ` in a code object." +msgstr "" +"Retorna a posição da primeira :term:`variável livre (de clausura) ` em um objeto código." -#: ../../c-api/code.rst:43 +#: ../../c-api/code.rst:45 msgid "" "Renamed from ``PyCode_GetFirstFree`` as part of :ref:`unstable-c-api`. The " "old name is deprecated, but will remain available until the signature " @@ -81,7 +88,7 @@ msgstr "" "nome antigo foi descontinuado, mas continuará disponível até que a " "assinatura mude novamente." -#: ../../c-api/code.rst:49 +#: ../../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." @@ -89,16 +96,17 @@ msgstr "" "Devolve um novo objeto código. Se precisar de um objeto código vazio para " "criar um quadro, use :c:func:`PyCode_NewEmpty`" -#: ../../c-api/code.rst:52 +#: ../../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." +"Since the definition of the bytecode changes often, " +"calling :c:func:`PyUnstable_Code_New` directly can bind you to a precise " +"Python version." msgstr "" -"Como a definição de bytecode muda constantemente, chamar :c:func:" -"`PyUnstable_Code_New` diretamente pode vinculá-lo a uma versão de Python " -"específica." +"Como a definição de bytecode muda constantemente, " +"chamar :c:func:`PyUnstable_Code_New` diretamente pode vinculá-lo a uma " +"versão de Python específica." -#: ../../c-api/code.rst:55 +#: ../../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 " @@ -109,11 +117,11 @@ msgstr "" "de resultar em execução incorreta ou erros fatais de VM. Tenha extremo " "cuidado ao usar esta função." -#: ../../c-api/code.rst:59 +#: ../../c-api/code.rst:61 msgid "Added ``qualname`` and ``exceptiontable`` parameters." msgstr "Adicionou os parâmetros ``qualname`` e ``exceptiontable``" -#: ../../c-api/code.rst:66 +#: ../../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." @@ -122,7 +130,7 @@ msgstr "" "antigo foi descontinuado, mas continuará disponível até que a assinatura " "mude novamente." -#: ../../c-api/code.rst:72 +#: ../../c-api/code.rst:77 msgid "" "Similar to :c:func:`PyUnstable_Code_New`, but with an extra " "\"posonlyargcount\" for positional-only arguments. The same caveats that " @@ -132,15 +140,15 @@ msgstr "" "extra para argumentos somente-posicionais. As mesmas ressalvas que se " "aplicam a ``PyUnstable_Code_New`` também se aplicam a essa função." -#: ../../c-api/code.rst:77 +#: ../../c-api/code.rst:80 msgid "as ``PyCode_NewWithPosOnlyArgs``" msgstr "Como ``PyCode_NewWithPosOnlyArgs``" -#: ../../c-api/code.rst:79 +#: ../../c-api/code.rst:82 msgid "Added ``qualname`` and ``exceptiontable`` parameters." msgstr "Adicionados os parâmetros ``qualname`` e ``exceptiontable``" -#: ../../c-api/code.rst:84 +#: ../../c-api/code.rst:87 msgid "" "Renamed to ``PyUnstable_Code_NewWithPosOnlyArgs``. The old name is " "deprecated, but will remain available until the signature changes again." @@ -148,7 +156,7 @@ msgstr "" "Renomeado para ``PyUnstable_Code_NewWithPosOnlyArgs``. O nome antigo foi " "descontinuado, mas continuará disponível até que a assinatura mude novamente." -#: ../../c-api/code.rst:90 +#: ../../c-api/code.rst:93 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`` " @@ -158,7 +166,7 @@ msgstr "" "número da primeira linha especificados. O objeto código resultante irá " "levantar uma ``Exception`` se executado." -#: ../../c-api/code.rst:96 +#: ../../c-api/code.rst:99 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 " @@ -168,17 +176,17 @@ msgstr "" "``byte_offset`` e termina depois disso. Se você só precisa do número da " "linha de um quadro, use :c:func:`PyFrame_GetLineNumber`." -#: ../../c-api/code.rst:99 +#: ../../c-api/code.rst:102 msgid "" -"For efficiently iterating over the line numbers in a code object, use `the " -"API described in PEP 626 `_." +"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 "" "Para iterar eficientemente sobre os números de linha em um objeto código, " -"use `a API descrita em PEP 626 `_ ." +"use :pep:`a API descrita na PEP 626 <0626#out-of-process-debuggers-and-" +"profilers>` ." -#: ../../c-api/code.rst:104 +#: ../../c-api/code.rst:107 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 " @@ -189,11 +197,11 @@ msgstr "" "``0`` quando as informações não estão disponíveis para nenhum elemento em " "particular." -#: ../../c-api/code.rst:108 +#: ../../c-api/code.rst:111 msgid "Returns ``1`` if the function succeeds and 0 otherwise." msgstr "Retorna ``1`` se a função for bem-sucedida e 0 caso contrário." -#: ../../c-api/code.rst:114 +#: ../../c-api/code.rst:117 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 " @@ -204,7 +212,7 @@ msgstr "" "objeto código. Em caso de erro, ``NULL`` é retornado e uma exceção é " "levantada." -#: ../../c-api/code.rst:119 +#: ../../c-api/code.rst:122 msgid "" "This ``PyBytesObject`` may be created on-demand by the interpreter and does " "not necessarily represent the bytecode actually executed by CPython. The " @@ -214,7 +222,7 @@ msgstr "" "representa necessariamente o bytecode realmente executado pelo CPython. O " "caso de uso primário para esta função são depuradores e criadores de perfil." -#: ../../c-api/code.rst:127 +#: ../../c-api/code.rst:130 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 " @@ -224,7 +232,7 @@ msgstr "" "nova referência a um :c:type:`PyTupleObject` contendo os nomes das variáveis " "locais. Em caso de erro, ``NULL`` é retornado e uma exceção é levantada." -#: ../../c-api/code.rst:136 +#: ../../c-api/code.rst:139 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 " @@ -236,17 +244,19 @@ msgstr "" "locais referenciadas por funções aninhadas. Em caso de erro, ``NULL`` é " "retornado e uma exceção é levantada." -#: ../../c-api/code.rst:145 +#: ../../c-api/code.rst:148 msgid "" "Equivalent to the Python code ``getattr(co, 'co_freevars')``. Returns a new " -"reference to a :c:type:`PyTupleObject` containing the names of the free " -"variables. On error, ``NULL`` is returned and an exception is raised." +"reference to a :c:type:`PyTupleObject` containing the names of " +"the :term:`free (closure) variables `. On error, ``NULL`` " +"is returned and an exception is raised." msgstr "" "Equivalente ao código Python ``getattr(co, 'co_freevars')``. Retorna uma " -"nova referência a um :c:type:`PyTupleObject` contendo os nomes das variáveis " -"livres. Em caso de erro, ``NULL`` é retornado e uma exceção é levantada." +"nova referência a um :c:type:`PyTupleObject` contendo os nomes " +"das :term:`variáveis livres (de clausura) `. Em caso de " +"erro, ``NULL`` é retornado e uma exceção é levantada." -#: ../../c-api/code.rst:153 +#: ../../c-api/code.rst:157 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 " @@ -254,23 +264,23 @@ msgid "" "exception." msgstr "" "Registra *callback* como um observador do objeto código para o interpretador " -"atual. Devolve um ID que pode ser passado para :c:func:" -"`PyCode_ClearWatcher`. Em caso de erro (por exemplo, não há IDs de " -"observadores disponíveis), devolve ``-1`` e define uma exceção." +"atual. Devolve um ID que pode ser passado " +"para :c:func:`PyCode_ClearWatcher`. Em caso de erro (por exemplo, não há IDs " +"de observadores disponíveis), devolve ``-1`` e define uma exceção." -#: ../../c-api/code.rst:162 +#: ../../c-api/code.rst:166 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.)" +"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 "" "Libera o observador identificado por *watcher_id* anteriormente retornado " "por :c:func:`PyCode_AddWatcher` para o interpretador atual. Retorna ``0`` em " "caso de sucesso ou ``-1`` em caso de erro e levanta uma exceção (ex., se o " "*watcher_id* dado não foi registrado.)" -#: ../../c-api/code.rst:171 +#: ../../c-api/code.rst:175 msgid "" "Enumeration of possible code object watcher events: - " "``PY_CODE_EVENT_CREATE`` - ``PY_CODE_EVENT_DESTROY``" @@ -278,23 +288,23 @@ msgstr "" "Enumeração dos possíveis eventos de observador do objeto código: " "``PY_CODE_EVENT_CREATE`` - ``PY_CODE_EVENT_DESTROY``" -#: ../../c-api/code.rst:179 +#: ../../c-api/code.rst:183 msgid "Type of a code object watcher callback function." msgstr "Tipo de uma função de callback de observador de objeto código." -#: ../../c-api/code.rst:181 +#: ../../c-api/code.rst:185 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 " +"*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 "" "Se *evento* é ``PY_CODE_EVENT_CREATE``, então a função de retorno é invocada " -"após `co`ter sido completamente inicializado. Senão, a função de retorno é " -"invocada antes que a destruição de `co` ocorra, para que o estado anterior " +"após *co* ter sido completamente inicializado. Senão, a função de retorno é " +"invocada antes que a destruição de *co* ocorra, para que o estado anterior " "de *co* possa ser inspecionado." -#: ../../c-api/code.rst:186 +#: ../../c-api/code.rst:190 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 " @@ -307,7 +317,7 @@ msgstr "" "qualquer observador de funções de retorno ativos naquele momento serão " "chamados novamente." -#: ../../c-api/code.rst:191 +#: ../../c-api/code.rst:195 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 " @@ -323,17 +333,18 @@ msgstr "" "visíveis para os observadores (incluindo se uma função de retorno é chamada " "ou não), isso não muda a semântica do código Python executado." -#: ../../c-api/code.rst:198 +#: ../../c-api/code.rst:202 msgid "" "If the callback sets an exception, it must return ``-1``; this exception " -"will be printed as an unraisable exception using :c:func:" -"`PyErr_WriteUnraisable`. Otherwise it should return ``0``." +"will be printed as an unraisable exception " +"using :c:func:`PyErr_WriteUnraisable`. Otherwise it should return ``0``." msgstr "" -"Se a função de retorno definir uma exceção, ela deverá retornar ``-1``; essa " -"exceção será impressa como uma exceção não reprovável usando :c:func:" -"`PyErr_WriteUnraisable`. Caso contrário, deverá retornar ``0``." +"Se a função de retorno definir uma exceção, ela deverá retornar ``-1``. Essa " +"exceção será exibida como uma exceção não levantável " +"usando :c:func:`PyErr_WriteUnraisable`. Caso contrário, deverá retornar " +"``0``." -#: ../../c-api/code.rst:202 +#: ../../c-api/code.rst:206 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 " @@ -345,23 +356,151 @@ msgstr "" "de retorno. Nesse caso, a função de retorno deve retornar ``0`` com a mesma " "exceção ainda definida. Isso significa que a função de retorno não pode " "chamar nenhuma outra API que possa definir uma exceção, a menos que salve e " -"limpe o estado da exceção primeiro e o restaure antes de retornar." +"limpe o estado da exceção primeiro e restaure a exceção antes de retornar." + +#: ../../c-api/code.rst:217 +msgid "This is a :term:`soft deprecated` function that does nothing." +msgstr "" +"Esta é uma função :term:`suavemente descontinuada ` que faz nada." + +#: ../../c-api/code.rst:219 +msgid "" +"Prior to Python 3.10, this function would perform basic optimizations to a " +"code object." +msgstr "" +"Antes do Python 3.10, essa função realizava otimizações básicas em um objeto " +"código." + +#: ../../c-api/code.rst:222 +msgid "This function now does nothing." +msgstr "Esta função agora não faz nada." -#: ../../c-api/code.rst:212 +#: ../../c-api/code.rst:229 +msgid "Code Object Flags" +msgstr "Sinalizadores de objetos código" + +#: ../../c-api/code.rst:231 +msgid "" +"Code objects contain a bit-field of flags, which can be retrieved as " +"the :attr:`~codeobject.co_flags` Python attribute (for example " +"using :c:func:`PyObject_GetAttrString`), and set using a *flags* argument " +"to :c:func:`PyUnstable_Code_New` and similar functions." +msgstr "" +"Objetos código contêm um campo de bits de sinalizadores, que podem ser " +"recuperados como o atributo Python :attr:`~codeobject.co_flags` (por " +"exemplo, usando :c:func:`PyObject_GetAttrString`) e definidos usando um " +"argumento *flags* para :c:func:`PyUnstable_Code_New` e funções semelhantes." + +#: ../../c-api/code.rst:236 +msgid "" +"Flags whose names start with ``CO_FUTURE_`` correspond to features normally " +"selectable by :ref:`future statements `. These flags can be used " +"in :c:member:`PyCompilerFlags.cf_flags`. Note that many ``CO_FUTURE_`` flags " +"are mandatory in current versions of Python, and setting them has no effect." +msgstr "" +"Os sinalizadores cujos nomes começam com ``CO_FUTURE_`` correspondem a " +"recursos normalmente selecionáveis por :ref:`instruções future `. " +"Esses sinalizadores podem ser usados " +"em :c:member:`PyCompilerFlags.cf_flags`. Observe que muitos sinalizadores " +"``CO_FUTURE_`` são obrigatórios nas versões atuais do Python, e defini-los " +"não tem efeito." + +#: ../../c-api/code.rst:242 +msgid "" +"The following flags are available. For their meaning, see the linked " +"documentation of their Python equivalents." +msgstr "" +"Os seguintes sinalizador estão disponíveis. Para saber o significado delas, " +"consulte a documentação vinculada de seus equivalentes em Python." + +#: ../../c-api/code.rst:250 +msgid "Flag" +msgstr "Sinalizador" + +#: ../../c-api/code.rst:251 +msgid "Meaning" +msgstr "Significado" + +#: ../../c-api/code.rst:253 +msgid ":py:data:`inspect.CO_OPTIMIZED`" +msgstr ":py:data:`inspect.CO_OPTIMIZED`" + +#: ../../c-api/code.rst:255 +msgid ":py:data:`inspect.CO_NEWLOCALS`" +msgstr ":py:data:`inspect.CO_NEWLOCALS`" + +#: ../../c-api/code.rst:257 +msgid ":py:data:`inspect.CO_VARARGS`" +msgstr ":py:data:`inspect.CO_VARARGS`" + +#: ../../c-api/code.rst:259 +msgid ":py:data:`inspect.CO_VARKEYWORDS`" +msgstr ":py:data:`inspect.CO_VARKEYWORDS`" + +#: ../../c-api/code.rst:261 +msgid ":py:data:`inspect.CO_NESTED`" +msgstr ":py:data:`inspect.CO_NESTED`" + +#: ../../c-api/code.rst:263 +msgid ":py:data:`inspect.CO_GENERATOR`" +msgstr ":py:data:`inspect.CO_GENERATOR`" + +#: ../../c-api/code.rst:265 +msgid ":py:data:`inspect.CO_COROUTINE`" +msgstr ":py:data:`inspect.CO_COROUTINE`" + +#: ../../c-api/code.rst:267 +msgid ":py:data:`inspect.CO_ITERABLE_COROUTINE`" +msgstr ":py:data:`inspect.CO_ITERABLE_COROUTINE`" + +#: ../../c-api/code.rst:269 +msgid ":py:data:`inspect.CO_ASYNC_GENERATOR`" +msgstr ":py:data:`inspect.CO_ASYNC_GENERATOR`" + +#: ../../c-api/code.rst:272 +msgid "no effect (:py:data:`__future__.division`)" +msgstr "sem efeito (:py:data:`__future__.division`)" + +#: ../../c-api/code.rst:274 +msgid "no effect (:py:data:`__future__.absolute_import`)" +msgstr "sem efeito (:py:data:`__future__.absolute_import`)" + +#: ../../c-api/code.rst:276 +msgid "no effect (:py:data:`__future__.with_statement`)" +msgstr "sem efeito (:py:data:`__future__.with_statement`)" + +#: ../../c-api/code.rst:278 +msgid "no effect (:py:data:`__future__.print_function`)" +msgstr "sem efeito (:py:data:`__future__.print_function`)" + +#: ../../c-api/code.rst:280 +msgid "no effect (:py:data:`__future__.unicode_literals`)" +msgstr "sem efeito (:py:data:`__future__.unicode_literals`)" + +#: ../../c-api/code.rst:282 +msgid "no effect (:py:data:`__future__.generator_stop`)" +msgstr "sem efeito (:py:data:`__future__.generator_stop`)" + +#: ../../c-api/code.rst:284 +msgid ":py:data:`__future__.annotations`" +msgstr ":py:data:`__future__.annotations`" + +#: ../../c-api/code.rst:288 msgid "Extra information" msgstr "Informação adicional" -#: ../../c-api/code.rst:214 +#: ../../c-api/code.rst:290 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 "" -"Para suportar extensões de baixo nível de avaliação de quadro (frame), tais " -"como compiladores \"just-in-time\", é possível anexar dados arbitrários " -"adicionais a objetos código." +"Para oferece suporte a extensões de baixo nível de avaliação de quadro " +"(frame), tais como compiladores \"just-in-time\", é possível anexar dados " +"arbitrários adicionais a objetos código." -#: ../../c-api/code.rst:218 +#: ../../c-api/code.rst:294 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 " @@ -371,13 +510,13 @@ msgstr "" "um detalhe de implementação do CPython, e a API pode mudar sem avisos de " "descontinuidade." -#: ../../c-api/code.rst:224 -msgid "Return a new an opaque index value used to adding data to code objects." +#: ../../c-api/code.rst:303 +msgid "Return a new opaque index value used to adding data to code objects." msgstr "" "Retorna um novo e opaco valor de índice usado para adicionar dados a objetos " "código." -#: ../../c-api/code.rst:226 +#: ../../c-api/code.rst:305 msgid "" "You generally call this function once (per interpreter) and use the result " "with ``PyCode_GetExtra`` and ``PyCode_SetExtra`` to manipulate data on " @@ -387,21 +526,21 @@ msgstr "" "o resultado com ``PyCode_GetExtra`` e ``PyCode_SetExtra`` para manipular " "dados em objetos código individuais." -#: ../../c-api/code.rst:230 +#: ../../c-api/code.rst:309 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`." +"called on non-``NULL`` data stored under the new index. " +"Use :c:func:`Py_DecRef` when storing :c:type:`PyObject`." msgstr "" "Se *free* não for ``NULL``: quando o objeto código é desalocado, *free* será " -"chamado em dados não-``NULL`` armazenados sob o novo índice. Use :c:func:" -"`Py_DecRef` quando armazenar :c:type:`PyObject`." +"chamado em dados não-``NULL`` armazenados sob o novo índice. " +"Use :c:func:`Py_DecRef` quando armazenar :c:type:`PyObject`." -#: ../../c-api/code.rst:236 +#: ../../c-api/code.rst:313 msgid "as ``_PyEval_RequestCodeExtraIndex``" msgstr "como ``_PyEval_RequestCodeExtraIndex``" -#: ../../c-api/code.rst:240 +#: ../../c-api/code.rst:317 msgid "" "Renamed to ``PyUnstable_Eval_RequestCodeExtraIndex``. The old private name " "is deprecated, but will be available until the API changes." @@ -409,7 +548,7 @@ msgstr "" "Renomeado para ``PyUnstable_Eval_RequestCodeExtraIndex``. O nome antigo nome " "privado foi descontinuado, mas continuará disponível até a mudança da API." -#: ../../c-api/code.rst:246 +#: ../../c-api/code.rst:326 msgid "" "Set *extra* to the extra data stored under the given index. Return 0 on " "success. Set an exception and return -1 on failure." @@ -418,7 +557,7 @@ msgstr "" "Retorna 0 em caso de sucesso. Define uma exceção e retorna -1 em caso de " "erro." -#: ../../c-api/code.rst:249 +#: ../../c-api/code.rst:329 msgid "" "If no data was set under the index, set *extra* to ``NULL`` and return 0 " "without setting an exception." @@ -426,11 +565,11 @@ msgstr "" "Se nenhum dado foi determinado sob o índice, define *extra* como ``NULL`` e " "retorna 0 sem definir nenhuma exceção." -#: ../../c-api/code.rst:254 +#: ../../c-api/code.rst:332 msgid "as ``_PyCode_GetExtra``" msgstr "como ``_PyCode_GetExtra``" -#: ../../c-api/code.rst:258 +#: ../../c-api/code.rst:336 msgid "" "Renamed to ``PyUnstable_Code_GetExtra``. The old private name is deprecated, " "but will be available until the API changes." @@ -438,7 +577,7 @@ msgstr "" "Renomeado para ``PyUnstable_Code_GetExtra``. O nome antigo privado foi " "descontinuado, mas continuará disponível até a mudança da API." -#: ../../c-api/code.rst:264 +#: ../../c-api/code.rst:345 msgid "" "Set the extra data stored under the given index to *extra*. Return 0 on " "success. Set an exception and return -1 on failure." @@ -446,11 +585,11 @@ msgstr "" "Define os dados extras armazenados sob o índice dado a *extra*. Retorna 0 em " "caso de sucesso. Define uma exceção e retorna -1 em caso de erro." -#: ../../c-api/code.rst:269 +#: ../../c-api/code.rst:348 msgid "as ``_PyCode_SetExtra``" msgstr "como ``_PyCode_SetExtra``" -#: ../../c-api/code.rst:273 +#: ../../c-api/code.rst:352 msgid "" "Renamed to ``PyUnstable_Code_SetExtra``. The old private name is deprecated, " "but will be available until the API changes." @@ -470,22 +609,6 @@ msgstr "código" msgid "code object" msgstr "objeto código" -#: ../../c-api/code.rst:62 +#: ../../c-api/code.rst:64 msgid "PyCode_New (C function)" msgstr "PyCode_New (função C)" - -#: ../../c-api/code.rst:75 -msgid "PyCode_NewWithPosOnlyArgs (C function)" -msgstr "PyCode_NewWithPosOnlyArgs (função C)" - -#: ../../c-api/code.rst:234 -msgid "_PyEval_RequestCodeExtraIndex (C function)" -msgstr "_PyEval_RequestCodeExtraIndex (função C)" - -#: ../../c-api/code.rst:252 -msgid "_PyCode_GetExtra (C function)" -msgstr "_PyCode_GetExtra (função C)" - -#: ../../c-api/code.rst:267 -msgid "_PyCode_SetExtra (C function)" -msgstr "_PyCode_SetExtra (função C)" diff --git a/c-api/codec.po b/c-api/codec.po index a8579e56e..c753d21a4 100644 --- a/c-api/codec.po +++ b/c-api/codec.po @@ -1,27 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Hildeberto Abreu Magalhães , 2024 -# Tiago Henrique , 2024 -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 +# Rafael Fontenelle , 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-17 14:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -35,8 +34,9 @@ msgstr "Registra uma nova função de busca de codec." #: ../../c-api/codec.rst:10 msgid "" -"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." +"As a 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 "" "Como efeito colateral, tenta carregar o pacote :mod:`!encodings`, se isso " "ainda não tiver sido feito, com o propósito de garantir que ele sempre seja " @@ -68,8 +68,8 @@ msgstr "API de codificação baseada em codec genérico." msgid "" "*object* is passed through the encoder function found for the given " "*encoding* using the error handling method defined by *errors*. *errors* " -"may be ``NULL`` to use the default method defined for the codec. Raises a :" -"exc:`LookupError` if no encoder can be found." +"may be ``NULL`` to use the default method defined for the codec. Raises " +"a :exc:`LookupError` if no encoder can be found." msgstr "" "*object* é passado através da função de codificação encontrada para a " "codificação fornecida por meio de *encoding*, usando o método de tratamento " @@ -85,14 +85,14 @@ msgstr "API de decodificação baseada em decodificador genérico." msgid "" "*object* is passed through the decoder function found for the given " "*encoding* using the error handling method defined by *errors*. *errors* " -"may be ``NULL`` to use the default method defined for the codec. Raises a :" -"exc:`LookupError` if no encoder can be found." +"may be ``NULL`` to use the default method defined for the codec. Raises " +"a :exc:`LookupError` if no decoder can be found." msgstr "" "*object* é passado através da função de decodificação encontrada para a " "codificação fornecida por meio de *encoding*, usando o método de tratamento " "de erros definido por *errors*. *errors* pode ser ``NULL`` para usar o " "método padrão definido para o codec. Levanta um :exc:`LookupError` se nenhum " -"codificador puder ser encontrado." +"decodificador puder ser encontrado." #: ../../c-api/codec.rst:46 msgid "Codec lookup API" @@ -102,8 +102,8 @@ msgstr "API de pesquisa de codec" msgid "" "In the following functions, the *encoding* string is looked up converted to " "all lower-case characters, which makes encodings looked up through this " -"mechanism effectively case-insensitive. If no codec is found, a :exc:" -"`KeyError` is set and ``NULL`` returned." +"mechanism effectively case-insensitive. If no codec is found, " +"a :exc:`KeyError` is set and ``NULL`` returned." msgstr "" "Nas funções a seguir, a string *encoding* é pesquisada com todos os " "caracteres sendo convertidos para minúsculo, o que faz com que as " @@ -165,9 +165,9 @@ msgstr "" #: ../../c-api/codec.rst:88 msgid "" -"The callback gets a single argument, an instance of :exc:" -"`UnicodeEncodeError`, :exc:`UnicodeDecodeError` or :exc:" -"`UnicodeTranslateError` that holds information about the problematic " +"The callback gets a single argument, an instance " +"of :exc:`UnicodeEncodeError`, :exc:`UnicodeDecodeError` " +"or :exc:`UnicodeTranslateError` that holds information about the problematic " "sequence of characters or bytes and their offset in the original string " "(see :ref:`unicodeexceptions` for functions to extract this information). " "The callback must either raise the given exception, or return a two-item " @@ -175,9 +175,9 @@ msgid "" "integer giving the offset in the original string at which encoding/decoding " "should be resumed." msgstr "" -"O retorno de chamada obtém um único argumento, uma instância de :exc:" -"`UnicodeEncodeError`, :exc:`UnicodeDecodeError` ou :exc:" -"`UnicodeTranslateError` que contém informações sobre a sequencia " +"O retorno de chamada obtém um único argumento, uma instância " +"de :exc:`UnicodeEncodeError`, :exc:`UnicodeDecodeError` " +"ou :exc:`UnicodeTranslateError` que contém informações sobre a sequencia " "problemática de caracteres ou bytes e seu deslocamento na string original " "(consulte :ref:`unicodeexceptions` para funções que extraem essa " "informação). A função de retorno de chamada deve levantar a exceção dada, ou " @@ -226,3 +226,15 @@ msgstr "" #: ../../c-api/codec.rst:129 msgid "Replace the unicode encode error with ``\\N{...}`` escapes." msgstr "Substitui os erros de codificação unicode com escapes ``\\N{...}``." + +#: ../../c-api/codec.rst:135 +msgid "Codec utility variables" +msgstr "Variáveis utilitárias de codec" + +#: ../../c-api/codec.rst:139 +msgid "" +"A string constant containing the lowercase hexadecimal digits: " +"``\"0123456789abcdef\"``." +msgstr "" +"Uma constante string contendo os dígitos hexadecimais minúsculos: " +"``\"0123456789abcdef\"``." diff --git a/c-api/complex.po b/c-api/complex.po index 9d8cc6d8b..16795ae75 100644 --- a/c-api/complex.po +++ b/c-api/complex.po @@ -1,27 +1,25 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Renan Lopes , 2021 -# Marco Rougeth , 2023 -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-08-09 16:36+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: python-doc bot, 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -71,61 +69,73 @@ msgstr "" msgid "The structure is defined as::" msgstr "A estrutura é definida como::" +#: ../../c-api/complex.rst:35 +msgid "" +"typedef struct {\n" +" double real;\n" +" double imag;\n" +"} Py_complex;" +msgstr "" +"typedef struct {\n" +" double real;\n" +" double imag;\n" +"} Py_complex;" + #: ../../c-api/complex.rst:43 msgid "" "Return the sum of two complex numbers, using the C :c:type:`Py_complex` " "representation." msgstr "" -"Retorna a soma de dois números complexos, utilizando a representação C :c:" -"type:`Py_complex`." +"Retorna a soma de dois números complexos, utilizando a representação " +"C :c:type:`Py_complex`." #: ../../c-api/complex.rst:49 msgid "" -"Return the difference between two complex numbers, using the C :c:type:" -"`Py_complex` representation." +"Return the difference between two complex numbers, using the " +"C :c:type:`Py_complex` representation." msgstr "" "Retorna a diferença entre dois números complexos, utilizando a representação " "C :c:type:`Py_complex`." #: ../../c-api/complex.rst:55 msgid "" -"Return the negation of the complex number *num*, using the C :c:type:" -"`Py_complex` representation." +"Return the negation of the complex number *num*, using the " +"C :c:type:`Py_complex` representation." msgstr "" -"Retorna a negação do número complexo *num*, utilizando a representação C :c:" -"type:`Py_complex`." +"Retorna a negação do número complexo *num*, utilizando a representação " +"C :c:type:`Py_complex`." #: ../../c-api/complex.rst:61 msgid "" "Return the product of two complex numbers, using the C :c:type:`Py_complex` " "representation." msgstr "" -"Retorna o produto de dois números complexos, utilizando a representação C :c:" -"type:`Py_complex`." +"Retorna o produto de dois números complexos, utilizando a representação " +"C :c:type:`Py_complex`." #: ../../c-api/complex.rst:67 msgid "" "Return the quotient of two complex numbers, using the C :c:type:`Py_complex` " "representation." msgstr "" -"Retorna o quociente de dois números complexos, utilizando a representação C :" -"c:type:`Py_complex`." +"Retorna o quociente de dois números complexos, utilizando a representação " +"C :c:type:`Py_complex`." #: ../../c-api/complex.rst:70 msgid "" -"If *divisor* is null, this method returns zero and sets :c:data:`errno` to :" -"c:macro:`!EDOM`." +"If *divisor* is null, this method returns zero and sets :c:data:`errno` " +"to :c:macro:`!EDOM`." msgstr "" -"Se *divisor* é nulo, este método retorna zero e define :c:data:`errno` para :" -"c:macro:`!EDOM`." +"Se *divisor* é nulo, este método retorna zero e define :c:data:`errno` " +"para :c:macro:`!EDOM`." #: ../../c-api/complex.rst:76 msgid "" -"Return the exponentiation of *num* by *exp*, using the C :c:type:" -"`Py_complex` representation." +"Return the exponentiation of *num* by *exp*, using the " +"C :c:type:`Py_complex` representation." msgstr "" -"Retorna a exponenciação de *num* por *exp*, utilizando a representação C :c:" -"type:`Py_complex`" +"Retorna a exponenciação de *num* por *exp*, utilizando a representação " +"C :c:type:`Py_complex`" #: ../../c-api/complex.rst:79 msgid "" @@ -156,8 +166,8 @@ msgstr "" #: ../../c-api/complex.rst:100 msgid "" -"Return true if its argument is a :c:type:`PyComplexObject` or a subtype of :" -"c:type:`PyComplexObject`. This function always succeeds." +"Return true if its argument is a :c:type:`PyComplexObject` or a subtype " +"of :c:type:`PyComplexObject`. This function always succeeds." msgstr "" "Retorna true se seu argumento é um :c:type:`PyComplexObject` ou um subtipo " "de :c:type:`PyComplexObject`. Esta função sempre tem sucesso." @@ -175,8 +185,9 @@ 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 "" -"Cria um novo objeto de número complexo Python a partir de um valor C :c:type:" -"`Py_complex`. Retorna ``NULL`` com uma exceção definida ao ocorrer um erro." +"Cria um novo objeto de número complexo Python a partir de um valor " +"C :c:type:`Py_complex`. Retorna ``NULL`` com uma exceção definida ao ocorrer " +"um erro." #: ../../c-api/complex.rst:118 msgid "" @@ -192,16 +203,17 @@ msgstr "Retorna a parte real de *op* como um :c:expr:`double` C." #: ../../c-api/complex.rst:126 msgid "" -"If *op* is not a Python complex number object but has a :meth:`~object." -"__complex__` method, this method will first be called to convert *op* to a " -"Python complex number object. If :meth:`!__complex__` is not defined then " -"it falls back to call :c:func:`PyFloat_AsDouble` and returns its result." +"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 "" -"Se *op* não é um objeto de número complexo Python, mas tem um método :meth:" -"`~object.__complex__`, este método será primeiro chamado para converter *op* " -"em um objeto de número complexo Python. Se :meth:`!__complex__` não estiver " -"definido, ele volta a chamar :c:func:`PyFloat_AsDouble` e retorna seu " -"resultado." +"Se *op* não é um objeto de número complexo Python, mas tem um " +"método :meth:`~object.__complex__`, este método será primeiro chamado para " +"converter *op* em um objeto de número complexo Python. Se :meth:`!" +"__complex__` não estiver definido, ele volta a " +"chamar :c:func:`PyFloat_AsDouble` e retorna seu resultado." #: ../../c-api/complex.rst:132 ../../c-api/complex.rst:148 msgid "" @@ -221,17 +233,17 @@ msgstr "Retorna a parte imaginária de *op* como um :c:expr:`double` C." #: ../../c-api/complex.rst:142 msgid "" -"If *op* is not a Python complex number object but has a :meth:`~object." -"__complex__` method, this method will first be called to convert *op* to a " -"Python complex number object. If :meth:`!__complex__` is not defined then " -"it falls back to call :c:func:`PyFloat_AsDouble` and returns ``0.0`` on " -"success." +"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 "" -"Se *op* não é um objeto de número complexo Python, mas tem um método :meth:" -"`~object.__complex__`, este método será primeiro chamado para converter *op* " -"em um objeto de número complexo Python. Se :meth:`!__complex__` não estiver " -"definido, ele volta a chamar :c:func:`PyFloat_AsDouble` e retorna ``0.0`` em " -"caso de sucesso." +"Se *op* não é um objeto de número complexo Python, mas tem um " +"método :meth:`~object.__complex__`, este método será primeiro chamado para " +"converter *op* em um objeto de número complexo Python. Se :meth:`!" +"__complex__` não estiver definido, ele volta a " +"chamar :c:func:`PyFloat_AsDouble` e retorna ``0.0`` em caso de sucesso." #: ../../c-api/complex.rst:156 msgid "Return the :c:type:`Py_complex` value of the complex number *op*." @@ -239,28 +251,29 @@ msgstr "Retorna o valor :c:type:`Py_complex` do número complexo *op*." #: ../../c-api/complex.rst:158 msgid "" -"If *op* is not a Python complex number object but has a :meth:`~object." -"__complex__` method, this method will first be called to convert *op* to a " -"Python complex number object. If :meth:`!__complex__` is not defined then " -"it falls back to :meth:`~object.__float__`. If :meth:`!__float__` is not " -"defined then it falls back to :meth:`~object.__index__`." +"If *op* is not a Python complex number object but has " +"a :meth:`~object.__complex__` method, this method will first be called to " +"convert *op* to a Python complex number object. If :meth:`!__complex__` is " +"not defined then it falls back to :meth:`~object.__float__`. If :meth:`!" +"__float__` is not defined then it falls back to :meth:`~object.__index__`." msgstr "" -"Se *op* não é um objeto de número complexo Python, mas tem um método :meth:" -"`~object.__complex__`, este método será primeiro chamado para converter *op* " -"em um objeto de número complexo Python. Se :meth:`!__complex__` não for " -"definido, então ele recorre a :meth:`~object.__float__`. Se :meth:`!" -"__float__` não estiver definido, então ele volta para :meth:`~object." -"__index__`." +"Se *op* não é um objeto de número complexo Python, mas tem um " +"método :meth:`~object.__complex__`, este método será primeiro chamado para " +"converter *op* em um objeto de número complexo Python. Se :meth:`!" +"__complex__` não for definido, então ele recorre " +"a :meth:`~object.__float__`. Se :meth:`!__float__` não estiver definido, " +"então ele volta para :meth:`~object.__index__`." #: ../../c-api/complex.rst:164 msgid "" -"Upon failure, this method returns :c:type:`Py_complex` with :c:member:" -"`~Py_complex.real` set to ``-1.0`` and with an exception set, so one should " -"call :c:func:`PyErr_Occurred` to check for errors." +"Upon failure, this method returns :c:type:`Py_complex` " +"with :c:member:`~Py_complex.real` set to ``-1.0`` and with an exception set, " +"so one should call :c:func:`PyErr_Occurred` to check for errors." msgstr "" -"Em caso de falha, este método retorna :c:type:`Py_complex` com :c:member:" -"`~Py_complex.real` definido para ``-1.0`` e com uma exceção definida, então " -"deve-se chamar :c:func:`PyErr_Occurred` para verificar se há erros." +"Em caso de falha, este método retorna :c:type:`Py_complex` " +"com :c:member:`~Py_complex.real` definido para ``-1.0`` e com uma exceção " +"definida, então deve-se chamar :c:func:`PyErr_Occurred` para verificar se há " +"erros." #: ../../c-api/complex.rst:168 msgid "Use :meth:`~object.__index__` if available." diff --git a/c-api/concrete.po b/c-api/concrete.po index 262d9aa78..65f3f30b0 100644 --- a/c-api/concrete.po +++ b/c-api/concrete.po @@ -1,27 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Vinicius Gubiani Ferreira , 2023 -# Rafael Fontenelle , 2023 +# python-doc bot, 2025 +# Rafael Fontenelle , 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-24 14:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2025-11-17 15:03+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -93,12 +92,16 @@ msgstr "Coleções" #: ../../c-api/concrete.rst:91 msgid "Function Objects" -msgstr "Objetos Função" +msgstr "Objetos Function" #: ../../c-api/concrete.rst:102 msgid "Other Objects" msgstr "Outros Objetos" +#: ../../c-api/concrete.rst:123 +msgid "C API for extension modules" +msgstr "API C para módulos de extensão" + #: ../../c-api/concrete.rst:43 ../../c-api/concrete.rst:58 #: ../../c-api/concrete.rst:80 msgid "object" diff --git a/c-api/contextvars.po b/c-api/contextvars.po index 821ce8863..577195ca0 100644 --- a/c-api/contextvars.po +++ b/c-api/contextvars.po @@ -1,45 +1,57 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Vinicius Gubiani Ferreira , 2021 -# Alexsandro Matias de Almeida , 2021 -# Leandro Braga , 2021 +# python-doc bot, 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-24 14:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Leandro Braga , 2021\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: python-doc bot, 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../c-api/contextvars.rst:6 msgid "Context Variables Objects" -msgstr "Objetos de variáveis ​​de contexto" +msgstr "Objetos de variáveis de contexto" #: ../../c-api/contextvars.rst:15 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:" -"`PyContext`, :c:type:`PyContextVar`, and :c:type:`PyContextToken`, e.g.::" +"**changed** to use :c:type:`PyObject` pointers instead " +"of :c:type:`PyContext`, :c:type:`PyContextVar`, " +"and :c:type:`PyContextToken`, e.g.::" msgstr "" "No Python 3.7.1, as assinaturas de todas as APIs C de variáveis de contexto " -"foram **alteradas** para usar ponteiros :c:type:`PyObject` em vez de :c:type:" -"`PyContext`, :c:type:`PyContextVar` e :c:type:`PyContextToken`. Por exemplo::" +"foram **alteradas** para usar ponteiros :c:type:`PyObject` em vez " +"de :c:type:`PyContext`, :c:type:`PyContextVar` e :c:type:`PyContextToken`. " +"Por exemplo::" + +#: ../../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 "" +"// no 3.7.0:\n" +"PyContext *PyContext_New(void);\n" +"\n" +"// no 3.7.1+:\n" +"PyObject *PyContext_New(void);" #: ../../c-api/contextvars.rst:26 msgid "See :issue:`34762` for more details." @@ -60,8 +72,8 @@ msgstr "" msgid "" "The C structure used to represent a :class:`contextvars.ContextVar` object." msgstr "" -"A estrutura C usada para representar um objeto :class:`contextvars." -"ContextVar`." +"A estrutura C usada para representar um " +"objeto :class:`contextvars.ContextVar`." #: ../../c-api/contextvars.rst:43 msgid "The C structure used to represent a :class:`contextvars.Token` object." @@ -214,9 +226,9 @@ msgstr "" #: ../../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 " -"returns ``0`` on success and ``-1`` on error." +"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 returns ``0`` on success and ``-1`` on error." msgstr "" "Redefine o estado da variável de contexto *var* para o estado que anterior " "a :c:func:`PyContextVar_Set` que retornou o *token* foi chamado. Esta função " diff --git a/c-api/conversion.po b/c-api/conversion.po index b8b20373c..f61db8957 100644 --- a/c-api/conversion.po +++ b/c-api/conversion.po @@ -1,25 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 +# Rafael Fontenelle , 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-08-09 16:36+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -34,22 +35,22 @@ msgstr "Funções para conversão de números e saída formatada de strings." #: ../../c-api/conversion.rst:13 msgid "" "Output not more than *size* bytes to *str* according to the format string " -"*format* and the extra arguments. See the Unix man page :manpage:" -"`snprintf(3)`." +"*format* and the extra arguments. See the Unix man " +"page :manpage:`snprintf(3)`." msgstr "" "Saída não superior a *size* bytes para *str* de acordo com a string de " -"formato *format* e os argumentos extras. Veja a página man do Unix :manpage:" -"`snprintf(3)`." +"formato *format* e os argumentos extras. Veja a página man do " +"Unix :manpage:`snprintf(3)`." #: ../../c-api/conversion.rst:19 msgid "" "Output not more than *size* bytes to *str* according to the format string " -"*format* and the variable argument list *va*. Unix man page :manpage:" -"`vsnprintf(3)`." +"*format* and the variable argument list *va*. Unix man " +"page :manpage:`vsnprintf(3)`." msgstr "" "Saída não superior a *size* bytes para *str* de acordo com o string de " -"formato *format* e a variável argumento de lista *va*. Página man do Unix :" -"manpage:`vsnprintf(3)`." +"formato *format* e a variável argumento de lista *va*. Página man do " +"Unix :manpage:`vsnprintf(3)`." #: ../../c-api/conversion.rst:23 msgid "" @@ -58,10 +59,10 @@ msgid "" "is to guarantee consistent behavior in corner cases, which the Standard C " "functions do not." msgstr "" -":c:func:`PyOS_snprintf` e :c:func:`PyOS_vsnprintf` envolvem as funções :c:" -"func:`snprintf` e :c:func:`vsnprintf` da biblioteca Standard C. Seu objetivo " -"é garantir um comportamento consistente em casos extremos, o que as funções " -"do Standard C não garantem." +":c:func:`PyOS_snprintf` e :c:func:`PyOS_vsnprintf` envolvem as " +"funções :c:func:`snprintf` e :c:func:`vsnprintf` da biblioteca Standard C. " +"Seu objetivo é garantir um comportamento consistente em casos extremos, o " +"que as funções do Standard C não garantem." #: ../../c-api/conversion.rst:28 msgid "" @@ -108,11 +109,11 @@ msgstr "" #: ../../c-api/conversion.rst:44 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 " -"error depends on the underlying platform." +"When ``rv < 0``, the output conversion failed and ``str[size-1]`` is " +"``'\\0'`` in this case too, but the rest of *str* is undefined. The exact " +"cause of the error depends on the underlying platform." msgstr "" -"Quando ``rv < 0``, \"aconteceu algo de errado.\" ``str[size-1]`` é ``'\\0'`` " +"Quando ``rv < 0``, a conversão da saída falhou e ``str[size-1]`` é ``'\\0'`` " "neste caso também, mas o resto de *str* é indefinido. A causa exata do erro " "depende da plataforma subjacente." @@ -130,9 +131,9 @@ msgid "" "long` value according to the given ``base``, which must be between ``2`` and " "``36`` inclusive, or be the special value ``0``." msgstr "" -"Converte a parte inicial da string em ``str`` para um valor :c:expr:" -"`unsigned long` de acordo com a ``base`` fornecida, que deve estar entre " -"``2`` e ``36`` inclusive, ou ser o valor especial ``0``." +"Converte a parte inicial da string em ``str`` para um " +"valor :c:expr:`unsigned long` de acordo com a ``base`` fornecida, que deve " +"estar entre ``2`` e ``36`` inclusive, ou ser o valor especial ``0``." #: ../../c-api/conversion.rst:57 msgid "" @@ -151,9 +152,9 @@ 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." +"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 "" "Se o valor convertido ficar fora do intervalo do tipo de retorno " "correspondente, ocorrerá um erro de intervalo (:c:data:`errno` é definido " @@ -179,8 +180,8 @@ msgid "" "Same as :c:func:`PyOS_strtoul`, but return a :c:expr:`long` value instead " "and :c:macro:`LONG_MAX` on overflows." msgstr "" -"O mesmo que :c:func:`PyOS_strtoul`, mas retorna um valor :c:expr:`long` e :c:" -"macro:`LONG_MAX` em caso de estouro." +"O mesmo que :c:func:`PyOS_strtoul`, mas retorna um valor :c:expr:`long` " +"e :c:macro:`LONG_MAX` em caso de estouro." #: ../../c-api/conversion.rst:82 msgid "See also the Unix man page :manpage:`strtol(3)`." @@ -202,13 +203,13 @@ msgstr "" #: ../../c-api/conversion.rst:95 msgid "" -"If ``endptr`` is ``NULL``, convert the whole string. Raise :exc:" -"`ValueError` and return ``-1.0`` if the string is not a valid representation " -"of a floating-point number." +"If ``endptr`` is ``NULL``, convert the whole string. " +"Raise :exc:`ValueError` and return ``-1.0`` if the string is not a valid " +"representation of a floating-point number." msgstr "" -"Se ``endptr`` for ``NULL``, converte a string inteira. Levanta :exc:" -"`ValueError` e retorna ``-1.0`` se a string não for uma representação válida " -"de um número de ponto flutuante." +"Se ``endptr`` for ``NULL``, converte a string inteira. " +"Levanta :exc:`ValueError` e retorna ``-1.0`` se a string não for uma " +"representação válida de um número de ponto flutuante." #: ../../c-api/conversion.rst:99 msgid "" @@ -266,55 +267,66 @@ msgid "" msgstr "" "*format_code* deve ser um entre ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, " "``'G'`` ou ``'r'``. Para ``'r'``, a precisão *precision* fornecida deve ser " -"0 e é ignorada. O código de formato ``'r'`` especifica o formato padrão de :" -"func:`repr`." +"0 e é ignorada. O código de formato ``'r'`` especifica o formato padrão " +"de :func:`repr`." #: ../../c-api/conversion.rst:131 -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:" +msgid "*flags* can be zero or more of the following values or-ed together:" msgstr "" -"*flags* pode ser zero ou mais de valores ``Py_DTSF_SIGN``, " -"``Py_DTSF_ADD_DOT_0`` ou ``Py_DTSF_ALT``, alternados por operador lógico OU:" - -#: ../../c-api/conversion.rst:134 -msgid "" -"``Py_DTSF_SIGN`` means to always precede the returned string with a sign " -"character, even if *val* is non-negative." -msgstr "" -"``Py_DTSF_SIGN`` significa sempre preceder a string retornada com um " -"caractere de sinal, mesmo se *val* não for negativo." +"*flags* podem ser zero ou mais dos seguintes valores combinados por meio do " +"operador OR:" #: ../../c-api/conversion.rst:137 msgid "" -"``Py_DTSF_ADD_DOT_0`` means to ensure that the returned string will not look " -"like an integer." +"Always precede the returned string with a sign character, even if *val* is " +"non-negative." msgstr "" -"``Py_DTSF_ADD_DOT_0`` significa garantir que a string retornada não se " -"pareça com um inteiro." +"Sempre preceda a string retornada com um caractere de sinal, mesmo que *val* " +"não seja negativo." + +#: ../../c-api/conversion.rst:142 +msgid "Ensure that the returned string will not look like an integer." +msgstr "Garante que a string retornada não se pareça com um número inteiro." -#: ../../c-api/conversion.rst:140 +#: ../../c-api/conversion.rst:146 msgid "" -"``Py_DTSF_ALT`` means to apply \"alternate\" formatting rules. See the " -"documentation for the :c:func:`PyOS_snprintf` ``'#'`` specifier for details." +"Apply \"alternate\" formatting rules. See the documentation for " +"the :c:func:`PyOS_snprintf` ``'#'`` specifier for details." msgstr "" -"``Py_DTSF_ALT`` significa aplicar regras de formatação \"alternativas\". " -"Veja a documentação para o especificador ``'#'`` de :c:func:`PyOS_snprintf` " -"para detalhes." +"Aplica as regras de formatação \"alternativas\". Veja a documentação para o " +"especificador ``'#'`` de :c:func:`PyOS_snprintf` para detalhes." -#: ../../c-api/conversion.rst:144 +#: ../../c-api/conversion.rst:152 +msgid "Negative zero is converted to positive zero." +msgstr "Zero negativo é convertido para zerp positivo." + +#: ../../c-api/conversion.rst:156 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 " -"that *val* is a finite number, an infinite number, or not a number, " -"respectively." +"of the following constants depending on the type of *val*:" +msgstr "" + +#: ../../c-api/conversion.rst:163 +msgid "*\\*ptype*" +msgstr "" + +#: ../../c-api/conversion.rst:164 +msgid "type of *val*" msgstr "" -"Se *type* não for ``NULL``, então o valor para o qual ele aponta será " -"definido como um dos ``Py_DTST_FINITE``, ``Py_DTST_INFINITE`` ou " -"``Py_DTST_NAN``, significando que *val* é um número finito, um número " -"infinito ou não um número, respectivamente." -#: ../../c-api/conversion.rst:148 +#: ../../c-api/conversion.rst:166 +msgid "finite number" +msgstr "" + +#: ../../c-api/conversion.rst:168 +msgid "infinite number" +msgstr "" + +#: ../../c-api/conversion.rst:170 +msgid "not a number" +msgstr "" + +#: ../../c-api/conversion.rst:172 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 " @@ -324,20 +336,124 @@ msgstr "" "``NULL`` se a conversão falhou. O chamador é responsável por liberar a " "string retornada chamando :c:func:`PyMem_Free`." -#: ../../c-api/conversion.rst:157 +#: ../../c-api/conversion.rst:182 msgid "" -"Case insensitive comparison of strings. The function works almost " -"identically to :c:func:`!strcmp` except that it ignores the case." +"Case insensitive comparison of strings. These functions work almost " +"identically to :c:func:`!strcmp` and :c:func:`!strncmp` (respectively), " +"except that they ignore the case of ASCII characters." msgstr "" -"Comparação de strings sem diferença entre maiúsculas e minúsculas. A função " -"funciona quase de forma idêntica a :c:func:`!strcmp` exceto que ignora a " -"diferença entre maiúsculas e minúsculas." +"Comparação de strings sem distinção entre maiúsculas e minúsculas. Essas " +"funções funcionam de maneira quase idêntica a :c:func:`!strcmp` e :c:func:`!" +"strncmp` (respectivamente), exceto pelo fato de ignorarem maiúsculas e " +"minúsculas em caracteres ASCII." -#: ../../c-api/conversion.rst:163 +#: ../../c-api/conversion.rst:186 msgid "" -"Case insensitive comparison of strings. The function works almost " -"identically to :c:func:`!strncmp` except that it ignores the case." +"Return ``0`` if the strings are equal, a negative value if *str1* sorts " +"lexicographically before *str2*, or a positive value if it sorts after." msgstr "" -"Comparação de strings sem diferença entre maiúsculas e minúsculas. A função " -"funciona quase de forma idêntica a :c:func:`!strncmp` exceto que ignora a " -"diferença entre maiúsculas e minúsculas." +"Retorna ``0`` se as strings forem iguais, um valor negativo se *str1* for " +"ordenada lexicograficamente antes de *str2*, ou um valor positivo se for " +"ordenada depois." + +#: ../../c-api/conversion.rst:189 +msgid "" +"In the *str1* or *str2* arguments, a NUL byte marks the end of the string. " +"For :c:func:`!PyOS_mystrnicmp`, the *size* argument gives the maximum size " +"of the string, as if NUL was present at the index given by *size*." +msgstr "" +"Nos argumentos *str1* ou *str2*, um byte NUL marca o fim da string. " +"Para :c:func:`!PyOS_mystrnicmp`, o argumento *size* fornece o tamanho máximo " +"da string, como se NUL estivesse presente no índice fornecido por *size*." + +#: ../../c-api/conversion.rst:193 +msgid "These functions do not use the locale." +msgstr "Estas funções não usam a localidade." + +#: ../../c-api/conversion.rst:199 +msgid "Case insensitive comparison of strings." +msgstr "Comparação de strings sem distinção entre maiúsculas e minúsculas." + +#: ../../c-api/conversion.rst:201 +msgid "" +"On Windows, these are aliases of :c:func:`!stricmp` and :c:func:`!strnicmp`, " +"respectively." +msgstr "" +"No Windows, estes são apelidos de :c:func:`!stricmp` e :c:func:`!strnicmp`, " +"respectivamente." + +#: ../../c-api/conversion.rst:204 +msgid "" +"On other platforms, they are aliases of :c:func:`PyOS_mystricmp` " +"and :c:func:`PyOS_mystrnicmp`, respectively." +msgstr "" +"Em outras plataformas, são apelidos de :c:func:`PyOS_mystricmp` " +"e :c:func:`PyOS_mystrnicmp`, respectivamente." + +#: ../../c-api/conversion.rst:209 +msgid "Character classification and conversion" +msgstr "Classificação e conversão de caracteres" + +#: ../../c-api/conversion.rst:211 +msgid "" +"The following macros provide locale-independent (unlike the C standard " +"library ``ctype.h``) character classification and conversion. The argument " +"must be a signed or unsigned :c:expr:`char`." +msgstr "" +"As macros a seguir fornecem classificação e conversão de caracteres " +"independentes de localidade (ao contrário da biblioteca padrão C " +"``ctype.h``). O argumento deve ser um :c:expr:`char` com ou sem sinal." + +#: ../../c-api/conversion.rst:218 +msgid "Return true if the character *c* is an alphanumeric character." +msgstr "Retorna verdadeiro se o caractere *c* for um caractere alfanumérico." + +#: ../../c-api/conversion.rst:223 +msgid "" +"Return true if the character *c* is an alphabetic character (``a-z`` and ``A-" +"Z``)." +msgstr "" +"Retorna verdadeiro se o caractere *c* for um caractere alfabético (``a-z`` e " +"``A-Z``)." + +#: ../../c-api/conversion.rst:228 +msgid "Return true if the character *c* is a decimal digit (``0-9``)." +msgstr "Retorna verdadeiro se o caractere *c* for um dígito decimal (``0-9``)." + +#: ../../c-api/conversion.rst:233 +msgid "Return true if the character *c* is a lowercase ASCII letter (``a-z``)." +msgstr "" +"Retorna verdadeiro se o caractere *c* for uma letra minúscula do ASCII (``a-" +"z``)." + +#: ../../c-api/conversion.rst:238 +msgid "" +"Return true if the character *c* is an uppercase ASCII letter (``A-Z``)." +msgstr "" +"Retorna verdadeiro se o caractere *c* for uma letra maiúscula do ASCII (``A-" +"Z``)." + +#: ../../c-api/conversion.rst:243 +msgid "" +"Return true if the character *c* is a whitespace character (space, tab, " +"carriage return, newline, vertical tab, or form feed)." +msgstr "" +"Retorna verdadeiro se o caractere *c* for um caractere de espaço em branco " +"(espaço, tabulação, retorno de carro, nova linha, tabulação vertical ou " +"alimentação de formulário)." + +#: ../../c-api/conversion.rst:249 +msgid "" +"Return true if the character *c* is a hexadecimal digit (``0-9``, ``a-f``, " +"and ``A-F``)." +msgstr "" +"Retorna verdadeiro se o caractere *c* for um dígito hexadecimal (``0-9``, " +"``a-f`` e ``A-F``)." + +#: ../../c-api/conversion.rst:255 +msgid "Return the lowercase equivalent of the character *c*." +msgstr "Retorna o equivalente em minúsculas do caractere *c*." + +#: ../../c-api/conversion.rst:260 +msgid "Return the uppercase equivalent of the character *c*." +msgstr "Retorna o equivalente em maiúsculas do caractere *c*." diff --git a/c-api/coro.po b/c-api/coro.po index 3b617dc55..f188fc30b 100644 --- a/c-api/coro.po +++ b/c-api/coro.po @@ -1,25 +1,25 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 +# python-doc bot, 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-24 14:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2021\n" +"POT-Creation-Date: 2025-09-15 15:19+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: python-doc bot, 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/curses.po b/c-api/curses.po new file mode 100644 index 000000000..efa16c8ea --- /dev/null +++ b/c-api/curses.po @@ -0,0 +1,252 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2026, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Rafael Fontenelle , 2025 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-11-11 15:08+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" +"Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" +"teams/5390/pt_BR/)\n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " +"1000000 == 0 ? 1 : 2;\n" + +#: ../../c-api/curses.rst:4 +msgid "Curses C API" +msgstr "API C de curses" + +#: ../../c-api/curses.rst:6 +msgid "" +":mod:`curses` exposes a small C interface for extension modules. Consumers " +"must include the header file :file:`py_curses.h` (which is not included by " +"default by :file:`Python.h`) and :c:func:`import_curses` must be invoked, " +"usually as part of the module initialisation function, to " +"populate :c:var:`PyCurses_API`." +msgstr "" +":mod:`curses` expõe uma pequena interface C para módulos de extensão. Os " +"usuários devem incluir o arquivo de cabeçalho :file:`py_curses.h` (que não é " +"incluído por padrão em :file:`Python.h`) e :c:func:`import_curses` deve ser " +"invocada, geralmente como parte da função de inicialização do módulo, para " +"popular :c:var:`PyCurses_API`." + +#: ../../c-api/curses.rst:14 +msgid "" +"Neither the C API nor the pure Python :mod:`curses` module are compatible " +"with subinterpreters." +msgstr "" +"Nem a API C nem o módulo :mod:`curses` do Python puro são compatíveis com " +"subinterpretadores." + +#: ../../c-api/curses.rst:19 +msgid "" +"Import the curses C API. The macro does not need a semi-colon to be called." +msgstr "" +"Importa a API C do curses. A macro não precisa de ponto e vírgula para ser " +"chamada." + +#: ../../c-api/curses.rst:21 +msgid "On success, populate the :c:var:`PyCurses_API` pointer." +msgstr "Em caso de sucesso, popula o ponteiro :c:var:`PyCurses_API`." + +#: ../../c-api/curses.rst:23 +msgid "" +"On failure, set :c:var:`PyCurses_API` to NULL and set an exception. The " +"caller must check if an error occurred via :c:func:`PyErr_Occurred`:" +msgstr "" +"Em caso de falha, define :c:var:`PyCurses_API` como NULL e levanta uma " +"exceção. O chamador deve verificar se ocorreu um erro através " +"de :c:func:`PyErr_Occurred`:" + +#: ../../c-api/curses.rst:26 +msgid "" +"import_curses(); // semi-colon is optional but recommended\n" +"if (PyErr_Occurred()) { /* cleanup */ }" +msgstr "" +"import_curses(); // O ponto e vírgula é opcional, mas recomendado.\n" +"if (PyErr_Occurred()) { /* cleanup */ }" + +#: ../../c-api/curses.rst:34 +msgid "" +"Dynamically allocated object containing the curses C API. This variable is " +"only available once :c:macro:`import_curses` succeeds." +msgstr "" +"Objeto alocado dinamicamente contendo a API C do curses. Esta variável só " +"estará disponível após a execução bem-sucedida da " +"macro :c:macro:`import_curses`." + +#: ../../c-api/curses.rst:37 +msgid "``PyCurses_API[0]`` corresponds to :c:data:`PyCursesWindow_Type`." +msgstr "``PyCurses_API[0]`` corresponde a :c:data:`PyCursesWindow_Type`." + +#: ../../c-api/curses.rst:39 +msgid "" +"``PyCurses_API[1]``, ``PyCurses_API[2]``, and ``PyCurses_API[3]`` are " +"pointers to predicate functions of type ``int (*)(void)``." +msgstr "" +"``PyCurses_API[1]``, ``PyCurses_API[2]`` e ``PyCurses_API[3]`` são ponteiros " +"para funções predicativas do tipo ``int (*)(void)``." + +#: ../../c-api/curses.rst:42 +msgid "" +"When called, these predicates return " +"whether :func:`curses.setupterm`, :func:`curses.initscr`, " +"and :func:`curses.start_color` have been called respectively." +msgstr "" +"Quando chamados, esses predicados retornam " +"se :func:`curses.setupterm`, :func:`curses.initscr` " +"e :func:`curses.start_color` foram chamados, respectivamente." + +#: ../../c-api/curses.rst:46 +msgid "" +"See also the convenience " +"macros :c:macro:`PyCursesSetupTermCalled`, :c:macro:`PyCursesInitialised`, " +"and :c:macro:`PyCursesInitialisedColor`." +msgstr "" +"Veja também as macros de " +"conveniência :c:macro:`PyCursesSetupTermCalled`, :c:macro:`PyCursesInitialised` " +"e :c:macro:`PyCursesInitialisedColor`." + +#: ../../c-api/curses.rst:51 +msgid "" +"The number of entries in this structure is subject to changes. Consider " +"using :c:macro:`PyCurses_API_pointers` to check if new fields are available " +"or not." +msgstr "" +"O número de entradas nesta estrutura está sujeito a alterações. Considere " +"usar :c:macro:`PyCurses_API_pointers` para verificar se novos campos estão " +"disponíveis." + +#: ../../c-api/curses.rst:58 +msgid "" +"The number of accessible fields (``4``) in :c:var:`PyCurses_API`. This " +"number is incremented whenever new fields are added." +msgstr "" +"O número de campos acessíveis (``4``) em :c:var:`PyCurses_API`. Esse número " +"é incrementado sempre que novos campos são adicionados." + +#: ../../c-api/curses.rst:64 +msgid "" +"The :ref:`heap type ` corresponding to :class:`curses.window`." +msgstr "" +"O :ref:`tipo de heap ` correspondente a :class:`curses.window`." + +#: ../../c-api/curses.rst:69 +msgid "" +"Return true if *op* is a :class:`curses.window` instance, false otherwise." +msgstr "" +"Retorna verdadeiro se *op* for uma instância de :class:`curses.window`, " +"falso caso contrário." + +#: ../../c-api/curses.rst:72 +msgid "" +"The following macros are convenience macros expanding into C statements. In " +"particular, they can only be used as ``macro;`` or ``macro``, but not " +"``macro()`` or ``macro();``." +msgstr "" +"As macros a seguir são macros de conveniência que se expandem em instruções " +"C. Em particular, elas só podem ser usadas como ``macro;`` ou ``macro``, mas " +"não como ``macro()`` ou ``macro();``." + +#: ../../c-api/curses.rst:78 +msgid "Macro checking if :func:`curses.setupterm` has been called." +msgstr "Macro que verifica se :func:`curses.setupterm` foi chamada." + +#: ../../c-api/curses.rst:80 ../../c-api/curses.rst:97 +#: ../../c-api/curses.rst:114 +msgid "The macro expansion is roughly equivalent to:" +msgstr "A expansão de macro é aproximadamente equivalente a:" + +#: ../../c-api/curses.rst:82 +msgid "" +"{\n" +" typedef int (*predicate_t)(void);\n" +" predicate_t was_setupterm_called = (predicate_t)PyCurses_API[1];\n" +" if (!was_setupterm_called()) {\n" +" return NULL;\n" +" }\n" +"}" +msgstr "" +"{\n" +" typedef int (*predicate_t)(void);\n" +" predicate_t was_setupterm_called = (predicate_t)PyCurses_API[1];\n" +" if (!was_setupterm_called()) {\n" +" return NULL;\n" +" }\n" +"}" + +#: ../../c-api/curses.rst:95 +msgid "Macro checking if :func:`curses.initscr` has been called." +msgstr "Macro que verifica se :func:`curses.initscr` foi chamada." + +#: ../../c-api/curses.rst:99 +msgid "" +"{\n" +" typedef int (*predicate_t)(void);\n" +" predicate_t was_initscr_called = (predicate_t)PyCurses_API[2];\n" +" if (!was_initscr_called()) {\n" +" return NULL;\n" +" }\n" +"}" +msgstr "" +"{\n" +" typedef int (*predicate_t)(void);\n" +" predicate_t was_initscr_called = (predicate_t)PyCurses_API[2];\n" +" if (!was_initscr_called()) {\n" +" return NULL;\n" +" }\n" +"}" + +#: ../../c-api/curses.rst:112 +msgid "Macro checking if :func:`curses.start_color` has been called." +msgstr "Macro que verifica se :func:`curses.start_color` foi chamada." + +#: ../../c-api/curses.rst:116 +msgid "" +"{\n" +" typedef int (*predicate_t)(void);\n" +" predicate_t was_start_color_called = (predicate_t)PyCurses_API[3];\n" +" if (!was_start_color_called()) {\n" +" return NULL;\n" +" }\n" +"}" +msgstr "" +"{\n" +" typedef int (*predicate_t)(void);\n" +" predicate_t was_start_color_called = (predicate_t)PyCurses_API[3];\n" +" if (!was_start_color_called()) {\n" +" return NULL;\n" +" }\n" +"}" + +#: ../../c-api/curses.rst:128 +msgid "Internal data" +msgstr "Dados internos" + +#: ../../c-api/curses.rst:130 +msgid "" +"The following objects are exposed by the C API but should be considered " +"internal-only." +msgstr "" +"Os seguintes objetos são expostos pela API C, mas devem ser considerados " +"apenas para uso interno." + +#: ../../c-api/curses.rst:135 +msgid "Name of the curses capsule to pass to :c:func:`PyCapsule_Import`." +msgstr "" +"Nome da cápsula do curses a ser passada para :c:func:`PyCapsule_Import`." + +#: ../../c-api/curses.rst:137 +msgid "Internal usage only. Use :c:macro:`import_curses` instead." +msgstr "Uso interno apenas. Use :c:macro:`import_curses` em vez disso." diff --git a/c-api/datetime.po b/c-api/datetime.po index 87149f4a9..a4d9a8aaf 100644 --- a/c-api/datetime.po +++ b/c-api/datetime.po @@ -1,27 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Adjamilton Júnior , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Rafael Fontenelle , 2022 +# python-doc bot, 2025 +# Rafael Fontenelle , 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-11 18:37+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2022\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -33,165 +32,257 @@ msgstr "Objetos DateTime" 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 " -"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 " -"the following macros." -msgstr "" +"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 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 the following macros." +msgstr "" +"Vários objetos de data e hora são fornecidos pelo módulo :mod:`datetime`. " +"Antes de usar qualquer uma dessas funções, o arquivo de " +"cabeçalho :file:`datetime.h` deve ser incluído na sua fonte (observe que " +"isso não é incluído por :file:`Python.h`) e a " +"macro :c:macro:`PyDateTime_IMPORT` deve ser chamada, geralmente como parte " +"da função de inicialização do módulo. A macro coloca um ponteiro para uma " +"estrutura C em uma variável estática, :c:data:`PyDateTimeAPI`, usada pelas " +"macros a seguir." #: ../../c-api/datetime.rst:18 +msgid "Import the datetime C API." +msgstr "Importa a API C de datetime." + +#: ../../c-api/datetime.rst:20 +msgid "" +"On success, populate the :c:var:`PyDateTimeAPI` pointer. On failure, " +"set :c:var:`PyDateTimeAPI` to ``NULL`` and set an exception. The caller must " +"check if an error occurred via :c:func:`PyErr_Occurred`:" +msgstr "" +"Em caso de sucesso, preenche o ponteiro :c:var:`PyDateTimeAPI`. Em caso de " +"falha, define :c:var:`PyDateTimeAPI` como ``NULL`` e lança uma exceção. O " +"chamador deve verificar se ocorreu um erro através " +"de :c:func:`PyErr_Occurred`:" + +#: ../../c-api/datetime.rst:24 +msgid "" +"PyDateTime_IMPORT;\n" +"if (PyErr_Occurred()) { /* cleanup */ }" +msgstr "" +"PyDateTime_IMPORT;\n" +"if (PyErr_Occurred()) { /* limpeza */ }" + +#: ../../c-api/datetime.rst:31 +msgid "This is not compatible with subinterpreters." +msgstr "Isso não é compatível com subinterpretadores." + +#: ../../c-api/datetime.rst:35 +msgid "Structure containing the fields for the datetime C API." +msgstr "Estrutura contendo os campos para a API C de datetime." + +#: ../../c-api/datetime.rst:37 +msgid "The fields of this structure are private and subject to change." +msgstr "Os campos desta estrutura são privados e sujeitos a alterações." + +#: ../../c-api/datetime.rst:39 +msgid "Do not use this directly; prefer ``PyDateTime_*`` APIs instead." +msgstr "Não use isto diretamente; prefira as APIs ``PyDateTime_*``." + +#: ../../c-api/datetime.rst:43 +msgid "Dynamically allocated object containing the datetime C API." +msgstr "Objeto alocado dinamicamente contendo a API C de datetime." + +#: ../../c-api/datetime.rst:45 +msgid "" +"This variable is only available once :c:macro:`PyDateTime_IMPORT` succeeds." +msgstr "" +"Esta variável só estará disponível após a execução bem-sucedida " +"de :c:macro:`PyDateTime_IMPORT`." + +#: ../../c-api/datetime.rst:49 msgid "This subtype of :c:type:`PyObject` represents a Python date object." msgstr "" +"Esta é uma instância de :c:type:`PyObject` representando o objeto data do " +"Python." -#: ../../c-api/datetime.rst:22 +#: ../../c-api/datetime.rst:53 msgid "This subtype of :c:type:`PyObject` represents a Python datetime object." msgstr "" +"Esta é uma instância de :c:type:`PyObject` representando o objeto datetime " +"do Python." -#: ../../c-api/datetime.rst:26 +#: ../../c-api/datetime.rst:57 msgid "This subtype of :c:type:`PyObject` represents a Python time object." msgstr "" +"Esta é uma instância de :c:type:`PyObject` representando o objeto hora do " +"Python." -#: ../../c-api/datetime.rst:30 +#: ../../c-api/datetime.rst:61 msgid "" "This subtype of :c:type:`PyObject` represents the difference between two " "datetime values." msgstr "" +"Esta é uma instância de :c:type:`PyObject` representando a diferença entre " +"dois valores de datetime." -#: ../../c-api/datetime.rst:34 +#: ../../c-api/datetime.rst:65 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 "" +"Esta instância de :c:type:`PyTypeObject` representa o tipo data do Python; é " +"o mesmo objeto que :class:`datetime.date` na camada de Python." -#: ../../c-api/datetime.rst:39 +#: ../../c-api/datetime.rst:70 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 "" +"Esta instância de :c:type:`PyTypeObject` representa o tipo datetime do " +"Python; é o mesmo objeto que :class:`datetime.datetime` na camada de Python." -#: ../../c-api/datetime.rst:44 +#: ../../c-api/datetime.rst:75 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 "" +"Esta instância de :c:type:`PyTypeObject` representa o tipo hora do Python; é " +"o mesmo objeto que :class:`datetime.time` na camada de Python." -#: ../../c-api/datetime.rst:49 +#: ../../c-api/datetime.rst:80 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." +"This instance of :c:type:`PyTypeObject` represents the Python type for the " +"difference between two datetime values; it is the same object " +"as :class:`datetime.timedelta` in the Python layer." msgstr "" +"Esta instância de :c:type:`PyTypeObject` representa o tipo Python para a " +"diferença entre dois valores de datetime; é o mesmo objeto " +"que :class:`datetime.timedelta` na camada de Python." -#: ../../c-api/datetime.rst:55 +#: ../../c-api/datetime.rst:86 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 "" +"Esta instância de :c:type:`PyTypeObject` representa o tipo fuso horário do " +"Python; é o mesmo objeto que :class:`datetime.tzinfo` na camada de Python." -#: ../../c-api/datetime.rst:59 +#: ../../c-api/datetime.rst:90 msgid "Macro for access to the UTC singleton:" msgstr "Macro para acesso ao singleton UTC:" -#: ../../c-api/datetime.rst:63 +#: ../../c-api/datetime.rst:94 msgid "" -"Returns the time zone singleton representing UTC, the same object as :attr:" -"`datetime.timezone.utc`." +"Returns the time zone singleton representing UTC, the same object " +"as :attr:`datetime.timezone.utc`." msgstr "" "Retorna um singleton do fuso horário representando o UTC, o mesmo objeto " "que :attr:`datetime.timezone.utc`." -#: ../../c-api/datetime.rst:69 +#: ../../c-api/datetime.rst:100 msgid "Type-check macros:" msgstr "Macros de verificação de tipo:" -#: ../../c-api/datetime.rst:73 +#: ../../c-api/datetime.rst:104 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." msgstr "" +"Retorna verdadeiro se *ob* for do tipo :c:data:`PyDateTime_DateType` ou um " +"subtipo de :c:data:`!PyDateTime_DateType`. *ob* não deve ser ``NULL``. Esta " +"função sempre tem sucesso." -#: ../../c-api/datetime.rst:80 +#: ../../c-api/datetime.rst:111 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_DateType`. *ob* must not " "be ``NULL``. This function always succeeds." msgstr "" -"Retorna true se *ob* for do tipo :c:data:`PyDateTime_DateType`. *ob* não " -"deve ser ``NULL``. Esta função sempre tem sucesso." +"Retorna verdadeiro se *ob* for do tipo :c:data:`PyDateTime_DateType`. *ob* " +"não deve ser ``NULL``. Esta função sempre tem sucesso." -#: ../../c-api/datetime.rst:86 +#: ../../c-api/datetime.rst:117 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``. " "This function always succeeds." msgstr "" +"Retorna verdadeiro se *ob* é do tipo :c:data:`PyDateTime_DateTimeType` ou um " +"subtipo de :c:data:`!PyDateTime_DateTimeType`. *ob* não deve ser ``NULL``. " +"Esta função sempre tem sucesso." -#: ../../c-api/datetime.rst:93 +#: ../../c-api/datetime.rst:124 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_DateTimeType`. *ob* must " "not be ``NULL``. This function always succeeds." msgstr "" -"Retorna true se *ob* for do tipo :c:data:`PyDateTime_DateTimeType`. *ob* não " -"deve ser ``NULL``. Esta função sempre tem sucesso." +"Retorna verdadeiro se *ob* for do tipo :c:data:`PyDateTime_DateTimeType`. " +"*ob* não deve ser ``NULL``. Esta função sempre tem sucesso." -#: ../../c-api/datetime.rst:99 +#: ../../c-api/datetime.rst:130 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." msgstr "" +"Retorna verdadeiro se *ob* é do tipo :c:data:`PyDateTime_TimeType` ou um " +"subtipo de :c:data:`!PyDateTime_TimeType`. *ob* não deve ser ``NULL``. Esta " +"função sempre tem sucesso." -#: ../../c-api/datetime.rst:106 +#: ../../c-api/datetime.rst:137 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_TimeType`. *ob* must not " "be ``NULL``. This function always succeeds." msgstr "" -"Retorna true se *ob* for do tipo :c:data:`PyDateTime_TimeType`. *ob* não " -"deve ser ``NULL``. Esta função sempre tem sucesso." +"Retorna verdadeiro se *ob* for do tipo :c:data:`PyDateTime_TimeType`. *ob* " +"não deve ser ``NULL``. Esta função sempre tem sucesso." -#: ../../c-api/datetime.rst:112 +#: ../../c-api/datetime.rst:143 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 " "function always succeeds." msgstr "" +"Retorna verdadeiro se *ob* for do tipo :c:data:`PyDateTime_DeltaType` ou um " +"subtipo de :c:data:`!PyDateTime_DeltaType`. *ob* não pode ser ``NULL``. Esta " +"função sempre tem sucesso." -#: ../../c-api/datetime.rst:119 +#: ../../c-api/datetime.rst:150 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_DeltaType`. *ob* must not " "be ``NULL``. This function always succeeds." msgstr "" -"Retorna true se *ob* for do tipo :c:data:`PyDateTime_DeltaType`. *ob* não " -"deve ser ``NULL``. Esta função sempre tem sucesso." +"Retorna verdadeiro se *ob* for do tipo :c:data:`PyDateTime_DeltaType`. *ob* " +"não deve ser ``NULL``. Esta função sempre tem sucesso." -#: ../../c-api/datetime.rst:125 +#: ../../c-api/datetime.rst:156 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 " "function always succeeds." msgstr "" +"Retorna verdadeiro se *ob* for do tipo :c:data:`PyDateTime_TZInfoType` ou um " +"subtipo de :c:data:`!PyDateTime_TZInfoType`. *ob* não pode ser ``NULL``. " +"Esta função sempre tem sucesso." -#: ../../c-api/datetime.rst:132 +#: ../../c-api/datetime.rst:163 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_TZInfoType`. *ob* must " "not be ``NULL``. This function always succeeds." msgstr "" -"Retorna true se *ob* for do tipo :c:data:`PyDateTime_TZInfoType`. *ob* não " -"deve ser ``NULL``. Esta função sempre tem sucesso." +"Retorna verdadeiro se *ob* for do tipo :c:data:`PyDateTime_TZInfoType`. *ob* " +"não deve ser ``NULL``. Esta função sempre tem sucesso." -#: ../../c-api/datetime.rst:136 +#: ../../c-api/datetime.rst:167 msgid "Macros to create objects:" msgstr "Macros para criar objetos:" -#: ../../c-api/datetime.rst:140 +#: ../../c-api/datetime.rst:171 msgid "" "Return a :class:`datetime.date` object with the specified year, month and " "day." msgstr "" "Retorna um objeto :class:`datetime.date` com o ano, mês e dia especificados." -#: ../../c-api/datetime.rst:145 +#: ../../c-api/datetime.rst:176 msgid "" "Return a :class:`datetime.datetime` object with the specified year, month, " "day, hour, minute, second and microsecond." @@ -199,7 +290,7 @@ msgstr "" "Retorna um objeto :class:`datetime.datetime` com o ano, mês, dia, hora, " "minuto, segundo, microssegundo especificados." -#: ../../c-api/datetime.rst:151 +#: ../../c-api/datetime.rst:182 msgid "" "Return a :class:`datetime.datetime` object with the specified year, month, " "day, hour, minute, second, microsecond and fold." @@ -207,7 +298,7 @@ msgstr "" "Retorna um objeto :class:`datetime.datetime` com o ano, mês, dia, hora, " "minuto, segundo, microssegundo e a dobra especificados." -#: ../../c-api/datetime.rst:159 +#: ../../c-api/datetime.rst:190 msgid "" "Return a :class:`datetime.time` object with the specified hour, minute, " "second and microsecond." @@ -215,7 +306,7 @@ msgstr "" "Retorna um objeto :class:`datetime.time` com a hora, minuto, segundo e " "microssegundo especificados." -#: ../../c-api/datetime.rst:165 +#: ../../c-api/datetime.rst:196 msgid "" "Return a :class:`datetime.time` object with the specified hour, minute, " "second, microsecond and fold." @@ -223,7 +314,7 @@ msgstr "" "Retorna um objeto :class:`datetime.time` com a hora, minuto, segundo, " "microssegundo e a dobra especificados." -#: ../../c-api/datetime.rst:173 +#: ../../c-api/datetime.rst:204 msgid "" "Return a :class:`datetime.timedelta` object representing the given number of " "days, seconds and microseconds. Normalization is performed so that the " @@ -235,7 +326,7 @@ msgstr "" "para que o número resultante de microssegundos e segundos esteja nos " "intervalos documentados para objetos de :class:`datetime.timedelta`." -#: ../../c-api/datetime.rst:181 +#: ../../c-api/datetime.rst:212 msgid "" "Return a :class:`datetime.timezone` object with an unnamed fixed offset " "represented by the *offset* argument." @@ -243,7 +334,7 @@ msgstr "" "Retorna um objeto :class:`datetime.timezone` com um deslocamento fixo sem " "nome representado pelo argumento *offset*." -#: ../../c-api/datetime.rst:189 +#: ../../c-api/datetime.rst:220 msgid "" "Return a :class:`datetime.timezone` object with a fixed offset represented " "by the *offset* argument and with tzname *name*." @@ -251,100 +342,135 @@ msgstr "" "Retorna um objeto :class:`datetime.timezone` com um deslocamento fixo " "representado pelo argumento *offset* e com tzname *name*." -#: ../../c-api/datetime.rst:195 +#: ../../c-api/datetime.rst:226 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:" -"`PyDateTime_DateTime`). The argument must not be ``NULL``, and the type is " -"not checked:" +"instance of :c:type:`PyDateTime_Date`, including subclasses (such " +"as :c:type:`PyDateTime_DateTime`). The argument must not be ``NULL``, and " +"the type is not checked:" msgstr "" +"Macros para extrair campos de objetos *date*. O argumento deve ser uma " +"instância de :c:type:`PyDateTime_Date`, inclusive subclasses " +"(como :c:type:`PyDateTime_DateTime`). O argumento não deve ser ``NULL``, e o " +"tipo não é verificado:" -#: ../../c-api/datetime.rst:202 +#: ../../c-api/datetime.rst:233 msgid "Return the year, as a positive int." msgstr "Retorna o ano, como um inteiro positivo." -#: ../../c-api/datetime.rst:207 +#: ../../c-api/datetime.rst:238 msgid "Return the month, as an int from 1 through 12." msgstr "Retorna o mês, como um inteiro de 1 a 12." -#: ../../c-api/datetime.rst:212 +#: ../../c-api/datetime.rst:243 msgid "Return the day, as an int from 1 through 31." msgstr "Retorna o dia, como um inteiro de 1 a 31." -#: ../../c-api/datetime.rst:215 +#: ../../c-api/datetime.rst:246 msgid "" "Macros to extract fields from datetime objects. The argument must be an " "instance of :c:type:`PyDateTime_DateTime`, including subclasses. The " "argument must not be ``NULL``, and the type is not checked:" msgstr "" +"Macros para extrair campos de objetos *datetime*. O argumento deve ser uma " +"instância de :c:type:`PyDateTime_DateTime`, inclusive subclasses. O " +"argumento não deve ser ``NULL``, e o tipo não é verificado:" -#: ../../c-api/datetime.rst:221 ../../c-api/datetime.rst:259 +#: ../../c-api/datetime.rst:252 ../../c-api/datetime.rst:290 msgid "Return the hour, as an int from 0 through 23." msgstr "Retorna a hora, como um inteiro de 0 a 23." -#: ../../c-api/datetime.rst:226 ../../c-api/datetime.rst:264 +#: ../../c-api/datetime.rst:257 ../../c-api/datetime.rst:295 msgid "Return the minute, as an int from 0 through 59." msgstr "Retorna o minuto, como um inteiro de 0 a 59." -#: ../../c-api/datetime.rst:231 ../../c-api/datetime.rst:269 +#: ../../c-api/datetime.rst:262 ../../c-api/datetime.rst:300 msgid "Return the second, as an int from 0 through 59." msgstr "Retorna o segundo, como um inteiro de 0 a 59." -#: ../../c-api/datetime.rst:236 ../../c-api/datetime.rst:274 +#: ../../c-api/datetime.rst:267 ../../c-api/datetime.rst:305 msgid "Return the microsecond, as an int from 0 through 999999." msgstr "Retorna o microssegundo, como um inteiro de 0 a 999999." -#: ../../c-api/datetime.rst:241 ../../c-api/datetime.rst:279 +#: ../../c-api/datetime.rst:272 ../../c-api/datetime.rst:310 msgid "Return the fold, as an int from 0 through 1." msgstr "Retorna a dobra, como um inteiro de 0 a 1." -#: ../../c-api/datetime.rst:248 ../../c-api/datetime.rst:286 +#: ../../c-api/datetime.rst:279 ../../c-api/datetime.rst:317 msgid "Return the tzinfo (which may be ``None``)." msgstr "Retorna o tzinfo (que pode ser ``None``)." -#: ../../c-api/datetime.rst:253 +#: ../../c-api/datetime.rst:284 msgid "" "Macros to extract fields from time objects. The argument must be an " "instance of :c:type:`PyDateTime_Time`, including subclasses. The argument " "must not be ``NULL``, and the type is not checked:" msgstr "" +"Macros para extrair campos de objetos *time*. O argumento deve ser uma " +"instância de :c:type:`PyDateTime_Time`, inclusive subclasses. O argumento " +"não deve ser ``NULL``, e o tipo não é verificado:" -#: ../../c-api/datetime.rst:291 +#: ../../c-api/datetime.rst:322 msgid "" "Macros to extract fields from time delta objects. The argument must be an " "instance of :c:type:`PyDateTime_Delta`, including subclasses. The argument " "must not be ``NULL``, and the type is not checked:" msgstr "" +"Macros para extrair campos de objetos *time delta*. O argumento deve ser uma " +"instância de :c:type:`PyDateTime_Delta`, inclusive subclasses. O argumento " +"não deve ser ``NULL``, e o tipo não é verificado:" -#: ../../c-api/datetime.rst:297 +#: ../../c-api/datetime.rst:328 msgid "Return the number of days, as an int from -999999999 to 999999999." msgstr "Retorna o número de dias, como um inteiro de -999999999 a 999999999." -#: ../../c-api/datetime.rst:304 +#: ../../c-api/datetime.rst:335 msgid "Return the number of seconds, as an int from 0 through 86399." msgstr "Retorna o número de segundos, como um inteiro de 0 a 86399." -#: ../../c-api/datetime.rst:311 +#: ../../c-api/datetime.rst:342 msgid "Return the number of microseconds, as an int from 0 through 999999." msgstr "Retorna o número de microssegundos, como um inteiro de 0 a 999999." -#: ../../c-api/datetime.rst:316 +#: ../../c-api/datetime.rst:347 msgid "Macros for the convenience of modules implementing the DB API:" msgstr "Macros para a conveniência de módulos implementando a API de DB:" -#: ../../c-api/datetime.rst:320 +#: ../../c-api/datetime.rst:351 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 "" -"Cria e retorna um novo objeto :class:`datetime.datetime`, com uma tupla de " -"argumentos adequada para passar para :meth:`datetime.datetime." -"fromtimestamp()`." +"Cria e retorna um novo objeto :class:`datetime.datetime` dado uma tupla de " +"argumentos que possa ser passada ao " +"método :meth:`datetime.datetime.fromtimestamp`." -#: ../../c-api/datetime.rst:326 +#: ../../c-api/datetime.rst:357 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 "" +"Cria e retorna um novo objeto :class:`datetime.date` dado uma tupla de " +"argumentos que possa ser passada ao " +"método :meth:`datetime.date.fromtimestamp`." + +#: ../../c-api/datetime.rst:362 +msgid "Internal data" +msgstr "Dados internos" + +#: ../../c-api/datetime.rst:364 +msgid "" +"The following symbols are exposed by the C API but should be considered " +"internal-only." +msgstr "" +"Os seguintes símbolos são expostos pela API C, mas devem ser considerados " +"apenas para uso interno." + +#: ../../c-api/datetime.rst:369 +msgid "Name of the datetime capsule to pass to :c:func:`PyCapsule_Import`." msgstr "" -"Cria e retorna um novo objeto :class:`datetime.date`, com uma tupla de " -"argumentos adequada para passar para :meth:`datetime.date.fromtimestamp()`." +"Nome da cápsula de datetime a ser passada para :c:func:`PyCapsule_Import`." + +#: ../../c-api/datetime.rst:371 +msgid "Internal usage only. Use :c:macro:`PyDateTime_IMPORT` instead." +msgstr "Uso interno apenas. Use :c:macro:`PyDateTime_IMPORT` em vez disso." diff --git a/c-api/descriptor.po b/c-api/descriptor.po index 4f911099c..1b3958575 100644 --- a/c-api/descriptor.po +++ b/c-api/descriptor.po @@ -1,32 +1,32 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Rafael Fontenelle , 2021 +# python-doc bot, 2025 +# Rafael Fontenelle , 2026 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-24 14:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2021\n" +"POT-Creation-Date: 2026-10-19 21:31+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2026\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../c-api/descriptor.rst:6 msgid "Descriptor Objects" -msgstr "Objetos Descritores" +msgstr "Objetos descritores" #: ../../c-api/descriptor.rst:8 msgid "" @@ -36,16 +36,241 @@ msgstr "" "\"Descritores\" são objetos que descrevem algum atributo de um objeto. Eles " "são encontrados no dicionário de objetos de tipo." -#: ../../c-api/descriptor.rst:15 +#: ../../c-api/descriptor.rst:13 msgid "The type object for the built-in descriptor types." msgstr "O tipo de objeto para os tipos de descritores embutidos." -#: ../../c-api/descriptor.rst:35 +#: ../../c-api/descriptor.rst:18 +msgid "" +"Create a new get-set descriptor for extension type *type* from " +"the :c:type:`PyGetSetDef` structure *getset*." +msgstr "" + +#: ../../c-api/descriptor.rst:21 +msgid "" +"Get-set descriptors expose attributes implemented by C getter and setter " +"functions rather than stored directly in the instance. This is the same kind " +"of descriptor created for entries in :c:member:`~PyTypeObject.tp_getset`, " +"and it appears in Python as a :class:`types.GetSetDescriptorType` object." +msgstr "" + +#: ../../c-api/descriptor.rst:26 ../../c-api/descriptor.rst:39 +#: ../../c-api/descriptor.rst:70 ../../c-api/descriptor.rst:101 +#: ../../c-api/descriptor.rst:123 +msgid "" +"On success, return a :term:`strong reference` to the descriptor. Return " +"``NULL`` with an exception set on failure." +msgstr "" + +#: ../../c-api/descriptor.rst:31 +msgid "" +"Create a new member descriptor for extension type *type* from " +"the :c:type:`PyMemberDef` structure *member*." +msgstr "" + +#: ../../c-api/descriptor.rst:34 +msgid "" +"Member descriptors expose fields in the type's C struct as Python " +"attributes. This is the same kind of descriptor created for entries " +"in :c:member:`~PyTypeObject.tp_members`, and it appears in Python as " +"a :class:`types.MemberDescriptorType` object." +msgstr "" + +#: ../../c-api/descriptor.rst:44 +msgid "" +"The type object for member descriptor objects created " +"from :c:type:`PyMemberDef` structures. These descriptors expose fields of a " +"C struct as attributes on a type, and correspond " +"to :class:`types.MemberDescriptorType` objects in Python." +msgstr "" +"O objeto de tipo para descritores de membros criados a partir de " +"estruturas :c:type:`PyMemberDef`. Esses descritores expõem campos de uma " +"estrutura C como atributos de um tipo e correspondem a " +"objetos :class:`types.MemberDescriptorType` em Python." + +#: ../../c-api/descriptor.rst:53 +msgid "" +"The type object for get/set descriptor objects created " +"from :c:type:`PyGetSetDef` structures. These descriptors implement " +"attributes whose value is computed by C getter and setter functions, and are " +"used for many built-in type attributes. They correspond " +"to :class:`types.GetSetDescriptorType` objects in Python." +msgstr "" + +#: ../../c-api/descriptor.rst:62 +msgid "" +"Create a new method descriptor for extension type *type* from " +"the :c:type:`PyMethodDef` structure *meth*." +msgstr "" + +#: ../../c-api/descriptor.rst:65 +msgid "" +"Method descriptors expose C functions as methods on a type. This is the same " +"kind of descriptor created for entries " +"in :c:member:`~PyTypeObject.tp_methods`, and it appears in Python as " +"a :class:`types.MethodDescriptorType` object." +msgstr "" + +#: ../../c-api/descriptor.rst:75 +msgid "" +"The type object for method descriptor objects created " +"from :c:type:`PyMethodDef` structures. These descriptors expose C functions " +"as methods on a type, and correspond to :class:`types.MethodDescriptorType` " +"objects in Python." +msgstr "" + +#: ../../c-api/descriptor.rst:83 +msgid "Describes a slot wrapper used by :c:func:`PyDescr_NewWrapper`." +msgstr "" + +#: ../../c-api/descriptor.rst:85 +msgid "" +"Each ``wrapperbase`` record stores the Python-visible name and metadata for " +"a special method implemented by a type slot, together with the wrapper " +"function used to adapt that slot to Python's calling convention." +msgstr "" + +#: ../../c-api/descriptor.rst:91 +msgid "" +"Create a new wrapper descriptor for extension type *type* from " +"the :c:struct:`wrapperbase` structure *base* and the wrapped slot function " +"pointer *wrapped*." +msgstr "" + +#: ../../c-api/descriptor.rst:96 +msgid "" +"Wrapper descriptors expose special methods implemented by type slots. This " +"is the same kind of descriptor that CPython creates for slot-based special " +"methods such as ``__repr__`` or ``__add__``, and it appears in Python as " +"a :class:`types.WrapperDescriptorType` object." +msgstr "" + +#: ../../c-api/descriptor.rst:106 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." +"The type object for wrapper descriptor objects created " +"by :c:func:`PyDescr_NewWrapper` and :c:func:`PyWrapper_New`. Wrapper " +"descriptors are used internally to expose special methods implemented via " +"wrapper structures, and appear in Python " +"as :class:`types.WrapperDescriptorType` objects." msgstr "" -"Retorna não-zero se os objetos descritores *descr* descrevem um atributo de " +"O objeto de tipo para objetos descritores de encapsulamento criados " +"por :c:func:`PyDescr_NewWrapper` e :c:func:`PyWrapper_New`. Os descritores " +"de encapsulamento são usados internamente para expor métodos especiais " +"implementados por meio de estruturas de encapsulamento e aparecem em Python " +"como objetos :class:`types.WrapperDescriptorType`." + +#: ../../c-api/descriptor.rst:115 +msgid "" +"Create a new class method descriptor for extension type *type* from " +"the :c:type:`PyMethodDef` structure *method*." +msgstr "" + +#: ../../c-api/descriptor.rst:118 +msgid "" +"Class method descriptors expose C methods that receive the class rather than " +"an instance when accessed. This is the same kind of descriptor created for " +"``METH_CLASS`` entries in :c:member:`~PyTypeObject.tp_methods`, and it " +"appears in Python as a :class:`types.ClassMethodDescriptorType` object." +msgstr "" + +#: ../../c-api/descriptor.rst:128 +msgid "" +"Return non-zero if the descriptor object *descr* describes a data attribute, " +"or ``0`` if it describes a method. *descr* must be a descriptor object; " +"there is no error checking." +msgstr "" +"Retorna não-zero se o objeto descritor *descr* descrevem um atributo de " "dados, ou ``0`` se os mesmos descrevem um método. *descr* deve ser um objeto " "descritor; não há verificação de erros." + +#: ../../c-api/descriptor.rst:135 +msgid "" +"Create a new bound wrapper object from the wrapper descriptor *d* and the " +"instance *self*." +msgstr "" + +#: ../../c-api/descriptor.rst:138 +msgid "" +"This is the bound form of a wrapper descriptor created " +"by :c:func:`PyDescr_NewWrapper`. CPython creates these objects when a slot " +"wrapper is accessed through an instance, and they appear in Python " +"as :class:`types.MethodWrapperType` objects." +msgstr "" + +#: ../../c-api/descriptor.rst:143 +msgid "" +"On success, return a :term:`strong reference` to the wrapper object. Return " +"``NULL`` with an exception set on failure." +msgstr "" + +#: ../../c-api/descriptor.rst:147 +msgid "Built-in descriptors" +msgstr "Descritores embutidos" + +#: ../../c-api/descriptor.rst:151 +msgid "" +"The type object for super objects. This is the same object as :class:`super` " +"in the Python layer." +msgstr "" +"O objeto de tipo para superobjetos. Este é o mesmo objeto que :class:`super` " +"na camada Python." + +#: ../../c-api/descriptor.rst:157 +msgid "" +"The type of class method objects. This is the same object " +"as :class:`classmethod` in the Python layer." +msgstr "" +"O tipo de objeto de método de classe. Este é o mesmo objeto " +"que :class:`classmethod` na camada Python." + +#: ../../c-api/descriptor.rst:163 +msgid "" +"The type object for C-level class method descriptor objects. This is the " +"type of the descriptors created for :func:`classmethod` defined in C " +"extension types, and corresponds to :class:`types.ClassMethodDescriptorType` " +"objects in Python." +msgstr "" + +#: ../../c-api/descriptor.rst:171 +msgid "" +"Create a new :class:`classmethod` object wrapping *callable*. *callable* " +"must be a callable object and must not be ``NULL``." +msgstr "" +"Cria um novo objeto :class:`classmethod` que envolve *callable*. *callable* " +"deve ser um objeto chamável e não deve ser ``NULL``." + +#: ../../c-api/descriptor.rst:174 +msgid "" +"On success, this function returns a :term:`strong reference` to a new class " +"method descriptor. On failure, this function returns ``NULL`` with an " +"exception set." +msgstr "" +"Em caso de sucesso, esta função retorna uma :term:`referência forte` a um " +"novo descritor de método de classe. Em caso de falha, esta função retorna " +"``NULL`` com uma exceção definida." + +#: ../../c-api/descriptor.rst:181 +msgid "" +"The type of static method objects. This is the same object " +"as :class:`staticmethod` in the Python layer." +msgstr "" +"O tipo de objeto de método estático. Este é o mesmo objeto " +"que :class:`staticmethod` na camada Python." + +#: ../../c-api/descriptor.rst:187 +msgid "" +"Create a new :class:`staticmethod` object wrapping *callable*. *callable* " +"must be a callable object and must not be ``NULL``." +msgstr "" +"Cria um novo objeto :class:`staticmethod` que envolve *callable*. *callable* " +"deve ser um objeto chamável e não deve ser ``NULL``." + +#: ../../c-api/descriptor.rst:190 +msgid "" +"On success, this function returns a :term:`strong reference` to a new static " +"method descriptor. On failure, this function returns ``NULL`` with an " +"exception set." +msgstr "" +"Em caso de sucesso, esta função retorna uma :term:`referência forte` a um " +"novo descritor de método estático. Em caso de falha, esta função retorna " +"``NULL`` com uma exceção definida." diff --git a/c-api/dict.po b/c-api/dict.po index c275b56f9..c56751c50 100644 --- a/c-api/dict.po +++ b/c-api/dict.po @@ -1,28 +1,27 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Aline Balogh , 2021 -# felipe caridade fernandes , 2023 -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 +# Rafael Fontenelle , 2025 +# zanarelli, 2026 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-06-28 14:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-15 19:50+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: zanarelli, 2026\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -76,78 +75,96 @@ msgstr "" "dinâmicas." #: ../../c-api/dict.rst:48 +msgid "" +"The type object for mapping proxy objects created " +"by :c:func:`PyDictProxy_New` and for the read-only ``__dict__`` attribute of " +"many built-in types. A :c:type:`PyDictProxy_Type` instance provides a " +"dynamic, read-only view of an underlying dictionary: changes to the " +"underlying dictionary are reflected in the proxy, but the proxy itself does " +"not support mutation operations. This corresponds " +"to :class:`types.MappingProxyType` in Python." +msgstr "" +"O objeto de tipo para mapear objetos proxy criados " +"por :c:func:`PyDictProxy_New` e para o atributo somente leitura ``__dict__`` " +"de muitos tipos embutidos. Uma instância de :c:type:`PyDictProxy_Type` " +"fornece uma visão dinâmica e somente leitura de um dicionário subjacente: as " +"alterações no dicionário subjacente são refletidas no proxy, mas o próprio " +"proxy não oferece suporte a operações de mutação. Isso corresponde " +"a :class:`types.MappingProxyType` no Python." + +#: ../../c-api/dict.rst:59 msgid "Empty an existing dictionary of all key-value pairs." msgstr "Esvazia um dicionário existente de todos os pares chave-valor." -#: ../../c-api/dict.rst:53 +#: ../../c-api/dict.rst:64 msgid "" -"Determine if dictionary *p* contains *key*. If an item in *p* is matches " +"Determine if dictionary *p* contains *key*. If an item in *p* matches " "*key*, return ``1``, otherwise return ``0``. On error, return ``-1``. This " "is equivalent to the Python expression ``key in p``." msgstr "" "Determina se o dicionário *p* contém *key*. Se um item em *p* corresponder à " "*key*, retorna ``1``, caso contrário, retorna ``0``. Em caso de erro, " -"retorna ``-1``. Isso é equivalente à expressão Python ``key in p``." +"retorna ``-1``. Isso equivale à expressão Python ``key in p``." -#: ../../c-api/dict.rst:60 +#: ../../c-api/dict.rst:71 msgid "" -"This is the same as :c:func:`PyDict_Contains`, but *key* is specified as a :" -"c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" -"`PyObject*`." +"This is the same as :c:func:`PyDict_Contains`, but *key* is specified as " +"a :c:expr:`const char*` UTF-8 encoded bytes string, rather than " +"a :c:expr:`PyObject*`." msgstr "" "É o mesmo que :c:func:`PyDict_Contains`, mas *key* é especificada como uma " -"string de bytes :c:expr:`const char*` codificada em UTF-8, em vez de um :c:" -"expr:`PyObject*`." +"string de bytes :c:expr:`const char*` codificada em UTF-8, em vez de " +"um :c:expr:`PyObject*`." -#: ../../c-api/dict.rst:69 +#: ../../c-api/dict.rst:80 msgid "Return a new dictionary that contains the same key-value pairs as *p*." msgstr "Retorna um novo dicionário que contém o mesmo chave-valor como *p*." -#: ../../c-api/dict.rst:74 +#: ../../c-api/dict.rst:85 msgid "" -"Insert *val* into the dictionary *p* with a key of *key*. *key* must be :" -"term:`hashable`; if it isn't, :exc:`TypeError` will be raised. Return ``0`` " -"on success or ``-1`` on failure. This function *does not* steal a reference " -"to *val*." +"Insert *val* into the dictionary *p* with a key of *key*. *key* must " +"be :term:`hashable`; if it isn't, :exc:`TypeError` will be raised. Return " +"``0`` on success or ``-1`` on failure. This function *does not* " +"\":term:`steal`\" a reference to *val*." msgstr "" -"Insere *val* no dicionário *p* com a tecla *key*. *key* deve ser :term:" -"`hasheável `; se não for, :exc:`TypeError` será levantada. Retorna " -"``0`` em caso de sucesso ou ``-1`` em caso de falha. Esta função *não* rouba " -"uma referência a *val*." +"Insere *val* no dicionário *p* com a chave *key*. *key* deve " +"ser :term:`hasheável `; se não for, :exc:`TypeError` será " +"levantada. Retorna ``0`` em caso de sucesso ou ``-1`` em caso de falha. Esta " +"função *não* \":term:`rouba `\" uma referência para *val*." -#: ../../c-api/dict.rst:82 +#: ../../c-api/dict.rst:93 msgid "" -"This is the same as :c:func:`PyDict_SetItem`, but *key* is specified as a :c:" -"expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" -"`PyObject*`." +"This is the same as :c:func:`PyDict_SetItem`, but *key* is specified as " +"a :c:expr:`const char*` UTF-8 encoded bytes string, rather than " +"a :c:expr:`PyObject*`." msgstr "" "É o mesmo que :c:func:`PyDict_SetItem`, mas *key* é especificada como uma " -"string de bytes :c:expr:`const char*` codificada em UTF-8, em vez de um :c:" -"expr:`PyObject*`." +"string de bytes :c:expr:`const char*` codificada em UTF-8, em vez de " +"um :c:expr:`PyObject*`." -#: ../../c-api/dict.rst:89 +#: ../../c-api/dict.rst:100 msgid "" -"Remove the entry in dictionary *p* with key *key*. *key* must be :term:" -"`hashable`; if it isn't, :exc:`TypeError` is raised. If *key* is not in the " -"dictionary, :exc:`KeyError` is raised. Return ``0`` on success or ``-1`` on " -"failure." +"Remove the entry in dictionary *p* with key *key*. *key* must " +"be :term:`hashable`; if it isn't, :exc:`TypeError` is raised. If *key* is " +"not in the dictionary, :exc:`KeyError` is raised. Return ``0`` on success or " +"``-1`` on failure." msgstr "" -"Remove a entrada no dicionário *p* com a chave *key*. *key* deve ser :term:" -"`hasheável`; se não for, :exc:`TypeError` é levantada. Se *key* não estiver " -"no dicionário, :exc:`KeyError` é levantada. Retorna ``0`` em caso de sucesso " -"ou ``-1`` em caso de falha." +"Remove a entrada no dicionário *p* com a chave *key*. *key* deve " +"ser :term:`hasheável`; se não for, :exc:`TypeError` é levantada. Se *key* " +"não estiver no dicionário, :exc:`KeyError` é levantada. Retorna ``0`` em " +"caso de sucesso ou ``-1`` em caso de falha." -#: ../../c-api/dict.rst:97 +#: ../../c-api/dict.rst:108 msgid "" -"This is the same as :c:func:`PyDict_DelItem`, but *key* is specified as a :c:" -"expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" -"`PyObject*`." +"This is the same as :c:func:`PyDict_DelItem`, but *key* is specified as " +"a :c:expr:`const char*` UTF-8 encoded bytes string, rather than " +"a :c:expr:`PyObject*`." msgstr "" "É o mesmo que :c:func:`PyDict_DelItem`, mas *key* é especificada como uma " -"string de bytes :c:expr:`const char*` codificada em UTF-8, em vez de um :c:" -"expr:`PyObject*`." +"string de bytes :c:expr:`const char*` codificada em UTF-8, em vez de " +"um :c:expr:`PyObject*`." -#: ../../c-api/dict.rst:104 +#: ../../c-api/dict.rst:115 msgid "" "Return a new :term:`strong reference` to the object from dictionary *p* " "which has a key *key*:" @@ -155,28 +172,31 @@ msgstr "" "Retorna uma nova :term:`referência forte` para o objeto dicionário *p* que " "possui uma chave *key*:" -#: ../../c-api/dict.rst:107 +#: ../../c-api/dict.rst:118 msgid "" "If the key is present, set *\\*result* to a new :term:`strong reference` to " "the value and return ``1``." msgstr "" -"Se a chave estiver presente, define *\\*result* como uma nova :term:" -"`referência forte` para o valor e retorna ``1``." +"Se a chave estiver presente, define *\\*result* como uma " +"nova :term:`referência forte` para o valor e retorna ``1``." -#: ../../c-api/dict.rst:109 +#: ../../c-api/dict.rst:120 msgid "If the key is missing, set *\\*result* to ``NULL`` and return ``0``." msgstr "" "Se a chave estiver ausente, define *\\*result* como ``NULL`` e retorna ``0``." -#: ../../c-api/dict.rst:110 ../../c-api/dict.rst:207 -msgid "On error, raise an exception and return ``-1``." -msgstr "Em caso de erro, levanta uma exceção e retorna ``-1``." +#: ../../c-api/dict.rst:121 +msgid "" +"On error, raise an exception, set *\\*result* to ``NULL`` and return ``-1``." +msgstr "" +"Em caso de erro, levanta uma exceção, define *\\*result* como ``NULL`` e " +"retorna ``-1``." -#: ../../c-api/dict.rst:114 +#: ../../c-api/dict.rst:125 msgid "See also the :c:func:`PyObject_GetItem` function." msgstr "Veja também a função :c:func:`PyObject_GetItem`." -#: ../../c-api/dict.rst:119 +#: ../../c-api/dict.rst:130 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* " @@ -186,17 +206,17 @@ msgstr "" "possui uma chave *key*. Retorna ``NULL`` se a chave *key* não estiver " "presente, mas *sem* definir uma exceção." -#: ../../c-api/dict.rst:125 +#: ../../c-api/dict.rst:136 msgid "" -"Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:" -"`~object.__eq__` methods are silently ignored. Prefer the :c:func:" -"`PyDict_GetItemWithError` function instead." +"Exceptions that occur while this calls :meth:`~object.__hash__` " +"and :meth:`~object.__eq__` methods are silently ignored. Prefer " +"the :c:func:`PyDict_GetItemWithError` function instead." msgstr "" -"Exceções que ocorrem ao chamar os métodos :meth:`~object.__hash__` e :meth:" -"`~object.__eq__` são ignoradas silenciosamente. Ao invés disso, use a " -"função :c:func:`PyDict_GetItemWithError`." +"Exceções que ocorrem ao chamar os métodos :meth:`~object.__hash__` " +"e :meth:`~object.__eq__` são ignoradas silenciosamente. Ao invés disso, use " +"a função :c:func:`PyDict_GetItemWithError`." -#: ../../c-api/dict.rst:129 +#: ../../c-api/dict.rst:140 msgid "" "Calling this API without :term:`GIL` held had been allowed for historical " "reason. It is no longer allowed." @@ -204,7 +224,7 @@ msgstr "" "Chamar esta API sem :term:`GIL` retida era permitido por motivos históricos. " "Não é mais permitido." -#: ../../c-api/dict.rst:136 +#: ../../c-api/dict.rst:147 msgid "" "Variant of :c:func:`PyDict_GetItem` that does not suppress exceptions. " "Return ``NULL`` **with** an exception set if an exception occurred. Return " @@ -214,40 +234,41 @@ msgstr "" "``NULL`` **com** uma exceção definida se uma exceção ocorreu. Retorna " "``NULL`` ** sem ** uma exceção definida se a chave não estiver presente." -#: ../../c-api/dict.rst:144 +#: ../../c-api/dict.rst:155 msgid "" -"This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a :c:" -"expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" -"`PyObject*`." +"This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as " +"a :c:expr:`const char*` UTF-8 encoded bytes string, rather than " +"a :c:expr:`PyObject*`." msgstr "" "É o mesmo que :c:func:`PyDict_GetItem`, mas *key* é especificada como uma " -"string de bytes :c:expr:`const char*` codificada em UTF-8, em vez de um :c:" -"expr:`PyObject*`." +"string de bytes :c:expr:`const char*` codificada em UTF-8, em vez de " +"um :c:expr:`PyObject*`." -#: ../../c-api/dict.rst:150 +#: ../../c-api/dict.rst:161 msgid "" -"Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:" -"`~object.__eq__` methods or while creating the temporary :class:`str` object " -"are silently ignored. Prefer using the :c:func:`PyDict_GetItemWithError` " -"function with your own :c:func:`PyUnicode_FromString` *key* instead." +"Exceptions that occur while this calls :meth:`~object.__hash__` " +"and :meth:`~object.__eq__` methods or while creating the " +"temporary :class:`str` object are silently ignored. Prefer using " +"the :c:func:`PyDict_GetItemWithError` function with your " +"own :c:func:`PyUnicode_FromString` *key* instead." msgstr "" -"Exceções que ocorrem ao chamar os métodos :meth:`~object.__hash__` e :meth:" -"`~object.__eq__` ou ao criar objetos temporários da classe :class:`str` são " -"ignoradas silenciosamente. Ao invés disso, prefira usar a função :c:func:" -"`PyDict_GetItemWithError` com sua própria *key* de :c:func:" -"`PyUnicode_FromString`." +"Exceções que ocorrem ao chamar os métodos :meth:`~object.__hash__` " +"e :meth:`~object.__eq__` ou ao criar objetos temporários da " +"classe :class:`str` são ignoradas silenciosamente. Ao invés disso, prefira " +"usar a função :c:func:`PyDict_GetItemWithError` com sua própria *key* " +"de :c:func:`PyUnicode_FromString`." -#: ../../c-api/dict.rst:159 +#: ../../c-api/dict.rst:170 msgid "" -"Similar than :c:func:`PyDict_GetItemRef`, but *key* is specified as a :c:" -"expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" -"`PyObject*`." +"Similar to :c:func:`PyDict_GetItemRef`, but *key* is specified as " +"a :c:expr:`const char*` UTF-8 encoded bytes string, rather than " +"a :c:expr:`PyObject*`." msgstr "" "Similar a :c:func:`PyDict_GetItemRef`, mas *key* é especificada como uma " -"string de bytes :c:expr:`const char*` codificada em UTF-8, em vez de um :c:" -"expr:`PyObject*`." +"string de bytes :c:expr:`const char*` codificada em UTF-8, em vez de " +"um :c:expr:`PyObject*`." -#: ../../c-api/dict.rst:168 +#: ../../c-api/dict.rst:179 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 " @@ -262,7 +283,7 @@ msgstr "" "será retornado. Esta função avalia a função hash de *key* apenas uma vez, em " "vez de avaliá-la independentemente para a pesquisa e a inserção." -#: ../../c-api/dict.rst:179 +#: ../../c-api/dict.rst:190 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``, " @@ -282,7 +303,7 @@ msgstr "" "presente e *default_value* foi inserido. Em caso de falha, retorna ``-1``, " "define uma exceção e define ``*result`` como ``NULL``." -#: ../../c-api/dict.rst:189 +#: ../../c-api/dict.rst:200 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 " @@ -295,15 +316,15 @@ msgstr "" "Estes podem referir-se ao mesmo objeto: nesse caso você mantém duas " "referências separadas para ele." -#: ../../c-api/dict.rst:200 +#: ../../c-api/dict.rst:211 msgid "" "Remove *key* from dictionary *p* and optionally return the removed value. Do " -"not raise :exc:`KeyError` if the key missing." +"not raise :exc:`KeyError` if the key is missing." msgstr "" "Remove *key* do dicionário *p* e, opcionalmente, retorna o valor removido. " "Não levanta :exc:`KeyError` se a chave estiver ausente." -#: ../../c-api/dict.rst:203 +#: ../../c-api/dict.rst:214 msgid "" "If the key is present, set *\\*result* to a new reference to the removed " "value if *result* is not ``NULL``, and return ``1``." @@ -311,7 +332,7 @@ msgstr "" "Se a chave estiver presente, define *\\*result* como uma nova referência " "para o valor se *result* não for ``NULL`` e retorna ``1``." -#: ../../c-api/dict.rst:205 +#: ../../c-api/dict.rst:216 msgid "" "If the key is missing, set *\\*result* to ``NULL`` if *result* is not " "``NULL``, and return ``0``." @@ -319,36 +340,40 @@ msgstr "" "Se a chave estiver ausente, define *\\*result* como ``NULL`` se *result* não " "for ``NULL`` e retorna ``0``." -#: ../../c-api/dict.rst:209 +#: ../../c-api/dict.rst:218 +msgid "On error, raise an exception and return ``-1``." +msgstr "Em caso de erro, levanta uma exceção e retorna ``-1``." + +#: ../../c-api/dict.rst:220 msgid "" -"This is similar to :meth:`dict.pop`, but without the default value and not " -"raising :exc:`KeyError` if the key missing." +"Similar to :meth:`dict.pop`, but without the default value and not " +"raising :exc:`KeyError` if the key is missing." msgstr "" -"Isto é semelhante a :meth:`dict.pop`, mas sem o valor padrão e sem levantar :" -"exc:`KeyError` se a chave estiver ausente." +"Similar a :meth:`dict.pop`, mas sem o valor padrão e sem " +"levantar :exc:`KeyError` se a chave estiver ausente." -#: ../../c-api/dict.rst:217 +#: ../../c-api/dict.rst:228 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 "" "Similar a :c:func:`PyDict_Pop`, mas *key* é especificada como uma string de " -"bytes :c:expr:`const char*` codificada em UTF-8, em vez de um :c:expr:" -"`PyObject*`." +"bytes :c:expr:`const char*` codificada em UTF-8, em vez de " +"um :c:expr:`PyObject*`." -#: ../../c-api/dict.rst:226 +#: ../../c-api/dict.rst:237 msgid "" "Return a :c:type:`PyListObject` containing all the items from the dictionary." msgstr "" "Retorna um :c:type:`PyListObject` contendo todos os itens do dicionário." -#: ../../c-api/dict.rst:231 +#: ../../c-api/dict.rst:242 msgid "" "Return a :c:type:`PyListObject` containing all the keys from the dictionary." msgstr "" "Retorna um :c:type:`PyListObject` contendo todas as chaves do dicionário." -#: ../../c-api/dict.rst:236 +#: ../../c-api/dict.rst:247 msgid "" "Return a :c:type:`PyListObject` containing all the values from the " "dictionary *p*." @@ -356,7 +381,7 @@ msgstr "" "Retorna um :c:type:`PyListObject` contendo todos os valores do dicionário " "*p*." -#: ../../c-api/dict.rst:244 +#: ../../c-api/dict.rst:255 msgid "" "Return the number of items in the dictionary. This is equivalent to " "``len(p)`` on a dictionary." @@ -364,35 +389,57 @@ msgstr "" "Retorna o número de itens no dicionário. Isso é equivalente a ``len(p)`` em " "um dicionário." -#: ../../c-api/dict.rst:250 -msgid "" -"Iterate over all key-value pairs in the dictionary *p*. The :c:type:" -"`Py_ssize_t` referred to by *ppos* must be initialized to ``0`` prior to the " -"first call to this function to start the iteration; the function returns " -"true for each pair in the dictionary, and false once all pairs have been " -"reported. The parameters *pkey* and *pvalue* should either point to :c:expr:" -"`PyObject*` variables that will be filled in with each key and value, " -"respectively, or may be ``NULL``. Any references returned through them are " -"borrowed. *ppos* should not be altered during iteration. Its value " -"represents offsets within the internal dictionary structure, and since the " -"structure is sparse, the offsets are not consecutive." -msgstr "" -"Itera todos os pares de valores-chave no dicionário *p*. O :c:type:" -"`Py_ssize_t` referido por *ppos* deve ser inicializado para ``0`` antes da " -"primeira chamada para esta função para iniciar a iteração; a função retorna " -"true para cada par no dicionário e false quando todos os pares forem " -"relatados. Os parâmetros *pkey* e *pvalue* devem apontar para variáveis de :" -"c:expr:`PyObject*` que serão preenchidas com cada chave e valor, " +#: ../../c-api/dict.rst:261 +msgid "Similar to :c:func:`PyDict_Size`, but without error checking." +msgstr "Similar a :c:func:`PyDict_Size`, mas sem verificação de erro." + +#: ../../c-api/dict.rst:266 +msgid "" +"Iterate over all key-value pairs in the dictionary *p*. " +"The :c:type:`Py_ssize_t` referred to by *ppos* must be initialized to ``0`` " +"prior to the first call to this function to start the iteration; the " +"function returns true for each pair in the dictionary, and false once all " +"pairs have been reported. The parameters *pkey* and *pvalue* should either " +"point to :c:expr:`PyObject*` variables that will be filled in with each key " +"and value, respectively, or may be ``NULL``. Any references returned " +"through them are borrowed. *ppos* should not be altered during iteration. " +"Its value represents offsets within the internal dictionary structure, and " +"since the structure is sparse, the offsets are not consecutive." +msgstr "" +"Itera todos os pares de valores-chave no dicionário *p*. " +"O :c:type:`Py_ssize_t` referido por *ppos* deve ser inicializado para ``0`` " +"antes da primeira chamada para esta função para iniciar a iteração; a função " +"retorna true para cada par no dicionário e false quando todos os pares forem " +"relatados. Os parâmetros *pkey* e *pvalue* devem apontar para variáveis " +"de :c:expr:`PyObject*` que serão preenchidas com cada chave e valor, " "respectivamente, ou podem ser ``NULL``. Todas as referências retornadas por " "meio deles são emprestadas. *ppos* não deve ser alterado durante a iteração. " "Seu valor representa deslocamentos dentro da estrutura do dicionário interno " "e, como a estrutura é esparsa, os deslocamentos não são consecutivos." -#: ../../c-api/dict.rst:261 +#: ../../c-api/dict.rst:277 msgid "For example::" msgstr "Por exemplo::" -#: ../../c-api/dict.rst:271 +#: ../../c-api/dict.rst:279 +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 "" +"PyObject *key, *value;\n" +"Py_ssize_t pos = 0;\n" +"\n" +"while (PyDict_Next(self->dict, &pos, &key, &value)) {\n" +" /* fazer algo de interessante com os valores... */\n" +" ...\n" +"}" + +#: ../../c-api/dict.rst:287 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 " @@ -402,18 +449,71 @@ msgstr "" "modificar os valores das chaves à medida que você itera no dicionário, mas " "apenas enquanto o conjunto de chaves não mudar. Por exemplo::" -#: ../../c-api/dict.rst:293 +#: ../../c-api/dict.rst:291 +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 "" +"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" +"}" + +#: ../../c-api/dict.rst:309 msgid "" "The function is not thread-safe in the :term:`free-threaded ` build without external synchronization. You can use :c:macro:" -"`Py_BEGIN_CRITICAL_SECTION` to lock the dictionary while iterating over it::" +"threading>` build without external synchronization. You can " +"use :c:macro:`Py_BEGIN_CRITICAL_SECTION` to lock the dictionary while " +"iterating over it::" msgstr "" "A função não é segura para thread na construção com :term:`threads livres " -"` sem sincronização externa. Você pode usar :c:macro:" -"`Py_BEGIN_CRITICAL_SECTION` para travar o dicionário enquanto itera sobre " -"ele::" +"` sem sincronização externa. Você pode " +"usar :c:macro:`Py_BEGIN_CRITICAL_SECTION` para travar o dicionário enquanto " +"itera sobre ele::" -#: ../../c-api/dict.rst:307 +#: ../../c-api/dict.rst:314 +msgid "" +"Py_BEGIN_CRITICAL_SECTION(self->dict);\n" +"while (PyDict_Next(self->dict, &pos, &key, &value)) {\n" +" ...\n" +"}\n" +"Py_END_CRITICAL_SECTION();" +msgstr "" +"Py_BEGIN_CRITICAL_SECTION(self->dict);\n" +"while (PyDict_Next(self->dict, &pos, &key, &value)) {\n" +" ...\n" +"}\n" +"Py_END_CRITICAL_SECTION();" + +#: ../../c-api/dict.rst:323 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` " @@ -423,28 +523,28 @@ msgid "" "or ``-1`` if an exception was raised." msgstr "" "Itera sobre o objeto de mapeamento *b* adicionando pares de valores-chave ao " -"dicionário *a*. *b* pode ser um dicionário, ou qualquer objeto que suporte :" -"c:func:`PyMapping_Keys` e :c:func:`PyObject_GetItem`. Se *override* for " -"verdadeiro, os pares existentes em *a* serão substituídos se uma chave " +"dicionário *a*. *b* pode ser um dicionário, ou qualquer objeto que " +"suporte :c:func:`PyMapping_Keys` e :c:func:`PyObject_GetItem`. Se *override* " +"for verdadeiro, os pares existentes em *a* serão substituídos se uma chave " "correspondente for encontrada em *b*, caso contrário, os pares serão " "adicionados apenas se não houver uma chave correspondente em *a*. Retorna " "``0`` em caso de sucesso ou ``-1`` se uma exceção foi levantada." -#: ../../c-api/dict.rst:317 +#: ../../c-api/dict.rst:333 msgid "" -"This is the same as ``PyDict_Merge(a, b, 1)`` in C, and is similar to ``a." -"update(b)`` in Python except that :c:func:`PyDict_Update` doesn't fall back " -"to the iterating over a sequence of key value pairs if the second argument " -"has no \"keys\" attribute. Return ``0`` on success or ``-1`` if an " +"This is the same as ``PyDict_Merge(a, b, 1)`` in C, and is similar to " +"``a.update(b)`` in Python except that :c:func:`PyDict_Update` doesn't fall " +"back to the iterating over a sequence of key value pairs if the second " +"argument has no \"keys\" attribute. Return ``0`` on success or ``-1`` if an " "exception was raised." msgstr "" -"É o mesmo que ``PyDict_Merge(a, b, 1)`` em C, e é semelhante a ``a." -"update(b)`` em Python, exceto que :c:func:`PyDict_Update` não cai na " +"É o mesmo que ``PyDict_Merge(a, b, 1)`` em C, e é semelhante a " +"``a.update(b)`` em Python, exceto que :c:func:`PyDict_Update` não cai na " "iteração em uma sequência de pares de valores de chave se o segundo " "argumento não tiver o atributo \"keys\". Retorna ``0`` em caso de sucesso ou " "``-1`` se uma exceção foi levantada." -#: ../../c-api/dict.rst:326 +#: ../../c-api/dict.rst:342 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, " @@ -459,7 +559,19 @@ msgstr "" "vence. Retorne ``0`` em caso de sucesso ou ``-1`` se uma exceção foi " "levantada. Python equivalente (exceto para o valor de retorno)::" -#: ../../c-api/dict.rst:340 +#: ../../c-api/dict.rst:349 +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 "" +"def PyDict_MergeFromSeq2(a, seq2, override):\n" +" for key, value in seq2:\n" +" if override or key not in a:\n" +" a[key] = value" + +#: ../../c-api/dict.rst:356 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 " @@ -467,24 +579,24 @@ msgid "" "exception." msgstr "" "Registra *callback* como um observador de dicionário. Retorna um ID inteiro " -"não negativo que deve ser passado para futuras chamadas a :c:func:" -"`PyDict_Watch`. Em caso de erro (por exemplo, não há mais IDs de observador " -"disponíveis), retorna ``-1`` e define uma exceção." +"não negativo que deve ser passado para futuras chamadas " +"a :c:func:`PyDict_Watch`. Em caso de erro (por exemplo, não há mais IDs de " +"observador disponíveis), retorna ``-1`` e define uma exceção." -#: ../../c-api/dict.rst:349 +#: ../../c-api/dict.rst:365 msgid "" -"Clear watcher identified by *watcher_id* previously returned from :c:func:" -"`PyDict_AddWatcher`. Return ``0`` on success, ``-1`` on error (e.g. if the " -"given *watcher_id* was never registered.)" +"Clear watcher identified by *watcher_id* previously returned " +"from :c:func:`PyDict_AddWatcher`. Return ``0`` on success, ``-1`` on error " +"(e.g. if the given *watcher_id* was never registered.)" msgstr "" -"Limpa o observador identificado por *watcher_id* retornado anteriormente de :" -"c:func:`PyDict_AddWatcher`. Retorna ``0`` em caso de sucesso, ``-1`` em caso " -"de erro (por exemplo, se o *watcher_id* fornecido nunca foi registrado)." +"Limpa o observador identificado por *watcher_id* retornado anteriormente " +"de :c:func:`PyDict_AddWatcher`. Retorna ``0`` em caso de sucesso, ``-1`` em " +"caso de erro (por exemplo, se o *watcher_id* fornecido nunca foi registrado)." -#: ../../c-api/dict.rst:357 +#: ../../c-api/dict.rst:373 msgid "" -"Mark dictionary *dict* as watched. The callback granted *watcher_id* by :c:" -"func:`PyDict_AddWatcher` will be called when *dict* is modified or " +"Mark dictionary *dict* as watched. The callback granted *watcher_id* " +"by :c:func:`PyDict_AddWatcher` will be called when *dict* is modified or " "deallocated. Return ``0`` on success or ``-1`` on error." msgstr "" "Marca o dicionário *dict* como observado. A função de retorno concedida a " @@ -492,7 +604,7 @@ msgstr "" "modificado ou desalocado. Retorna ``0`` em caso de sucesso ou ``-1`` em caso " "de erro." -#: ../../c-api/dict.rst:365 +#: ../../c-api/dict.rst:381 msgid "" "Mark dictionary *dict* as no longer watched. The callback granted " "*watcher_id* by :c:func:`PyDict_AddWatcher` will no longer be called when " @@ -505,7 +617,7 @@ msgstr "" "anteriormente por este observador. Retorna ``0`` em caso de sucesso ou " "``-1`` em caso de erro." -#: ../../c-api/dict.rst:374 +#: ../../c-api/dict.rst:390 msgid "" "Enumeration of possible dictionary watcher events: ``PyDict_EVENT_ADDED``, " "``PyDict_EVENT_MODIFIED``, ``PyDict_EVENT_DELETED``, " @@ -517,11 +629,11 @@ msgstr "" "``PyDict_EVENT_CLONED``, ``PyDict_EVENT_CLEARED`` ou " "``PyDict_EVENT_DEALLOCATED``." -#: ../../c-api/dict.rst:382 +#: ../../c-api/dict.rst:398 msgid "Type of a dict watcher callback function." msgstr "Tipo de uma função de retorno de chamada de observador de dicionário." -#: ../../c-api/dict.rst:384 +#: ../../c-api/dict.rst:400 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`` " @@ -535,7 +647,7 @@ msgstr "" "valor de *key*. Se *event* for ``PyDict_EVENT_DELETED``, *key* estará sendo " "excluída do dicionário e *new_value* será ``NULL``." -#: ../../c-api/dict.rst:390 +#: ../../c-api/dict.rst:406 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 " @@ -548,7 +660,7 @@ msgstr "" "disso, um único ``PyDict_EVENT_CLONED`` é emitido e *key* será o dicionário " "de origem." -#: ../../c-api/dict.rst:396 +#: ../../c-api/dict.rst:412 msgid "" "The callback may inspect but must not modify *dict*; doing so could have " "unpredictable effects, including infinite recursion. Do not trigger Python " @@ -559,7 +671,7 @@ msgstr "" "execução do código Python na função de retorno, pois isso poderia modificar " "o dict como um efeito colateral." -#: ../../c-api/dict.rst:400 +#: ../../c-api/dict.rst:416 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 " @@ -573,7 +685,7 @@ msgstr "" "ressuscitado for destruído mais tarde, quaisquer funções de retorno do " "observador ativos naquele momento serão chamados novamente." -#: ../../c-api/dict.rst:406 +#: ../../c-api/dict.rst:422 msgid "" "Callbacks occur before the notified modification to *dict* takes place, so " "the prior state of *dict* can be inspected." @@ -581,17 +693,18 @@ msgstr "" "As funções de retorno ocorrem antes que a modificação notificada no *dict* " "ocorra, de modo que o estado anterior do *dict* possa ser inspecionado." -#: ../../c-api/dict.rst:409 +#: ../../c-api/dict.rst:425 msgid "" "If the callback sets an exception, it must return ``-1``; this exception " -"will be printed as an unraisable exception using :c:func:" -"`PyErr_WriteUnraisable`. Otherwise it should return ``0``." +"will be printed as an unraisable exception " +"using :c:func:`PyErr_WriteUnraisable`. Otherwise it should return ``0``." msgstr "" -"Se a função de retorno definir uma exceção, ela deverá retornar ``-1``; essa " -"exceção será impressa como uma exceção não reprovável usando :c:func:" -"`PyErr_WriteUnraisable`. Caso contrário, deverá retornar ``0``." +"Se a função de retorno definir uma exceção, ela deverá retornar ``-1``. Essa " +"exceção será exibida como uma exceção não levantável " +"usando :c:func:`PyErr_WriteUnraisable`. Caso contrário, deverá retornar " +"``0``." -#: ../../c-api/dict.rst:413 +#: ../../c-api/dict.rst:429 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 " @@ -603,7 +716,196 @@ msgstr "" "de retorno. Nesse caso, a função de retorno deve retornar ``0`` com a mesma " "exceção ainda definida. Isso significa que a função de retorno não pode " "chamar nenhuma outra API que possa definir uma exceção, a menos que salve e " -"limpe o estado da exceção primeiro e o restaure antes de retornar." +"limpe o estado da exceção primeiro e restaure a exceção antes de retornar." + +#: ../../c-api/dict.rst:439 +msgid "Dictionary View Objects" +msgstr "Objetos visão de dicionário" + +#: ../../c-api/dict.rst:443 +msgid "" +"Return true if *op* is a view of a set inside a dictionary. This is " +"currently equivalent to :c:expr:`PyDictKeys_Check(op) || " +"PyDictItems_Check(op)`. This function always succeeds." +msgstr "" +"Retorna verdadeiro se *op* for uma visão de um conjunto dentro de um " +"dicionário. Isso atualmente equivale a :c:expr:`PyDictKeys_Check(op) || " +"PyDictItems_Check(op)`. Esta função sempre tem sucesso." + +#: ../../c-api/dict.rst:450 +msgid "" +"Type object for a view of dictionary keys. In Python, this is the type of " +"the object returned by :meth:`dict.keys`." +msgstr "" +"Objeto tipo para uma visualização das chaves do dicionário. Em Python, este " +"é o tipo do objeto retornado por :meth:`dict.keys`." + +#: ../../c-api/dict.rst:456 +msgid "" +"Return true if *op* is an instance of a dictionary keys view. This function " +"always succeeds." +msgstr "" +"Retorna verdadeiro se *op* for uma instância de uma visualização de chaves " +"de dicionário. Esta função sempre tem sucesso." + +#: ../../c-api/dict.rst:462 +msgid "" +"Type object for a view of dictionary values. In Python, this is the type of " +"the object returned by :meth:`dict.values`." +msgstr "" +"Objeto tipo para uma visualização dos valores do dicionário. Em Python, este " +"é o tipo do objeto retornado por :meth:`dict.values`." + +#: ../../c-api/dict.rst:468 +msgid "" +"Return true if *op* is an instance of a dictionary values view. This " +"function always succeeds." +msgstr "" +"Retorna verdadeiro se *op* for uma instância de uma visualização de valores " +"de dicionário. Esta função sempre tem sucesso." + +#: ../../c-api/dict.rst:474 +msgid "" +"Type object for a view of dictionary items. In Python, this is the type of " +"the object returned by :meth:`dict.items`." +msgstr "" +"Objeto tipo para uma visualização de itens de dicionário. Em Python, este é " +"o tipo do objeto retornado por :meth:`dict.items`." + +#: ../../c-api/dict.rst:480 +msgid "" +"Return true if *op* is an instance of a dictionary items view. This function " +"always succeeds." +msgstr "" +"Retorna verdadeiro se *op* for uma instância de uma visualização de itens de " +"dicionário. Esta função sempre tem sucesso." + +#: ../../c-api/dict.rst:485 +msgid "Ordered Dictionaries" +msgstr "Dicionários ordenados" + +#: ../../c-api/dict.rst:487 +msgid "" +"Python's C API provides interface for :class:`collections.OrderedDict` from " +"C. Since Python 3.7, dictionaries are ordered by default, so there is " +"usually little need for these functions; prefer ``PyDict*`` where possible." +msgstr "" +"A API C do Python fornece uma interface " +"para :class:`collections.OrderedDict` do C. Desde o Python 3.7, os " +"dicionários são ordenados por padrão, então geralmente há pouca necessidade " +"dessas funções; prefira ``PyDict*`` sempre que possível." + +#: ../../c-api/dict.rst:494 +msgid "" +"Type object for ordered dictionaries. This is the same object " +"as :class:`collections.OrderedDict` in the Python layer." +msgstr "" +"Objeto de tipo para dicionários ordenados. Este é o mesmo objeto " +"que :class:`collections.OrderedDict` na camada Python." + +#: ../../c-api/dict.rst:500 +msgid "" +"Return true if *od* is an ordered dictionary object or an instance of a " +"subtype of the :class:`~collections.OrderedDict` type. This function always " +"succeeds." +msgstr "" +"Retorna verdadeiro se *od* for um objeto de dicionário ordenado ou uma " +"instância de um subtipo do tipo :class:`~collections.OrderedDict`. Esta " +"função sempre tem sucesso.." + +#: ../../c-api/dict.rst:507 +msgid "" +"Return true if *od* is an ordered dictionary object, but not an instance of " +"a subtype of the :class:`~collections.OrderedDict` type. This function " +"always succeeds." +msgstr "" +"Retorna verdadeiro se *od* for um objeto de dicionário ordenado, mas não uma " +"instância de um subtipo do tipo :class:`~collections.OrderedDict`. Esta " +"função sempre tem sucesso." + +#: ../../c-api/dict.rst:514 +msgid "Analogous to :c:type:`PyDictKeys_Type` for ordered dictionaries." +msgstr "Análogo a :c:type:`PyDictKeys_Type` para dicionários ordenados." + +#: ../../c-api/dict.rst:519 +msgid "Analogous to :c:type:`PyDictValues_Type` for ordered dictionaries." +msgstr "Análogo a :c:type:`PyDictValues_Type` para dicionários ordenados." + +#: ../../c-api/dict.rst:524 +msgid "Analogous to :c:type:`PyDictItems_Type` for ordered dictionaries." +msgstr "Análogo a :c:type:`PyDictItems_Type` para dicionários ordenados." + +#: ../../c-api/dict.rst:529 +msgid "Return a new empty ordered dictionary, or ``NULL`` on failure." +msgstr "" +"Retorna um novo dicionário ordenado vazio ou ``NULL`` em caso de falha." + +#: ../../c-api/dict.rst:531 +msgid "This is analogous to :c:func:`PyDict_New`." +msgstr "Isso é análogo a :c:func:`PyDict_New`." + +#: ../../c-api/dict.rst:536 +msgid "" +"Insert *value* into the ordered dictionary *od* with a key of *key*. Return " +"``0`` on success or ``-1`` with an exception set on failure." +msgstr "" +"Insere o valor *value* no dicionário ordenado *od* com a chave de *key*. " +"Retorna ``0`` em caso de sucesso ou ``-1`` com uma exceção definida em caso " +"de falha." + +#: ../../c-api/dict.rst:539 +msgid "This is analogous to :c:func:`PyDict_SetItem`." +msgstr "Isso é análogo a :c:func:`PyDict_SetItem`." + +#: ../../c-api/dict.rst:544 +msgid "" +"Remove the entry in the ordered dictionary *od* with key *key*. Return ``0`` " +"on success or ``-1`` with an exception set on failure." +msgstr "" +"Remove a entrada do dicionário ordenado *od* com a chave *key*. Retorna " +"``0`` em caso de sucesso ou ``-1`` com uma exceção definida em caso de falha." + +#: ../../c-api/dict.rst:547 +msgid "This is analogous to :c:func:`PyDict_DelItem`." +msgstr "Isso é análogo a :c:func:`PyDict_DelItem`." + +#: ../../c-api/dict.rst:550 +msgid "These are :term:`soft deprecated` aliases to ``PyDict`` APIs:" +msgstr "" +"Estes são apelidos :term:`suavemente descontinuados ` a APIs de ``PyDict``:" + +#: ../../c-api/dict.rst:557 +msgid "``PyODict``" +msgstr "``PyODict``" + +#: ../../c-api/dict.rst:558 +msgid "``PyDict``" +msgstr "``PyDict``" + +#: ../../c-api/dict.rst:560 +msgid ":c:func:`PyDict_GetItem`" +msgstr ":c:func:`PyDict_GetItem`" + +#: ../../c-api/dict.rst:562 +msgid ":c:func:`PyDict_GetItemWithError`" +msgstr ":c:func:`PyDict_GetItemWithError`" + +#: ../../c-api/dict.rst:564 +msgid ":c:func:`PyDict_GetItemString`" +msgstr ":c:func:`PyDict_GetItemString`" + +#: ../../c-api/dict.rst:566 +msgid ":c:func:`PyDict_Contains`" +msgstr ":c:func:`PyDict_Contains`" + +#: ../../c-api/dict.rst:568 +msgid ":c:func:`PyDict_Size`" +msgstr ":c:func:`PyDict_Size`" + +#: ../../c-api/dict.rst:570 +msgid ":c:func:`PyDict_GET_SIZE`" +msgstr ":c:func:`PyDict_GET_SIZE`" #: ../../c-api/dict.rst:8 msgid "object" @@ -613,10 +915,10 @@ msgstr "objeto" msgid "dictionary" msgstr "dicionário" -#: ../../c-api/dict.rst:242 +#: ../../c-api/dict.rst:253 msgid "built-in function" msgstr "função embutida" -#: ../../c-api/dict.rst:242 +#: ../../c-api/dict.rst:253 msgid "len" msgstr "len" diff --git a/c-api/exceptions.po b/c-api/exceptions.po index dfa0d4a29..c90619e31 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -1,42 +1,35 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Alexsandro Matias de Almeida , 2021 -# Misael borges , 2021 -# Richard Nixon , 2021 -# Renan Lopes , 2021 -# a76d6fb6142d7607ab0526dcbddb02d7_7bf0da0 <3b5fb0f281c8dfb4c0170f2ee2a6cfcf_843623>, 2021 -# i17obot , 2022 -# Marco Rougeth , 2023 -# Flávio Neves, 2023 -# Claudio Rogerio Carvalho Filho , 2023 -# Leonardo Rodrigues da Costa, 2023 -# Guilherme Alves da Silva, 2023 -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 +# Joao Roccella , 2025 +# Gustavo Reis, 2025 +# willian ohara, 2026 +# Rafael Fontenelle , 2026 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-29 04:06+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-31 19:46+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2026\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../c-api/exceptions.rst:8 msgid "Exception Handling" -msgstr "Manipulando Exceções" +msgstr "Tratamento de exceções" #: ../../c-api/exceptions.rst:10 msgid "" @@ -52,13 +45,13 @@ msgid "" msgstr "" "As funções descritas nesse capítulo permitem você tratar e gerar exceções em " "Python. É importante entender alguns princípios básicos no tratamento de " -"exceção no Python. Funciona de forma parecida com a variável POSIX :c:data:" -"`errno`: existe um indicador global (por thread) do último erro ocorrido. A " -"maioria das funções da API C não limpa isso com êxito, mas indica a causa do " -"erro na falha. A maioria das funções da API retorna um indicador de erro, " -"geralmente, ``NULL`` se eles devem retornar um ponteiro, ou ``-1`` se " -"retornarem um inteiro (exceção: as funções ``PyArg_*`` retornam ``1`` para " -"sucesso e ``0`` para falha)." +"exceções no Python. Funciona de forma parecida com a variável " +"POSIX :c:data:`errno`: existe um indicador global (por thread) do último " +"erro ocorrido. A maioria das funções da API C não o zera ao obter sucesso, " +"mas o define para indicar a causa do erro ao falhar. A maioria das funções " +"da API retorna um indicador de erro, geralmente, ``NULL`` se eles devem " +"retornar um ponteiro, ou ``-1`` se retornarem um inteiro (exceção: as " +"funções ``PyArg_*`` retornam ``1`` para sucesso e ``0`` para falha)." #: ../../c-api/exceptions.rst:20 msgid "" @@ -68,8 +61,8 @@ msgid "" "forbidden, for example you can't have a non-``NULL`` traceback if the " "exception type is ``NULL``)." msgstr "" -"Concretamente, o indicador de erro consiste em três ponteiros de objeto: o " -"tipo da exceção, o valor da exceção e o objeto de traceback. Qualquer um " +"De forma concreta, o indicador de erro consiste em três ponteiros de objeto: " +"o tipo da exceção, o valor da exceção e o objeto de traceback. Qualquer um " "desses ponteiros pode ser ``NULL`` se não definido (embora algumas " "combinações sejam proibidas, por exemplo, você não pode ter um retorno não " "``NULL`` se o tipo de exceção for ``NULL``)." @@ -99,14 +92,14 @@ 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 "" -"O indicador de erro **not** é resultado de :func:`sys.exc_info()`. O " -"primeiro corresponde a uma exceção que ainda não foi capturada (e, portanto, " -"ainda está se propagando), enquanto o segundo retorna uma exceção após ser " +"O indicador de erro **não** é resultado de :func:`sys.exc_info`. O primeiro " +"corresponde a uma exceção que ainda não foi capturada (e, portanto, ainda " +"está se propagando), enquanto o segundo retorna uma exceção após ser " "capturada (e, portanto, parou de se propagar)." #: ../../c-api/exceptions.rst:44 @@ -128,6 +121,10 @@ msgid "" "printed and the Python process will exit with the error code specified by " "the ``SystemExit`` instance." msgstr "" +"Exibe um traceback padrão para ``sys.stderr`` e limpe o indicador de erro. " +"**A menos que** o erro seja um ``SystemExit``, nesse caso, nenhum traceback " +"será impresso e o processo Python será encerrado com o código de erro " +"especificado pela instância ``SystemExit``." #: ../../c-api/exceptions.rst:60 msgid "" @@ -141,14 +138,20 @@ msgstr "" 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." +"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 "" +"Se *set_sys_last_vars* for diferente de zero, a " +"variável :data:`sys.last_exc` será definida com a exceção exibida. Para " +"manter a retrocompatibilidade, as variáveis " +"descontinuadas :data:`sys.last_type`, :data:`sys.last_value` " +"e :data:`sys.last_traceback` também serão definidas com o tipo, valor e " +"traceback dessa exceção, respectivamente." #: ../../c-api/exceptions.rst:69 msgid "The setting of :data:`sys.last_exc` was added." -msgstr "" +msgstr "A configuração de :data:`sys.last_exc` foi adicionada." #: ../../c-api/exceptions.rst:75 msgid "Alias for ``PyErr_PrintEx(1)``." @@ -168,6 +171,10 @@ msgid "" "raise the exception. It is used, for example, when an exception occurs in " "an :meth:`~object.__del__` method." msgstr "" +"Esta função utilitária imprime uma mensagem de aviso para ``sys.stderr`` " +"quando uma exceção foi definida, mas é impossível para o interpretador " +"realmente gerar a exceção. É usada, por exemplo, quando ocorre uma exceção " +"em um método :meth:`~object.__del__`." #: ../../c-api/exceptions.rst:88 msgid "" @@ -176,6 +183,10 @@ msgid "" "*obj* will be printed in the warning message. If *obj* is ``NULL``, only the " "traceback is printed." msgstr "" +"A função é chamada com um único argumento *obj* que identifica o contexto em " +"que ocorreu a exceção não gerável. Se possível, o repr de *obj* será " +"impresso na mensagem de aviso. Se *obj* for ``NULL``, apenas o traceback " +"será impresso." #: ../../c-api/exceptions.rst:93 msgid "An exception must be set when calling this function." @@ -199,18 +210,47 @@ msgid "" "is roughly equivalent to ``PyErr_FormatUnraisable(\"Exception ignored in: " "%R\", obj)``. If *format* is ``NULL``, only the traceback is printed." msgstr "" +"Similar a :c:func:`PyErr_WriteUnraisable`, mas *format* e parâmetros " +"subsequentes ajudam a formatar a mensagem de aviso; eles têm o mesmo " +"significado e valores que em :c:func:`PyUnicode_FromFormat`. " +"``PyErr_WriteUnraisable(obj)`` é aproximadamente equivalente à " +"``PyErr_FormatUnraisable(\"Exception ignored in: %R\", obj)``. Se *format* é " +"``NULL``, somente o rastreamento é impresso." #: ../../c-api/exceptions.rst:116 msgid "" "Print the standard traceback display of ``exc`` to ``sys.stderr``, including " "chained exceptions and notes." msgstr "" +"Imprime a exibição padrão do traceback de ``exc`` em ``sys.stderr``, " +"incluindo as exceções encadeadas e notas." + +#: ../../c-api/exceptions.rst:124 +msgid "Legacy variant of :c:func:`PyErr_DisplayException`." +msgstr "" + +#: ../../c-api/exceptions.rst:126 +msgid "" +"Print the exception *value* with its traceback to :data:`sys.stderr`. If " +"*value* has no traceback set, *tb* is used as its traceback. The first " +"argument is ignored." +msgstr "" -#: ../../c-api/exceptions.rst:123 +#: ../../c-api/exceptions.rst:130 +msgid "" +"If :data:`sys.stderr` is ``None``, nothing is printed. If :data:`sys.stderr` " +"is not set, the exception is dumped to the C ``stderr`` stream instead." +msgstr "" + +#: ../../c-api/exceptions.rst:134 +msgid "Use :c:func:`PyErr_DisplayException` instead." +msgstr "" + +#: ../../c-api/exceptions.rst:138 msgid "Raising exceptions" -msgstr "Lançando exceções" +msgstr "Levantando exceções" -#: ../../c-api/exceptions.rst:125 +#: ../../c-api/exceptions.rst:140 msgid "" "These functions help you set the current thread's error indicator. For " "convenience, some of these functions will always return a ``NULL`` pointer " @@ -220,7 +260,7 @@ msgstr "" "conveniência, algumas dessas funções sempre retornam um ponteiro ``NULL`` ao " "usar instrução com ``return``." -#: ../../c-api/exceptions.rst:132 +#: ../../c-api/exceptions.rst:147 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, " @@ -228,8 +268,13 @@ msgid "" "reference` to it (e.g. with :c:func:`Py_INCREF`). The second argument is an " "error message; it is decoded from ``'utf-8'``." msgstr "" +"Esse é o modo mais comum de definir o indicador de erro. O primeiro " +"argumento especifica o tipo da exceção; é normalmente uma das exceções " +"padrão, como :c:data:`PyExc_RuntimeError`. Você não precisa criar um " +"novo :term:`strong reference` para ela (como em :c:func:`Py_INCREF`). O " +"segundo argumento é uma mensagem de erro; ela é codificada com ``'utf-8'``." -#: ../../c-api/exceptions.rst:141 +#: ../../c-api/exceptions.rst:156 msgid "" "This function is similar to :c:func:`PyErr_SetString` but lets you specify " "an arbitrary Python object for the \"value\" of the exception." @@ -237,15 +282,20 @@ msgstr "" "Essa função é semelhante à :c:func:`PyErr_SetString` mas permite especificar " "um objeto Python arbitrário para o valor da exceção." -#: ../../c-api/exceptions.rst:147 +#: ../../c-api/exceptions.rst:162 msgid "" "This function sets the error indicator and returns ``NULL``. *exception* " "should be a Python exception class. The *format* and subsequent parameters " -"help format the error message; they have the same meaning and values as in :" -"c:func:`PyUnicode_FromFormat`. *format* is an ASCII-encoded string." +"help format the error message; they have the same meaning and values as " +"in :c:func:`PyUnicode_FromFormat`. *format* is an ASCII-encoded string." msgstr "" +"Essa função define o indicador de erro e retorna ``NULL``. *exception* deve " +"ser uma classe Python de exceção. O *format* e parâmetros subsequentes " +"ajudam a formatar a mensagem de erro; eles têm o mesmo significado e valores " +"que em :c:func:`PyUnicode_FromFormat`. *format* é uma string codificada em " +"ASCII." -#: ../../c-api/exceptions.rst:156 +#: ../../c-api/exceptions.rst:171 msgid "" "Same as :c:func:`PyErr_Format`, but taking a :c:type:`va_list` argument " "rather than a variable number of arguments." @@ -253,18 +303,21 @@ msgstr "" "Igual a :c:func:`PyErr_Format`, mas usando o argumento :c:type:`va_list` em " "vez de um número variável de argumentos." -#: ../../c-api/exceptions.rst:164 +#: ../../c-api/exceptions.rst:179 msgid "This is a shorthand for ``PyErr_SetObject(type, Py_None)``." msgstr "Isso é uma abreviação para ``PyErr_SetObject(type, Py_None)``." -#: ../../c-api/exceptions.rst:169 +#: ../../c-api/exceptions.rst:184 msgid "" "This is a shorthand for ``PyErr_SetString(PyExc_TypeError, message)``, where " "*message* indicates that a built-in operation was invoked with an illegal " "argument. It is mostly for internal use." msgstr "" +"Essa é uma abreviação de ``PyErr_SetString(PyExc_TypeError, message)``, na " +"qual *message* indica que uma operação embutida foi invocada com um " +"argumento ilegal. Ela é principalmente para uso interno." -#: ../../c-api/exceptions.rst:176 +#: ../../c-api/exceptions.rst:191 msgid "" "This is a shorthand for ``PyErr_SetNone(PyExc_MemoryError)``; it returns " "``NULL`` so an object allocation function can write ``return " @@ -274,43 +327,65 @@ msgstr "" "``NULL``  para que uma função de alocação de objeto possa escrever ``return " "PyErr_NoMemory();``  quando ficar sem memória." -#: ../../c-api/exceptions.rst:185 +#: ../../c-api/exceptions.rst:200 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 " -"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-api/exceptions.rst:199 +"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 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 "" +"Esta é uma função conveniente para levantar uma exceção quando uma função da " +"biblioteca C retornou um erro e definir a variável C :c:data:`errno`. Ela " +"constrói um objeto tupla cujo primeiro item é o valor " +"inteiro :c:data:`errno` e cujo segundo item é a mensagem de erro " +"correspondente (obtida de :c:func:`!strerror`), e então chama " +"``PyErr_SetObject(type, object)``. No Unix, quando o valor :c:data:`errno` " +"é :c:macro:`!EINTR`, indicando uma chamada de sistema interrompida, isso " +"chama :c:func:`PyErr_CheckSignals`, e se isso definir o indicador de erro, " +"deixa-o definido como tal. A função retorna sempre ``NULL``, de forma que " +"uma função que envolve uma chamada de sistema pode retornar ``return " +"PyErr_SetFromErrno(type);`` quando a chamada de sistema retornar um erro." + +#: ../../c-api/exceptions.rst:214 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." msgstr "" +"Similar à :c:func:`PyErr_SetFromErrno`, com o comportamento adicional de " +"que, se *filenameObject* não é ``NULL``, ele é passado para o construtor de " +"*type* como um terceiro parâmetro. No caso da exceção :exc:`OSError`, isso é " +"usado para definir o atributo :attr:`!filename` da instância da exceção." -#: ../../c-api/exceptions.rst:208 +#: ../../c-api/exceptions.rst:223 msgid "" "Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but takes a " "second filename object, for raising errors when a function that takes two " "filenames fails." msgstr "" +"Similar à :c:func:`PyErr_SetFromErrnoWithFilenameObject`, mas recebe um " +"segundo objeto filename, para levantar erros quando uma função que recebe " +"dois nomes de arquivos falha." -#: ../../c-api/exceptions.rst:217 +#: ../../c-api/exceptions.rst:232 msgid "" "Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but the filename " "is given as a C string. *filename* is decoded from the :term:`filesystem " "encoding and error handler`." msgstr "" +"Similar à :c:func:`PyErr_SetFromErrnoWithFilenameObject`, mas o nome do " +"arquivo é fornecido como uma string C. *filename* é decodificado " +"do :term:`filesystem encoding and error handler`." -#: ../../c-api/exceptions.rst:224 +#: ../../c-api/exceptions.rst:239 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:`!" @@ -323,37 +398,58 @@ msgid "" "``PyErr_SetObject(PyExc_OSError, object)``. This function always returns " "``NULL``." msgstr "" +"Essa é uma função conveniente para levantar :exc:`OSError`. Se chamada com " +"*ierr* de ``0``, o código de erro retornado por uma chamada para :c:func:`!" +"GetLastError` é usado instantaneamente. Ela chama a função Win32 :c:func:`!" +"FormatMessage` para retornar a descrição Windows do código de erro dado por " +"*ierr* ou :c:func:`!GetLastError`, e então constrói um objeto :exc:`OSError` " +"com o atributo :attr:`~OSError.winerror` definido para o código de erro, o " +"atributo :attr:`~OSError.strerror` definido para a mensagem de erro " +"correspondente (lida de :c:func:`!FormatMessage`), e então chama " +"``PyErr_SetObject(PyExc_OSError, object)``. Essa função sempre retorna " +"``NULL``." -#: ../../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 ":ref:`Availability `: Windows." -msgstr ":ref:`Disponibilidade `: Windows." +#: ../../c-api/exceptions.rst:249 ../../c-api/exceptions.rst:257 +#: ../../c-api/exceptions.rst:268 ../../c-api/exceptions.rst:278 +#: ../../c-api/exceptions.rst:286 ../../c-api/exceptions.rst:296 +msgid "Availability" +msgstr "Disponibilidade" -#: ../../c-api/exceptions.rst:239 +#: ../../c-api/exceptions.rst:254 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErr`, with an additional parameter " "specifying the exception type to be raised." msgstr "" +"Semelhante a :c:func:`PyErr_SetFromWindowsErr`, com um parâmetro adicional " +"que especifica o tipo de exceção a ser levantada." -#: ../../c-api/exceptions.rst:247 +#: ../../c-api/exceptions.rst:262 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." +"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." msgstr "" +"Semelhante a :c:func:`PyErr_SetFromWindowsErr`, com o comportamento " +"adicional de que, se *filename* não for ``NULL``, ele é decodificado a " +"partir da codificação do sistema de arquivos (:func:`os.fsdecode`) e passado " +"para o construtor de :exc:`OSError` como um terceiro parâmetro a ser usado " +"para definir o atributo :attr:`!filename` da instância da exceção." -#: ../../c-api/exceptions.rst:258 +#: ../../c-api/exceptions.rst:273 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." msgstr "" +"Semelhante a :c:func:`PyErr_SetExcFromWindowsErr`, com o comportamento " +"adicional de que, se *filename* não for ``NULL``, ele é passado para o " +"construtor de :exc:`OSError` como um terceiro parâmetro a ser usado para " +"definir o atributo :attr:`!filename` da instância da exceção." -#: ../../c-api/exceptions.rst:268 +#: ../../c-api/exceptions.rst:283 msgid "" "Similar to :c:func:`PyErr_SetExcFromWindowsErrWithFilenameObject`, but " "accepts a second filename object." @@ -361,7 +457,7 @@ msgstr "" "Similar à :c:func:`PyErr_SetExcFromWindowsErrWithFilenameObject`, mas aceita " "um segundo caminho do objeto." -#: ../../c-api/exceptions.rst:278 +#: ../../c-api/exceptions.rst:293 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, with an additional " "parameter specifying the exception type to be raised." @@ -369,15 +465,19 @@ msgstr "" "Similar à :c:func:`PyErr_SetFromWindowsErrWithFilename`, com um parâmetro " "adicional especificando o tipo de exceção a ser gerado." -#: ../../c-api/exceptions.rst:286 +#: ../../c-api/exceptions.rst:301 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 " "be ``NULL``, will be set as the :exc:`ImportError`'s respective ``name`` and " "``path`` attributes." msgstr "" +"Essa é uma função conveniente para levantar :exc:`ImportError`. *msg* será " +"definido como a string da mensagem de exceção. *name* e *path*, ambos os " +"quais podem ser ``NULL``, serão definidos como, respectivamente, os " +"atributos ``name`` e ``path`` de :exc:`ImportError`." -#: ../../c-api/exceptions.rst:296 +#: ../../c-api/exceptions.rst:311 msgid "" "Much like :c:func:`PyErr_SetImportError` but this function allows for " "specifying a subclass of :exc:`ImportError` to raise." @@ -385,39 +485,88 @@ msgstr "" "Muito parecido com :c:func:`PyErr_SetImportError` mas a função permite " "especificar uma subclasse de :exc:`ImportError` para levantar uma exceção." -#: ../../c-api/exceptions.rst:304 +#: ../../c-api/exceptions.rst:319 msgid "" "Set file, line, and offset information for the current exception. If the " "current exception is not a :exc:`SyntaxError`, then it sets additional " "attributes, which make the exception printing subsystem think the exception " "is a :exc:`SyntaxError`." msgstr "" +"Define informações de arquivo, linha e deslocamento para a atual exceção. Se " +"a exceção não é :exc:`SyntaxError`, define atributos adicionais, os quais " +"fazem o subsistema de impressão de exceções pensar que trata-se de " +"um :exc:`SyntaxError`." -#: ../../c-api/exceptions.rst:314 +#: ../../c-api/exceptions.rst:329 +msgid "" +"Similar to :c:func:`PyErr_SyntaxLocationObject`, but also sets the " +"*end_lineno* and *end_col_offset* information for the current exception." +msgstr "" +"Similar a :c:func:`PyErr_SyntaxLocationObject`, mas também define as " +"informações *end_lineno* e *end_col_offset* para a exceção atual." + +#: ../../c-api/exceptions.rst:337 msgid "" "Like :c:func:`PyErr_SyntaxLocationObject`, but *filename* is a byte string " "decoded from the :term:`filesystem encoding and error handler`." msgstr "" +"Como :c:func:`PyErr_SyntaxLocationObject`, mas *filename* é uma bytestring " +"descodificada a partir do :term:`tratador de erros e codificação do sistema " +"de arquivos`." -#: ../../c-api/exceptions.rst:322 +#: ../../c-api/exceptions.rst:345 msgid "" "Like :c:func:`PyErr_SyntaxLocationEx`, but the *col_offset* parameter is " "omitted." msgstr "" +"Como :c:func:`PyErr_SyntaxLocationEx`, mas o parâmetro *col_offset* é " +"omitido." -#: ../../c-api/exceptions.rst:328 +#: ../../c-api/exceptions.rst:351 msgid "" "This is a shorthand for ``PyErr_SetString(PyExc_SystemError, message)``, " "where *message* indicates that an internal operation (e.g. a Python/C API " "function) was invoked with an illegal argument. It is mostly for internal " "use." msgstr "" +"Essa é uma abreviação de ``PyErr_SetString(PyExc_SystemError, message)``, " +"onde *message* indica que uma operação interna (por exemplo, uma função API " +"C/Python) foi invocada com um argumento ilegal. Ela é principalmente para " +"uso interno." -#: ../../c-api/exceptions.rst:335 +#: ../../c-api/exceptions.rst:359 +msgid "" +"Get the source line in *filename* at line *lineno*. *filename* should be a " +"Python :class:`str` object." +msgstr "" +"Obtém a linha de código-fonte em *filename* na linha *lineno*. *filename* " +"deve ser um objeto :class:`str` Python." + +#: ../../c-api/exceptions.rst:362 +msgid "" +"On success, this function returns a Python string object with the found " +"line. On failure, this function returns ``NULL`` without an exception set." +msgstr "" +"Em caso de sucesso, esta função retorna um objeto string do Python com a " +"linha encontrada. Em caso de falha, esta função retorna ``NULL`` sem definir " +"uma exceção." + +#: ../../c-api/exceptions.rst:368 +msgid "" +"Similar to :c:func:`PyErr_ProgramTextObject`, but *filename* is " +"a :c:expr:`const char *`, which is decoded with the :term:`filesystem " +"encoding and error handler`, instead of a Python object reference." +msgstr "" +"Semelhante a :c:func:`PyErr_ProgramTextObject`, mas *filename* é " +"um :c:expr:`const char *`, que é decodificado com :term:`tratador de erros e " +"codificação do sistema de arquivos`, em vez de uma referência de objeto " +"Python." + +#: ../../c-api/exceptions.rst:375 msgid "Issuing warnings" -msgstr "Emitindo advertências" +msgstr "Emitindo avisos" -#: ../../c-api/exceptions.rst:337 +#: ../../c-api/exceptions.rst:377 msgid "" "Use these functions to issue warnings from C code. They mirror similar " "functions exported by the Python :mod:`warnings` module. They normally " @@ -432,95 +581,144 @@ msgid "" "exception handling (for example, :c:func:`Py_DECREF` owned references and " "return an error value)." msgstr "" - -#: ../../c-api/exceptions.rst:352 +"Use essas funções para emitir avisos a partir de código C. Elas espelham " +"funções semelhantes exportadas pelo módulo :mod:`warnings` do Python. " +"Normalmente, elas exibem uma mensagem de aviso em *sys.stderr*; no entanto, " +"também é possível que o usuário tenha especificado que os avisos devem ser " +"transformados em erros, e nesse caso, uma exceção será lançada. Também é " +"possível que as funções levantem uma exceção devido a um problema com o " +"mecanismo de avisos. O valor de retorno é ``0`` se nenhuma exceção for " +"lançada, ou ``-1`` se uma exceção for lançada. (Não é possível determinar se " +"uma mensagem de aviso é realmente impressa, nem qual é o motivo da exceção; " +"isso é intencional.) Se uma exceção for levantada, a função que chamou a " +"função deve realizar seu tratamento de exceções normal (por exemplo, liberar " +"as referências pertencentes a :c:func:`Py_DECREF` e retornar um valor de " +"erro)." + +#: ../../c-api/exceptions.rst:392 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. " "*stack_level* is a positive number giving a number of stack frames; the " "warning will be issued from the currently executing line of code in that " -"stack frame. A *stack_level* of 1 is the function calling :c:func:" -"`PyErr_WarnEx`, 2 is the function above that, and so forth." +"stack frame. A *stack_level* of 1 is the function " +"calling :c:func:`PyErr_WarnEx`, 2 is the function above that, and so forth." msgstr "" +"Emite uma mensagem de aviso. O argumento *category* é uma categoria de aviso " +"(veja abaixo) ou ``NULL``; o argumento *message* é uma string codificada em " +"UTF-8. *stack_level* é um número positivo que indica o número de quadros da " +"pilha; o aviso será emitido a partir da linha de código atualmente em " +"execução nesse quadro da pilha. Um *stack_level* de 1 é a função que " +"chama :c:func:`PyErr_WarnEx`, 2 é a função acima dessa e assim por diante." -#: ../../c-api/exceptions.rst:359 +#: ../../c-api/exceptions.rst:399 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 " -"warning category is :c:data:`PyExc_RuntimeWarning`. The standard Python " -"warning categories are available as global variables whose names are " -"enumerated at :ref:`standardwarningcategories`." +"Warning categories must be subclasses " +"of :c:data:`PyExc_Warning`; :c:data:`PyExc_Warning` is a subclass " +"of :c:data:`PyExc_Exception`; the default warning category " +"is :c:data:`PyExc_RuntimeWarning`. The standard Python warning categories " +"are available as global variables whose names are enumerated " +"at :ref:`standardwarningcategories`." msgstr "" +"As categorias de aviso devem ser subclasses " +"de :c:data:`PyExc_Warning`; :c:data:`PyExc_Warning` é uma subclasse " +"de :c:data:`PyExc_Exception`; a categoria de aviso padrão " +"é :c:data:`PyExc_RuntimeWarning`. As categorias de aviso padrão do Python " +"estão disponíveis como variáveis globais cujos nomes estão enumerados " +"em :ref:`standardwarningcategories`." -#: ../../c-api/exceptions.rst:365 +#: ../../c-api/exceptions.rst:405 msgid "" -"For information about warning control, see the documentation for the :mod:" -"`warnings` module and the :option:`-W` option in the command line " +"For information about warning control, see the documentation for " +"the :mod:`warnings` module and the :option:`-W` option in the command line " "documentation. There is no C API for warning control." msgstr "" +"Para obter informações sobre o controle de avisos, consulte a documentação " +"do módulo :mod:`warnings` e a opção :option:`-W` na documentação da linha de " +"comando. Não existe uma API C para o controle de avisos." -#: ../../c-api/exceptions.rst:372 +#: ../../c-api/exceptions.rst:412 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* " -"arguments may be set to ``NULL`` to get the default effect described there." +"This is a straightforward wrapper around the Python " +"function :func:`warnings.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 "" +"Emite uma mensagem de aviso com controle explícito sobre todos os atributos " +"de aviso. Trata-se de um invólucro simples em torno da função " +"Python :func:`warnings.warn_explicit`; consulte-a para obter mais " +"informações. Os argumentos *module* e *registry* podem ser definidos como " +"``NULL`` para obter o efeito padrão descrito nessa função." -#: ../../c-api/exceptions.rst:383 +#: ../../c-api/exceptions.rst:423 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 :term:`filesystem encoding and error handler`." msgstr "" +"Semelhante a :c:func:`PyErr_WarnExplicitObject`, exceto que *message* e " +"*module* são strings codificadas em UTF-8 e *filename* é decodificado a " +"partir do :term:`tratador de erros e codificação do sistema de arquivos`." -#: ../../c-api/exceptions.rst:390 +#: ../../c-api/exceptions.rst:430 msgid "" -"Function similar to :c:func:`PyErr_WarnEx`, but use :c:func:" -"`PyUnicode_FromFormat` to format the warning message. *format* is an ASCII-" -"encoded string." +"Function similar to :c:func:`PyErr_WarnEx`, but " +"uses :c:func:`PyUnicode_FromFormat` to format the warning message. *format* " +"is an ASCII-encoded string." msgstr "" -#: ../../c-api/exceptions.rst:399 +#: ../../c-api/exceptions.rst:439 msgid "" -"Function similar to :c:func:`PyErr_WarnFormat`, but *category* is :exc:" -"`ResourceWarning` and it passes *source* to :class:`!warnings." -"WarningMessage`." +"Similar to :c:func:`PyErr_WarnExplicit`, but " +"uses :c:func:`PyUnicode_FromFormat` to format the warning message. *format* " +"is an ASCII-encoded string." msgstr "" -#: ../../c-api/exceptions.rst:406 +#: ../../c-api/exceptions.rst:448 +msgid "" +"Function similar to :c:func:`PyErr_WarnFormat`, but *category* " +"is :exc:`ResourceWarning` and it passes *source* to :class:`!" +"warnings.WarningMessage`." +msgstr "" +"Função similar a :c:func:`PyErr_WarnFormat`, mas a *category* " +"é :exc:`ResourceWarning` e ela passa *source* para :class:`!" +"warnings.WarningMessage`." + +#: ../../c-api/exceptions.rst:455 msgid "Querying the error indicator" msgstr "Consultando o indicador de erro" -#: ../../c-api/exceptions.rst:410 +#: ../../c-api/exceptions.rst:459 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." +"do not own a reference to the return value, so you do not need " +"to :c:func:`Py_DECREF` it." msgstr "" -#: ../../c-api/exceptions.rst:416 +#: ../../c-api/exceptions.rst:465 msgid "The caller must hold the GIL." -msgstr "" +msgstr "O caller deve possuir o GIL." -#: ../../c-api/exceptions.rst:420 +#: ../../c-api/exceptions.rst:469 msgid "" -"Do not compare the return value to a specific exception; use :c:func:" -"`PyErr_ExceptionMatches` instead, shown below. (The comparison could easily " -"fail since the exception may be an instance instead of a class, in the case " -"of a class exception, or it may be a subclass of the expected exception.)" +"Do not compare the return value to a specific exception; " +"use :c:func:`PyErr_ExceptionMatches` instead, shown below. (The comparison " +"could easily fail since the exception may be an instance instead of a class, " +"in the case of a class exception, or it may be a subclass of the expected " +"exception.)" msgstr "" -#: ../../c-api/exceptions.rst:428 +#: ../../c-api/exceptions.rst:477 msgid "" "Equivalent to ``PyErr_GivenExceptionMatches(PyErr_Occurred(), exc)``. This " "should only be called when an exception is actually set; a memory access " "violation will occur if no exception has been raised." msgstr "" -#: ../../c-api/exceptions.rst:435 +#: ../../c-api/exceptions.rst:484 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 " @@ -528,43 +726,59 @@ msgid "" "tuple (and recursively in subtuples) are searched for a match." msgstr "" -#: ../../c-api/exceptions.rst:443 +#: ../../c-api/exceptions.rst:492 msgid "" "Return the exception currently being raised, clearing the error indicator at " "the same time. Return ``NULL`` if the error indicator is not set." msgstr "" -#: ../../c-api/exceptions.rst:446 +#: ../../c-api/exceptions.rst:495 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 +#: ../../c-api/exceptions.rst:498 ../../c-api/exceptions.rst:543 msgid "For example::" msgstr "Por exemplo::" -#: ../../c-api/exceptions.rst:459 +#: ../../c-api/exceptions.rst:500 +msgid "" +"{\n" +" PyObject *exc = PyErr_GetRaisedException();\n" +"\n" +" /* ... code that might produce other errors ... */\n" +"\n" +" PyErr_SetRaisedException(exc);\n" +"}" +msgstr "" + +#: ../../c-api/exceptions.rst:508 msgid "" ":c:func:`PyErr_GetHandledException`, to save the exception currently being " "handled." msgstr "" -#: ../../c-api/exceptions.rst:467 +#: ../../c-api/exceptions.rst:516 msgid "" "Set *exc* as the exception currently being raised, clearing the existing " -"exception if one is set." +"exception if one is set. If *exc* is ``NULL``, just clear the existing " +"exception." msgstr "" -#: ../../c-api/exceptions.rst:472 -msgid "This call steals a reference to *exc*, which must be a valid exception." +#: ../../c-api/exceptions.rst:520 +msgid "*exc* must be a valid exception or ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:481 -msgid "Use :c:func:`PyErr_GetRaisedException` instead." +#: ../../c-api/exceptions.rst:522 +msgid "This call \":term:`steals `\" a reference to *exc*." msgstr "" -#: ../../c-api/exceptions.rst:483 +#: ../../c-api/exceptions.rst:531 +msgid "Use :c:func:`PyErr_GetRaisedException` instead." +msgstr "Use :c:func:`PyErr_GetRaisedException` em vez disso." + +#: ../../c-api/exceptions.rst:533 msgid "" "Retrieve the error indicator into three variables whose addresses are " "passed. If the error indicator is not set, set all three variables to " @@ -573,17 +787,37 @@ msgid "" "the type object is not." msgstr "" -#: ../../c-api/exceptions.rst:490 +#: ../../c-api/exceptions.rst:540 msgid "" "This function is normally only used by legacy code that needs to catch " "exceptions or save and restore the error indicator temporarily." msgstr "" -#: ../../c-api/exceptions.rst:509 +#: ../../c-api/exceptions.rst:545 +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" +"}" +msgstr "" +"{\n" +"PyObject *type, *value, *traceback;\n" +"PyErr_Fetch(&type, &value, &traceback);\n" +"\n" +"/* ... código que pode reproduzir outros erros ... */\n" +"\n" +"PyErr_Restore(type, value, traceback);\n" +"}" + +#: ../../c-api/exceptions.rst:559 msgid "Use :c:func:`PyErr_SetRaisedException` instead." -msgstr "" +msgstr "Use :c:func:`PyErr_SetRaisedException` em vez disso." -#: ../../c-api/exceptions.rst:511 +#: ../../c-api/exceptions.rst:561 msgid "" "Set the error indicator from the three objects, *type*, *value*, and " "*traceback*, clearing the existing exception if one is set. If the objects " @@ -596,20 +830,22 @@ msgid "" "don't use this function. I warned you.)" msgstr "" -#: ../../c-api/exceptions.rst:525 +#: ../../c-api/exceptions.rst:575 msgid "" "This function is normally only used by legacy code that needs to save and " "restore the error indicator temporarily. Use :c:func:`PyErr_Fetch` to save " "the current error indicator." msgstr "" -#: ../../c-api/exceptions.rst:534 +#: ../../c-api/exceptions.rst:584 msgid "" "Use :c:func:`PyErr_GetRaisedException` instead, to avoid any possible de-" "normalization." msgstr "" +"Use :c:func:`PyErr_GetRaisedException` em vez disso, para evitar qualquer " +"possível desnormalização." -#: ../../c-api/exceptions.rst:537 +#: ../../c-api/exceptions.rst:587 msgid "" "Under certain circumstances, the values returned by :c:func:`PyErr_Fetch` " "below can be \"unnormalized\", meaning that ``*exc`` is a class object but " @@ -619,22 +855,34 @@ msgid "" "improve performance." msgstr "" -#: ../../c-api/exceptions.rst:545 +#: ../../c-api/exceptions.rst:595 +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:600 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::" +"if (tb != NULL) {\n" +" PyException_SetTraceback(val, tb);\n" +"}" msgstr "" +"if (tb != NULL) {\n" +"PyException_SetTraceback(val, tb);\n" +"}" -#: ../../c-api/exceptions.rst:557 +#: ../../c-api/exceptions.rst:607 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." +"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:614 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 " @@ -642,14 +890,14 @@ msgid "" "clear the exception state." msgstr "" -#: ../../c-api/exceptions.rst:573 +#: ../../c-api/exceptions.rst:623 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 +#: ../../c-api/exceptions.rst:630 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 " @@ -657,17 +905,17 @@ msgid "" "exception state." msgstr "" -#: ../../c-api/exceptions.rst:589 +#: ../../c-api/exceptions.rst:639 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 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`." msgstr "" -#: ../../c-api/exceptions.rst:598 +#: ../../c-api/exceptions.rst:648 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 " @@ -675,17 +923,17 @@ msgid "" "exception state." msgstr "" -#: ../../c-api/exceptions.rst:608 +#: ../../c-api/exceptions.rst:658 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`." +"raised. This function \":term:`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 "" -#: ../../c-api/exceptions.rst:617 +#: ../../c-api/exceptions.rst:668 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 " @@ -693,76 +941,105 @@ msgid "" "state." msgstr "" -#: ../../c-api/exceptions.rst:624 +#: ../../c-api/exceptions.rst:675 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." +"argument). The function still \":term:`steals `\" references of all " +"three arguments." msgstr "" -#: ../../c-api/exceptions.rst:632 +#: ../../c-api/exceptions.rst:683 msgid "Signal Handling" msgstr "Tratamento de sinal" -#: ../../c-api/exceptions.rst:642 -msgid "This function interacts with Python's signal handling." -msgstr "Essa função interage com o manipulador de sinais do Python." +#: ../../c-api/exceptions.rst:693 +msgid "" +"Handle external interruptions, such as signals or activating a debugger, " +"whose processing has been delayed until it is safe to run Python code and/or " +"raise exceptions." +msgstr "" -#: ../../c-api/exceptions.rst:644 +#: ../../c-api/exceptions.rst:697 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." +"For example, pressing :kbd:`Ctrl-C` causes a terminal to send " +"the :py:data:`signal.SIGINT` signal. This function executes the " +"corresponding Python signal handler, which, by default, raises " +"the :exc:`KeyboardInterrupt` exception." msgstr "" -#: ../../c-api/exceptions.rst:649 +#: ../../c-api/exceptions.rst:702 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)." +":c:func:`!PyErr_CheckSignals` should be called by long-running C code " +"frequently enough so that the response appears immediate to humans." +msgstr "" + +#: ../../c-api/exceptions.rst:705 +msgid "Handlers invoked by this function currently include:" msgstr "" -#: ../../c-api/exceptions.rst:655 +#: ../../c-api/exceptions.rst:707 msgid "" -"If the function is called from a non-main thread, or under a non-main Python " -"interpreter, it does nothing and returns ``0``." +"Signal handlers, including Python functions registered using " +"the :mod:`signal` module." msgstr "" -#: ../../c-api/exceptions.rst:658 +#: ../../c-api/exceptions.rst:710 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)." +"Signal handlers are only run in the main thread of the main interpreter." msgstr "" -#: ../../c-api/exceptions.rst:662 +#: ../../c-api/exceptions.rst:712 msgid "" -"The default Python signal handler for :c:macro:`!SIGINT` raises the :exc:" -"`KeyboardInterrupt` exception." +"(This is where the function got the name: originally, signals were the only " +"way to interrupt the interpreter.)" msgstr "" -#: ../../c-api/exceptions.rst:673 +#: ../../c-api/exceptions.rst:715 +msgid "Running the garbage collector, if necessary." +msgstr "" + +#: ../../c-api/exceptions.rst:717 +msgid "" +"If any handler raises an exception, immediately return ``-1`` with that " +"exception set. Any remaining interruptions are left to be processed on the " +"next :c:func:`PyErr_CheckSignals()` invocation, if appropriate." +msgstr "" + +#: ../../c-api/exceptions.rst:722 +msgid "" +"If all handlers finish successfully, or there are no handlers to run, return " +"``0``." +msgstr "" + +#: ../../c-api/exceptions.rst:725 +msgid "This function may now invoke the garbage collector." +msgstr "" + +#: ../../c-api/exceptions.rst:736 msgid "" "Simulate the effect of a :c:macro:`!SIGINT` signal arriving. This is " "equivalent to ``PyErr_SetInterruptEx(SIGINT)``." msgstr "" +"Simula o efeito de um sinal :c:macro:`!SIGINT` chegando. Isto é equivalente " +"a ``PyErr_SetInterruptEx(SIGINT)``." -#: ../../c-api/exceptions.rst:677 ../../c-api/exceptions.rst:704 +#: ../../c-api/exceptions.rst:740 ../../c-api/exceptions.rst:767 msgid "" -"This function is async-signal-safe. It can be called without the :term:" -"`GIL` and from a C signal handler." +"This function is async-signal-safe. It can be called without " +"the :term:`GIL` and from a C signal handler." msgstr "" +"Esta função é segura para sinais assíncronos. Pode ser chamada sem " +"um :term:`GIL` e a partir de um manipulador de sinais C." -#: ../../c-api/exceptions.rst:687 +#: ../../c-api/exceptions.rst:750 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." +"Simulate the effect of a signal arriving. The next " +"time :c:func:`PyErr_CheckSignals` is called, the Python signal handler for " +"the given signal number will be called." msgstr "" -#: ../../c-api/exceptions.rst:691 +#: ../../c-api/exceptions.rst:754 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 " @@ -770,27 +1047,31 @@ msgid "" "interrupt an operation)." msgstr "" -#: ../../c-api/exceptions.rst:696 +#: ../../c-api/exceptions.rst:759 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." +"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 "" +"Se o sinal fornecido não for tratado pelo Python (foi definido " +"como :py:const:`signal.SIG_DFL` ou :py:const:`signal.SIG_IGN`), ele será " +"ignorado." -#: ../../c-api/exceptions.rst:699 +#: ../../c-api/exceptions.rst:762 msgid "" "If *signum* is outside of the allowed range of signal numbers, ``-1`` is " "returned. Otherwise, ``0`` is returned. The error indicator is never " "changed by this function." msgstr "" -#: ../../c-api/exceptions.rst:712 +#: ../../c-api/exceptions.rst:775 msgid "" "This utility function specifies a file descriptor to which the signal number " "is written as a single byte whenever a signal is received. *fd* must be non-" "blocking. It returns the previous such file descriptor." msgstr "" -#: ../../c-api/exceptions.rst:716 +#: ../../c-api/exceptions.rst:779 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 " @@ -802,15 +1083,15 @@ msgstr "" "verificação de erro. *fd* deve ser um descritor de arquivo válido. A função " "só deve ser chamada a partir da thread principal." -#: ../../c-api/exceptions.rst:721 +#: ../../c-api/exceptions.rst:784 msgid "On Windows, the function now also supports socket handles." msgstr "No Windows, a função agora também suporta manipuladores de socket." -#: ../../c-api/exceptions.rst:726 +#: ../../c-api/exceptions.rst:789 msgid "Exception Classes" msgstr "Classes de exceção" -#: ../../c-api/exceptions.rst:730 +#: ../../c-api/exceptions.rst:793 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 " @@ -819,35 +1100,55 @@ msgid "" "(accessible in C as :c:data:`PyExc_Exception`)." msgstr "" -#: ../../c-api/exceptions.rst:736 +#: ../../c-api/exceptions.rst:799 msgid "" -"The :attr:`!__module__` attribute of the new class is set to the first part " -"(up to the last dot) of the *name* argument, and the class name is set to " -"the last part (after the last dot). The *base* argument can be used to " +"The :attr:`~type.__module__` attribute of the new class is set to the first " +"part (up to the last dot) of the *name* argument, and the class name is set " +"to the last part (after the last dot). The *base* argument can be used to " "specify alternate base classes; it can either be only one class or a tuple " "of classes. The *dict* argument can be used to specify a dictionary of class " "variables and methods." msgstr "" -#: ../../c-api/exceptions.rst:745 +#: ../../c-api/exceptions.rst:808 msgid "" "Same as :c:func:`PyErr_NewException`, except that the new exception class " "can easily be given a docstring: If *doc* is non-``NULL``, it will be used " "as the docstring for the exception class." msgstr "" -#: ../../c-api/exceptions.rst:753 +#: ../../c-api/exceptions.rst:817 +msgid "" +"Return non-zero if *ob* is an exception class, zero otherwise. This function " +"always succeeds." +msgstr "" + +#: ../../c-api/exceptions.rst:822 +msgid "Return :c:member:`~PyTypeObject.tp_name` of the exception class *ob*." +msgstr "Retorna :c:member:`~PyTypeObject.tp_name` da classe de exceção *ob*." + +#: ../../c-api/exceptions.rst:826 msgid "Exception Objects" msgstr "Objeto Exceção" -#: ../../c-api/exceptions.rst:757 +#: ../../c-api/exceptions.rst:830 +msgid "" +"Return true if *op* is an instance of :class:`BaseException`, false " +"otherwise. This function always succeeds." +msgstr "" + +#: ../../c-api/exceptions.rst:836 +msgid "Equivalent to :c:func:`Py_TYPE(op) `." +msgstr "" + +#: ../../c-api/exceptions.rst:841 msgid "" "Return the traceback associated with the exception as a new reference, as " "accessible from Python through the :attr:`~BaseException.__traceback__` " "attribute. If there is no traceback associated, this returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:765 +#: ../../c-api/exceptions.rst:849 msgid "" "Set the traceback associated with the exception to *tb*. Use ``Py_None`` to " "clear it." @@ -855,7 +1156,7 @@ msgstr "" "Defina o retorno traceback (situação da pilha de execução) associado à " "exceção como *tb*. Use ``Py_None`` para limpá-lo." -#: ../../c-api/exceptions.rst:771 +#: ../../c-api/exceptions.rst:855 msgid "" "Return the context (another exception instance during whose handling *ex* " "was raised) associated with the exception as a new reference, as accessible " @@ -863,14 +1164,14 @@ msgid "" "there is no context associated, this returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:779 +#: ../../c-api/exceptions.rst:863 msgid "" "Set the context associated with the exception to *ctx*. Use ``NULL`` to " "clear it. There is no type check to make sure that *ctx* is an exception " -"instance. This steals a reference to *ctx*." +"instance. This \":term:`steals `\" a reference to *ctx*." msgstr "" -#: ../../c-api/exceptions.rst:786 +#: ../../c-api/exceptions.rst:870 msgid "" "Return the cause (either an exception instance, or ``None``, set by " "``raise ... from ...``) associated with the exception as a new reference, as " @@ -878,66 +1179,72 @@ msgid "" "attribute." msgstr "" -#: ../../c-api/exceptions.rst:794 +#: ../../c-api/exceptions.rst:878 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 ``None``. This \":term:`steals `\" a reference " +"to *cause*." msgstr "" -#: ../../c-api/exceptions.rst:798 +#: ../../c-api/exceptions.rst:883 msgid "" "The :attr:`~BaseException.__suppress_context__` attribute is implicitly set " "to ``True`` by this function." msgstr "" +"O atributo :attr:`~BaseException.__suppress_context__` é implicitamente " +"definido como ``True`` por esta função." -#: ../../c-api/exceptions.rst:804 +#: ../../c-api/exceptions.rst:889 msgid "Return :attr:`~BaseException.args` of exception *ex*." -msgstr "" +msgstr "Retorna :attr:`~BaseException.args` da exceção *ex*." -#: ../../c-api/exceptions.rst:809 +#: ../../c-api/exceptions.rst:894 msgid "Set :attr:`~BaseException.args` of exception *ex* to *args*." msgstr "" -#: ../../c-api/exceptions.rst:813 +#: ../../c-api/exceptions.rst:898 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." +"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:912 msgid "Unicode Exception Objects" msgstr "Objetos de exceção Unicode" -#: ../../c-api/exceptions.rst:829 +#: ../../c-api/exceptions.rst:914 msgid "" "The following functions are used to create and modify Unicode exceptions " "from C." msgstr "" "As seguintes funções são usadas para criar e modificar exceções Unicode de C." -#: ../../c-api/exceptions.rst:833 +#: ../../c-api/exceptions.rst:918 msgid "" "Create a :class:`UnicodeDecodeError` object with the attributes *encoding*, " "*object*, *length*, *start*, *end* and *reason*. *encoding* and *reason* are " "UTF-8 encoded strings." msgstr "" +"Cria um objeto :class:`UnicodeDecodeError` com os atributos *encoding*, " +"*object*, *length*, *start*, *end* e *reason*. O *encoding* e *reason* são " +"strings codificadas em UTF-8." -#: ../../c-api/exceptions.rst:840 +#: ../../c-api/exceptions.rst:925 msgid "Return the *encoding* attribute of the given exception object." msgstr "Retorna o atributo * encoding* dado no objeto da exceção." -#: ../../c-api/exceptions.rst:846 +#: ../../c-api/exceptions.rst:931 msgid "Return the *object* attribute of the given exception object." msgstr "Retorna o atributo *object* dado no objeto da exceção." -#: ../../c-api/exceptions.rst:852 +#: ../../c-api/exceptions.rst:937 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`` " @@ -947,7 +1254,7 @@ msgstr "" "*start* não deve ser ``NULL``. Retorna ``0`` se não der erro, ``-1`` caso dê " "erro." -#: ../../c-api/exceptions.rst:860 +#: ../../c-api/exceptions.rst:945 msgid "" "Set the *start* attribute of the given exception object to *start*. Return " "``0`` on success, ``-1`` on failure." @@ -955,7 +1262,7 @@ msgstr "" "Define o atributo *start* dado no objeto de exceção *start*. Em caso de " "sucesso, retorna ``0``, em caso de falha, retorna ``-1``." -#: ../../c-api/exceptions.rst:867 +#: ../../c-api/exceptions.rst:952 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 " @@ -965,27 +1272,31 @@ msgstr "" "*end* não deve ser ``NULL``. Em caso de sucesso, retorna ``0``, em caso de " "falha, retorna ``-1``." -#: ../../c-api/exceptions.rst:875 +#: ../../c-api/exceptions.rst:960 msgid "" "Set the *end* attribute of the given exception object to *end*. Return " "``0`` on success, ``-1`` on failure." msgstr "" +"Defina o atributo *end* do objeto de exceção fornecido para *end*. Retorna " +"``0`` em caso de sucesso e ``-1`` em caso de falha." -#: ../../c-api/exceptions.rst:882 +#: ../../c-api/exceptions.rst:967 msgid "Return the *reason* attribute of the given exception object." msgstr "Retorna o atributo *reason* dado no objeto da exceção." -#: ../../c-api/exceptions.rst:888 +#: ../../c-api/exceptions.rst:973 msgid "" "Set the *reason* attribute of the given exception object to *reason*. " "Return ``0`` on success, ``-1`` on failure." msgstr "" +"Defina o atributo *reason* do objeto de exceção fornecido para *reason*. " +"Retorna ``0`` em caso de sucesso e ``-1`` em caso de falha." -#: ../../c-api/exceptions.rst:895 +#: ../../c-api/exceptions.rst:980 msgid "Recursion Control" msgstr "Controle de recursão" -#: ../../c-api/exceptions.rst:897 +#: ../../c-api/exceptions.rst:982 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 " @@ -995,55 +1306,59 @@ msgid "" "recursion handling." msgstr "" -#: ../../c-api/exceptions.rst:906 +#: ../../c-api/exceptions.rst:991 msgid "Marks a point where a recursive C-level call is about to be performed." msgstr "" "Marca um ponto em que a chamada recursiva em nível C está prestes a ser " "executada." -#: ../../c-api/exceptions.rst:908 +#: ../../c-api/exceptions.rst:993 msgid "" "If :c:macro:`!USE_STACKCHECK` is defined, this function checks if the OS " "stack overflowed using :c:func:`PyOS_CheckStack`. If this is the case, it " "sets a :exc:`MemoryError` and returns a nonzero value." msgstr "" -#: ../../c-api/exceptions.rst:912 +#: ../../c-api/exceptions.rst:997 msgid "" "The function then checks if the recursion limit is reached. If this is the " "case, a :exc:`RecursionError` is set and a nonzero value is returned. " "Otherwise, zero is returned." msgstr "" -#: ../../c-api/exceptions.rst:916 +#: ../../c-api/exceptions.rst:1001 msgid "" "*where* should be a UTF-8 encoded string such as ``\" in instance check\"`` " "to be concatenated to the :exc:`RecursionError` message caused by the " "recursion depth limit." msgstr "" -#: ../../c-api/exceptions.rst:920 ../../c-api/exceptions.rst:928 +#: ../../c-api/exceptions.rst:1005 ../../c-api/exceptions.rst:1013 msgid "" "This function is now also available in the :ref:`limited API `." msgstr "" +"Esta função agora também está disponível na :ref:`API limitada `." -#: ../../c-api/exceptions.rst:925 +#: ../../c-api/exceptions.rst:1010 msgid "" "Ends a :c:func:`Py_EnterRecursiveCall`. Must be called once for each " "*successful* invocation of :c:func:`Py_EnterRecursiveCall`." msgstr "" +"Termina com :c:func:`Py_EnterRecursiveCall`. Deve ser chamada uma vez para " +"cada invocação *successful* de :c:func:`Py_EnterRecursiveCall`." -#: ../../c-api/exceptions.rst:931 +#: ../../c-api/exceptions.rst:1016 msgid "" "Properly implementing :c:member:`~PyTypeObject.tp_repr` for container types " -"requires special recursion handling. In addition to protecting the stack, :" -"c:member:`~PyTypeObject.tp_repr` also needs to track objects to prevent " -"cycles. The following two functions facilitate this functionality. " -"Effectively, these are the C equivalent to :func:`reprlib.recursive_repr`." +"requires special recursion handling. In addition to protecting the " +"stack, :c:member:`~PyTypeObject.tp_repr` also needs to track objects to " +"prevent cycles. The following two functions facilitate this functionality. " +"Effectively, these are the C equivalent to :deco:`reprlib.recursive_repr`." msgstr "" -#: ../../c-api/exceptions.rst:939 +#: ../../c-api/exceptions.rst:1024 msgid "" "Called at the beginning of the :c:member:`~PyTypeObject.tp_repr` " "implementation to detect cycles." @@ -1051,15 +1366,16 @@ msgstr "" "Chamado no início da implementação :c:member:`~PyTypeObject.tp_repr` para " "detectar ciclos." -#: ../../c-api/exceptions.rst:942 +#: ../../c-api/exceptions.rst:1027 msgid "" "If the object has already been processed, the function returns a positive " "integer. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " -"should return a string object indicating a cycle. As examples, :class:" -"`dict` objects return ``{...}`` and :class:`list` objects return ``[...]``." +"should return a string object indicating a cycle. As " +"examples, :class:`dict` objects return ``{...}`` and :class:`list` objects " +"return ``[...]``." msgstr "" -#: ../../c-api/exceptions.rst:948 +#: ../../c-api/exceptions.rst:1033 msgid "" "The function will return a negative integer if the recursion limit is " "reached. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " @@ -1069,945 +1385,462 @@ msgstr "" "Nesse caso a implementação :c:member:`~PyTypeObject.tp_repr` deverá, " "normalmente,. retornar ``NULL``." -#: ../../c-api/exceptions.rst:952 +#: ../../c-api/exceptions.rst:1037 msgid "" -"Otherwise, the function returns zero and the :c:member:`~PyTypeObject." -"tp_repr` implementation can continue normally." +"Otherwise, the function returns zero and " +"the :c:member:`~PyTypeObject.tp_repr` implementation can continue normally." msgstr "" -"Caso contrário, a função retorna zero e a implementação :c:member:" -"`~PyTypeObject.tp_repr` poderá continuar normalmente." +"Caso contrário, a função retorna zero e a " +"implementação :c:member:`~PyTypeObject.tp_repr` poderá continuar normalmente." -#: ../../c-api/exceptions.rst:957 +#: ../../c-api/exceptions.rst:1042 msgid "" -"Ends a :c:func:`Py_ReprEnter`. Must be called once for each invocation of :" -"c:func:`Py_ReprEnter` that returns zero." +"Ends a :c:func:`Py_ReprEnter`. Must be called once for each invocation " +"of :c:func:`Py_ReprEnter` that returns zero." msgstr "" "Termina a :c:func:`Py_ReprEnter`. Deve ser chamado uma vez para cada chamada " "de :c:func:`Py_ReprEnter` que retorna zero." -#: ../../c-api/exceptions.rst:964 -msgid "Standard Exceptions" -msgstr "Exceções Padrão" +#: ../../c-api/exceptions.rst:1047 +msgid "" +"Get the recursion limit for the current interpreter. It can be set " +"with :c:func:`Py_SetRecursionLimit`. The recursion limit prevents the Python " +"interpreter stack from growing infinitely." +msgstr "" + +#: ../../c-api/exceptions.rst:1051 ../../c-api/exceptions.rst:1061 +msgid "This function cannot fail, and the caller must hold the :term:`GIL`." +msgstr "" + +#: ../../c-api/exceptions.rst:1055 +msgid ":py:func:`sys.getrecursionlimit`" +msgstr "" + +#: ../../c-api/exceptions.rst:1059 +msgid "Set the recursion limit for the current interpreter." +msgstr "" + +#: ../../c-api/exceptions.rst:1065 +msgid ":py:func:`sys.setrecursionlimit`" +msgstr "" -#: ../../c-api/exceptions.rst:966 +#: ../../c-api/exceptions.rst:1070 +msgid "Exception and warning types" +msgstr "" + +#: ../../c-api/exceptions.rst:1072 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 " -"all the variables:" +"All standard Python exceptions and 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." msgstr "" -#: ../../c-api/exceptions.rst:1027 ../../c-api/exceptions.rst:1160 -#: ../../c-api/exceptions.rst:1205 -msgid "C Name" -msgstr "Nome C" +#: ../../c-api/exceptions.rst:1076 +msgid "For completeness, here are all the variables:" +msgstr "" -#: ../../c-api/exceptions.rst:1027 ../../c-api/exceptions.rst:1205 -msgid "Python Name" -msgstr "Nome Python" +#: ../../c-api/exceptions.rst:1079 +msgid "Exception types" +msgstr "Tipos de exceção" -#: ../../c-api/exceptions.rst:1027 ../../c-api/exceptions.rst:1160 -#: ../../c-api/exceptions.rst:1205 -msgid "Notes" -msgstr "Notas" +#: ../../c-api/exceptions.rst:1086 ../../c-api/exceptions.rst:1232 +#: ../../c-api/exceptions.rst:1262 +msgid "C name" +msgstr "Nome C" -#: ../../c-api/exceptions.rst:1029 -msgid ":c:data:`PyExc_BaseException`" -msgstr ":c:data:`PyExc_BaseException`" +#: ../../c-api/exceptions.rst:1087 ../../c-api/exceptions.rst:1233 +#: ../../c-api/exceptions.rst:1263 +msgid "Python name" +msgstr "Nome Python" -#: ../../c-api/exceptions.rst:1029 +#: ../../c-api/exceptions.rst:1089 msgid ":exc:`BaseException`" msgstr ":exc:`BaseException`" -#: ../../c-api/exceptions.rst:1029 ../../c-api/exceptions.rst:1031 -#: ../../c-api/exceptions.rst:1033 ../../c-api/exceptions.rst:1079 #: ../../c-api/exceptions.rst:1091 -msgid "[1]_" -msgstr "[1]_" - -#: ../../c-api/exceptions.rst:1031 -msgid ":c:data:`PyExc_Exception`" -msgstr ":c:data:`PyExc_Exception`" +msgid ":exc:`BaseExceptionGroup`" +msgstr ":exc:`BaseExceptionGroup`" -#: ../../c-api/exceptions.rst:1031 +#: ../../c-api/exceptions.rst:1093 msgid ":exc:`Exception`" msgstr ":exc:`Exception`" -#: ../../c-api/exceptions.rst:1033 -msgid ":c:data:`PyExc_ArithmeticError`" -msgstr ":c:data:`PyExc_ArithmeticError`" - -#: ../../c-api/exceptions.rst:1033 +#: ../../c-api/exceptions.rst:1095 msgid ":exc:`ArithmeticError`" msgstr ":exc:`ArithmeticError`" -#: ../../c-api/exceptions.rst:1035 -msgid ":c:data:`PyExc_AssertionError`" -msgstr ":c:data:`PyExc_AssertionError`" - -#: ../../c-api/exceptions.rst:1035 +#: ../../c-api/exceptions.rst:1097 msgid ":exc:`AssertionError`" msgstr ":exc:`AssertionError`" -#: ../../c-api/exceptions.rst:1037 -msgid ":c:data:`PyExc_AttributeError`" -msgstr ":c:data:`PyExc_AttributeError`" - -#: ../../c-api/exceptions.rst:1037 +#: ../../c-api/exceptions.rst:1099 msgid ":exc:`AttributeError`" msgstr ":exc:`AttributeError`" -#: ../../c-api/exceptions.rst:1039 -msgid ":c:data:`PyExc_BlockingIOError`" -msgstr ":c:data:`PyExc_BlockingIOError`" - -#: ../../c-api/exceptions.rst:1039 +#: ../../c-api/exceptions.rst:1101 msgid ":exc:`BlockingIOError`" msgstr ":exc:`BlockingIOError`" -#: ../../c-api/exceptions.rst:1041 -msgid ":c:data:`PyExc_BrokenPipeError`" -msgstr ":c:data:`PyExc_BrokenPipeError`" - -#: ../../c-api/exceptions.rst:1041 +#: ../../c-api/exceptions.rst:1103 msgid ":exc:`BrokenPipeError`" msgstr ":exc:`BrokenPipeError`" -#: ../../c-api/exceptions.rst:1043 -msgid ":c:data:`PyExc_BufferError`" -msgstr ":c:data:`PyExc_BufferError`" - -#: ../../c-api/exceptions.rst:1043 +#: ../../c-api/exceptions.rst:1105 msgid ":exc:`BufferError`" msgstr ":exc:`BufferError`" -#: ../../c-api/exceptions.rst:1045 -msgid ":c:data:`PyExc_ChildProcessError`" -msgstr ":c:data:`PyExc_ChildProcessError`" - -#: ../../c-api/exceptions.rst:1045 +#: ../../c-api/exceptions.rst:1107 msgid ":exc:`ChildProcessError`" msgstr ":exc:`ChildProcessError`" -#: ../../c-api/exceptions.rst:1047 -msgid ":c:data:`PyExc_ConnectionAbortedError`" -msgstr ":c:data:`PyExc_ConnectionAbortedError`" - -#: ../../c-api/exceptions.rst:1047 +#: ../../c-api/exceptions.rst:1109 msgid ":exc:`ConnectionAbortedError`" msgstr ":exc:`ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:1049 -msgid ":c:data:`PyExc_ConnectionError`" -msgstr ":c:data:`PyExc_ConnectionError`" - -#: ../../c-api/exceptions.rst:1049 +#: ../../c-api/exceptions.rst:1111 msgid ":exc:`ConnectionError`" msgstr ":exc:`ConnectionError`" -#: ../../c-api/exceptions.rst:1051 -msgid ":c:data:`PyExc_ConnectionRefusedError`" -msgstr ":c:data:`PyExc_ConnectionRefusedError`" - -#: ../../c-api/exceptions.rst:1051 +#: ../../c-api/exceptions.rst:1113 msgid ":exc:`ConnectionRefusedError`" msgstr ":exc:`ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:1053 -msgid ":c:data:`PyExc_ConnectionResetError`" -msgstr ":c:data:`PyExc_ConnectionResetError`" - -#: ../../c-api/exceptions.rst:1053 +#: ../../c-api/exceptions.rst:1115 msgid ":exc:`ConnectionResetError`" msgstr ":exc:`ConnectionResetError`" -#: ../../c-api/exceptions.rst:1055 -msgid ":c:data:`PyExc_EOFError`" -msgstr ":c:data:`PyExc_EOFError`" - -#: ../../c-api/exceptions.rst:1055 +#: ../../c-api/exceptions.rst:1117 msgid ":exc:`EOFError`" msgstr ":exc:`EOFError`" -#: ../../c-api/exceptions.rst:1057 -msgid ":c:data:`PyExc_FileExistsError`" -msgstr ":c:data:`PyExc_FileExistsError`" - -#: ../../c-api/exceptions.rst:1057 +#: ../../c-api/exceptions.rst:1119 msgid ":exc:`FileExistsError`" msgstr ":exc:`FileExistsError`" -#: ../../c-api/exceptions.rst:1059 -msgid ":c:data:`PyExc_FileNotFoundError`" -msgstr ":c:data:`PyExc_FileNotFoundError`" - -#: ../../c-api/exceptions.rst:1059 +#: ../../c-api/exceptions.rst:1121 msgid ":exc:`FileNotFoundError`" msgstr ":exc:`FileNotFoundError`" -#: ../../c-api/exceptions.rst:1061 -msgid ":c:data:`PyExc_FloatingPointError`" -msgstr ":c:data:`PyExc_FloatingPointError`" - -#: ../../c-api/exceptions.rst:1061 +#: ../../c-api/exceptions.rst:1123 msgid ":exc:`FloatingPointError`" msgstr ":exc:`FloatingPointError`" -#: ../../c-api/exceptions.rst:1063 -msgid ":c:data:`PyExc_GeneratorExit`" -msgstr ":c:data:`PyExc_GeneratorExit`" - -#: ../../c-api/exceptions.rst:1063 +#: ../../c-api/exceptions.rst:1125 msgid ":exc:`GeneratorExit`" msgstr ":exc:`GeneratorExit`" -#: ../../c-api/exceptions.rst:1065 -msgid ":c:data:`PyExc_ImportError`" -msgstr ":c:data:`PyExc_ImportError`" - -#: ../../c-api/exceptions.rst:1065 +#: ../../c-api/exceptions.rst:1127 msgid ":exc:`ImportError`" msgstr ":exc:`ImportError`" -#: ../../c-api/exceptions.rst:1067 -msgid ":c:data:`PyExc_IndentationError`" -msgstr ":c:data:`PyExc_IndentationError`" - -#: ../../c-api/exceptions.rst:1067 +#: ../../c-api/exceptions.rst:1129 msgid ":exc:`IndentationError`" msgstr ":exc:`IndentationError`" -#: ../../c-api/exceptions.rst:1069 -msgid ":c:data:`PyExc_IndexError`" -msgstr ":c:data:`PyExc_IndexError`" - -#: ../../c-api/exceptions.rst:1069 +#: ../../c-api/exceptions.rst:1131 msgid ":exc:`IndexError`" msgstr ":exc:`IndexError`" -#: ../../c-api/exceptions.rst:1071 -msgid ":c:data:`PyExc_InterruptedError`" -msgstr ":c:data:`PyExc_InterruptedError`" - -#: ../../c-api/exceptions.rst:1071 +#: ../../c-api/exceptions.rst:1133 msgid ":exc:`InterruptedError`" msgstr ":exc:`InterruptedError`" -#: ../../c-api/exceptions.rst:1073 -msgid ":c:data:`PyExc_IsADirectoryError`" -msgstr ":c:data:`PyExc_IsADirectoryError`" - -#: ../../c-api/exceptions.rst:1073 +#: ../../c-api/exceptions.rst:1135 msgid ":exc:`IsADirectoryError`" msgstr ":exc:`IsADirectoryError`" -#: ../../c-api/exceptions.rst:1075 -msgid ":c:data:`PyExc_KeyError`" -msgstr ":c:data:`PyExc_KeyError`" - -#: ../../c-api/exceptions.rst:1075 +#: ../../c-api/exceptions.rst:1137 msgid ":exc:`KeyError`" msgstr ":exc:`KeyError`" -#: ../../c-api/exceptions.rst:1077 -msgid ":c:data:`PyExc_KeyboardInterrupt`" -msgstr ":c:data:`PyExc_KeyboardInterrupt`" - -#: ../../c-api/exceptions.rst:1077 +#: ../../c-api/exceptions.rst:1139 msgid ":exc:`KeyboardInterrupt`" msgstr ":exc:`KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:1079 -msgid ":c:data:`PyExc_LookupError`" -msgstr ":c:data:`PyExc_LookupError`" - -#: ../../c-api/exceptions.rst:1079 +#: ../../c-api/exceptions.rst:1141 msgid ":exc:`LookupError`" msgstr ":exc:`LookupError`" -#: ../../c-api/exceptions.rst:1081 -msgid ":c:data:`PyExc_MemoryError`" -msgstr ":c:data:`PyExc_MemoryError`" - -#: ../../c-api/exceptions.rst:1081 +#: ../../c-api/exceptions.rst:1143 msgid ":exc:`MemoryError`" msgstr ":exc:`MemoryError`" -#: ../../c-api/exceptions.rst:1083 -msgid ":c:data:`PyExc_ModuleNotFoundError`" -msgstr ":c:data:`PyExc_ModuleNotFoundError`" - -#: ../../c-api/exceptions.rst:1083 +#: ../../c-api/exceptions.rst:1145 msgid ":exc:`ModuleNotFoundError`" msgstr ":exc:`ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:1085 -msgid ":c:data:`PyExc_NameError`" -msgstr ":c:data:`PyExc_NameError`" - -#: ../../c-api/exceptions.rst:1085 +#: ../../c-api/exceptions.rst:1147 msgid ":exc:`NameError`" msgstr ":exc:`NameError`" -#: ../../c-api/exceptions.rst:1087 -msgid ":c:data:`PyExc_NotADirectoryError`" -msgstr ":c:data:`PyExc_NotADirectoryError`" - -#: ../../c-api/exceptions.rst:1087 +#: ../../c-api/exceptions.rst:1149 msgid ":exc:`NotADirectoryError`" msgstr ":exc:`NotADirectoryError`" -#: ../../c-api/exceptions.rst:1089 -msgid ":c:data:`PyExc_NotImplementedError`" -msgstr ":c:data:`PyExc_NotImplementedError`" - -#: ../../c-api/exceptions.rst:1089 +#: ../../c-api/exceptions.rst:1151 msgid ":exc:`NotImplementedError`" msgstr ":exc:`NotImplementedError`" -#: ../../c-api/exceptions.rst:1091 -msgid ":c:data:`PyExc_OSError`" -msgstr ":c:data:`PyExc_OSError`" - -#: ../../c-api/exceptions.rst:1091 +#: ../../c-api/exceptions.rst:1153 ../../c-api/exceptions.rst:1236 +#: ../../c-api/exceptions.rst:1239 ../../c-api/exceptions.rst:1242 msgid ":exc:`OSError`" msgstr ":exc:`OSError`" -#: ../../c-api/exceptions.rst:1093 -msgid ":c:data:`PyExc_OverflowError`" -msgstr ":c:data:`PyExc_OverflowError`" - -#: ../../c-api/exceptions.rst:1093 +#: ../../c-api/exceptions.rst:1155 msgid ":exc:`OverflowError`" msgstr ":exc:`OverflowError`" -#: ../../c-api/exceptions.rst:1095 -msgid ":c:data:`PyExc_PermissionError`" -msgstr ":c:data:`PyExc_PermissionError`" - -#: ../../c-api/exceptions.rst:1095 +#: ../../c-api/exceptions.rst:1157 msgid ":exc:`PermissionError`" msgstr ":exc:`PermissionError`" -#: ../../c-api/exceptions.rst:1097 -msgid ":c:data:`PyExc_ProcessLookupError`" -msgstr ":c:data:`PyExc_ProcessLookupError`" - -#: ../../c-api/exceptions.rst:1097 +#: ../../c-api/exceptions.rst:1159 msgid ":exc:`ProcessLookupError`" msgstr ":exc:`ProcessLookupError`" -#: ../../c-api/exceptions.rst:1099 -msgid ":c:data:`PyExc_RecursionError`" -msgstr ":c:data:`PyExc_RecursionError`" +#: ../../c-api/exceptions.rst:1161 +msgid ":exc:`PythonFinalizationError`" +msgstr ":exc:`PythonFinalizationError`" -#: ../../c-api/exceptions.rst:1099 +#: ../../c-api/exceptions.rst:1163 msgid ":exc:`RecursionError`" msgstr ":exc:`RecursionError`" -#: ../../c-api/exceptions.rst:1101 -msgid ":c:data:`PyExc_ReferenceError`" -msgstr ":c:data:`PyExc_ReferenceError`" - -#: ../../c-api/exceptions.rst:1101 +#: ../../c-api/exceptions.rst:1165 msgid ":exc:`ReferenceError`" msgstr ":exc:`ReferenceError`" -#: ../../c-api/exceptions.rst:1103 -msgid ":c:data:`PyExc_RuntimeError`" -msgstr ":c:data:`PyExc_RuntimeError`" - -#: ../../c-api/exceptions.rst:1103 +#: ../../c-api/exceptions.rst:1167 msgid ":exc:`RuntimeError`" msgstr ":exc:`RuntimeError`" -#: ../../c-api/exceptions.rst:1105 -msgid ":c:data:`PyExc_StopAsyncIteration`" -msgstr ":c:data:`PyExc_StopAsyncIteration`" - -#: ../../c-api/exceptions.rst:1105 +#: ../../c-api/exceptions.rst:1169 msgid ":exc:`StopAsyncIteration`" msgstr ":exc:`StopAsyncIteration`" -#: ../../c-api/exceptions.rst:1107 -msgid ":c:data:`PyExc_StopIteration`" -msgstr ":c:data:`PyExc_StopIteration`" - -#: ../../c-api/exceptions.rst:1107 +#: ../../c-api/exceptions.rst:1171 msgid ":exc:`StopIteration`" msgstr ":exc:`StopIteration`" -#: ../../c-api/exceptions.rst:1109 -msgid ":c:data:`PyExc_SyntaxError`" -msgstr ":c:data:`PyExc_SyntaxError`" - -#: ../../c-api/exceptions.rst:1109 +#: ../../c-api/exceptions.rst:1173 msgid ":exc:`SyntaxError`" msgstr ":exc:`SyntaxError`" -#: ../../c-api/exceptions.rst:1111 -msgid ":c:data:`PyExc_SystemError`" -msgstr ":c:data:`PyExc_SystemError`" - -#: ../../c-api/exceptions.rst:1111 +#: ../../c-api/exceptions.rst:1175 msgid ":exc:`SystemError`" msgstr ":exc:`SystemError`" -#: ../../c-api/exceptions.rst:1113 -msgid ":c:data:`PyExc_SystemExit`" -msgstr ":c:data:`PyExc_SystemExit`" - -#: ../../c-api/exceptions.rst:1113 +#: ../../c-api/exceptions.rst:1177 msgid ":exc:`SystemExit`" msgstr ":exc:`SystemExit`" -#: ../../c-api/exceptions.rst:1115 -msgid ":c:data:`PyExc_TabError`" -msgstr ":c:data:`PyExc_TabError`" - -#: ../../c-api/exceptions.rst:1115 +#: ../../c-api/exceptions.rst:1179 msgid ":exc:`TabError`" msgstr ":exc:`TabError`" -#: ../../c-api/exceptions.rst:1117 -msgid ":c:data:`PyExc_TimeoutError`" -msgstr ":c:data:`PyExc_TimeoutError`" - -#: ../../c-api/exceptions.rst:1117 +#: ../../c-api/exceptions.rst:1181 msgid ":exc:`TimeoutError`" msgstr ":exc:`TimeoutError`" -#: ../../c-api/exceptions.rst:1119 -msgid ":c:data:`PyExc_TypeError`" -msgstr ":c:data:`PyExc_TypeError`" - -#: ../../c-api/exceptions.rst:1119 +#: ../../c-api/exceptions.rst:1183 msgid ":exc:`TypeError`" msgstr ":exc:`TypeError`" -#: ../../c-api/exceptions.rst:1121 -msgid ":c:data:`PyExc_UnboundLocalError`" -msgstr ":c:data:`PyExc_UnboundLocalError`" - -#: ../../c-api/exceptions.rst:1121 +#: ../../c-api/exceptions.rst:1185 msgid ":exc:`UnboundLocalError`" msgstr ":exc:`UnboundLocalError`" -#: ../../c-api/exceptions.rst:1123 -msgid ":c:data:`PyExc_UnicodeDecodeError`" -msgstr ":c:data:`PyExc_UnicodeDecodeError`" - -#: ../../c-api/exceptions.rst:1123 +#: ../../c-api/exceptions.rst:1187 msgid ":exc:`UnicodeDecodeError`" msgstr ":exc:`UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1125 -msgid ":c:data:`PyExc_UnicodeEncodeError`" -msgstr ":c:data:`PyExc_UnicodeEncodeError`" - -#: ../../c-api/exceptions.rst:1125 +#: ../../c-api/exceptions.rst:1189 msgid ":exc:`UnicodeEncodeError`" msgstr ":exc:`UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1127 -msgid ":c:data:`PyExc_UnicodeError`" -msgstr ":c:data:`PyExc_UnicodeError`" - -#: ../../c-api/exceptions.rst:1127 +#: ../../c-api/exceptions.rst:1191 msgid ":exc:`UnicodeError`" msgstr ":exc:`UnicodeError`" -#: ../../c-api/exceptions.rst:1129 -msgid ":c:data:`PyExc_UnicodeTranslateError`" -msgstr ":c:data:`PyExc_UnicodeTranslateError`" - -#: ../../c-api/exceptions.rst:1129 +#: ../../c-api/exceptions.rst:1193 msgid ":exc:`UnicodeTranslateError`" msgstr ":exc:`UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1131 -msgid ":c:data:`PyExc_ValueError`" -msgstr ":c:data:`PyExc_ValueError`" - -#: ../../c-api/exceptions.rst:1131 +#: ../../c-api/exceptions.rst:1195 msgid ":exc:`ValueError`" msgstr ":exc:`ValueError`" -#: ../../c-api/exceptions.rst:1133 -msgid ":c:data:`PyExc_ZeroDivisionError`" -msgstr ":c:data:`PyExc_ZeroDivisionError`" - -#: ../../c-api/exceptions.rst:1133 +#: ../../c-api/exceptions.rst:1197 msgid ":exc:`ZeroDivisionError`" msgstr ":exc:`ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1136 -msgid "" -":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:" -"`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:" -"`PyExc_ConnectionAbortedError`, :c:data:`PyExc_ConnectionRefusedError`, :c:" -"data:`PyExc_ConnectionResetError`, :c:data:`PyExc_FileExistsError`, :c:data:" -"`PyExc_FileNotFoundError`, :c:data:`PyExc_InterruptedError`, :c:data:" -"`PyExc_IsADirectoryError`, :c:data:`PyExc_NotADirectoryError`, :c:data:" -"`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` and :c:data:" -"`PyExc_TimeoutError` were introduced following :pep:`3151`." -msgstr "" -":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:" -"`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:" -"`PyExc_ConnectionAbortedError`, :c:data:`PyExc_ConnectionRefusedError`, :c:" -"data:`PyExc_ConnectionResetError`, :c:data:`PyExc_FileExistsError`, :c:data:" -"`PyExc_FileNotFoundError`, :c:data:`PyExc_InterruptedError`, :c:data:" -"`PyExc_IsADirectoryError`, :c:data:`PyExc_NotADirectoryError`, :c:data:" -"`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` e :c:data:" -"`PyExc_TimeoutError` foram introduzidos seguindo a :pep:`3151`." - -#: ../../c-api/exceptions.rst:1146 +#: ../../c-api/exceptions.rst:1199 +msgid "" +":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:`PyExc_ConnectionAbortedError`, :c:data:`PyExc_ConnectionRefusedError`, :c:data:`PyExc_ConnectionResetError`, :c:data:`PyExc_FileExistsError`, :c:data:`PyExc_FileNotFoundError`, :c:data:`PyExc_InterruptedError`, :c:data:`PyExc_IsADirectoryError`, :c:data:`PyExc_NotADirectoryError`, :c:data:`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` " +"and :c:data:`PyExc_TimeoutError` were introduced following :pep:`3151`." +msgstr "" +":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:`PyExc_ConnectionAbortedError`, :c:data:`PyExc_ConnectionRefusedError`, :c:data:`PyExc_ConnectionResetError`, :c:data:`PyExc_FileExistsError`, :c:data:`PyExc_FileNotFoundError`, :c:data:`PyExc_InterruptedError`, :c:data:`PyExc_IsADirectoryError`, :c:data:`PyExc_NotADirectoryError`, :c:data:`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` " +"e :c:data:`PyExc_TimeoutError` foram introduzidos seguindo a :pep:`3151`." + +#: ../../c-api/exceptions.rst:1209 msgid ":c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`." msgstr ":c:data:`PyExc_StopAsyncIteration` e :c:data:`PyExc_RecursionError`." -#: ../../c-api/exceptions.rst:1149 +#: ../../c-api/exceptions.rst:1212 msgid ":c:data:`PyExc_ModuleNotFoundError`." msgstr ":c:data:`PyExc_ModuleNotFoundError`." -#: ../../c-api/exceptions.rst:1152 -msgid "These are compatibility aliases to :c:data:`PyExc_OSError`:" -msgstr "Esses são os aliases de compatibilidade para :c:data:`PyExc_OSError`:" - -#: ../../c-api/exceptions.rst:1162 -msgid ":c:data:`!PyExc_EnvironmentError`" -msgstr "" +#: ../../c-api/exceptions.rst:1215 +msgid ":c:data:`PyExc_BaseExceptionGroup`." +msgstr ":c:data:`PyExc_BaseExceptionGroup`." -#: ../../c-api/exceptions.rst:1164 -msgid ":c:data:`!PyExc_IOError`" +#: ../../c-api/exceptions.rst:1220 +msgid "OSError aliases" msgstr "" -#: ../../c-api/exceptions.rst:1166 -msgid ":c:data:`!PyExc_WindowsError`" +#: ../../c-api/exceptions.rst:1222 +msgid "The following are a compatibility aliases to :c:data:`PyExc_OSError`." msgstr "" -#: ../../c-api/exceptions.rst:1166 -msgid "[2]_" -msgstr "[2]_" - -#: ../../c-api/exceptions.rst:1169 +#: ../../c-api/exceptions.rst:1224 msgid "These aliases used to be separate exception types." msgstr "Esses aliases costumavam ser tipos de exceção separados." -#: ../../c-api/exceptions.rst:1172 ../../c-api/exceptions.rst:1233 +#: ../../c-api/exceptions.rst:1234 +msgid "Notes" +msgstr "Notas" + +#: ../../c-api/exceptions.rst:1243 +msgid "[win]_" +msgstr "[win]_" + +#: ../../c-api/exceptions.rst:1245 msgid "Notes:" msgstr "Notas:" -#: ../../c-api/exceptions.rst:1175 -msgid "This is a base class for other standard exceptions." -msgstr "Esta é uma classe base para outras exceções padrão." - -#: ../../c-api/exceptions.rst:1178 +#: ../../c-api/exceptions.rst:1248 msgid "" -"Only defined on Windows; protect code that uses this by testing that the " -"preprocessor macro ``MS_WINDOWS`` is defined." +":c:var:`!PyExc_WindowsError` is only defined on Windows; protect code that " +"uses this by testing that the preprocessor macro ``MS_WINDOWS`` is defined." msgstr "" -"Defina apenas no Windows; proteja o código que usa isso testando se a macro " -"do pré-processador ``MS_WINDOWS`` está definida." - -#: ../../c-api/exceptions.rst:1184 -msgid "Standard Warning Categories" -msgstr "Categorias de aviso padrão" -#: ../../c-api/exceptions.rst:1186 -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, " -"here are all the variables:" +#: ../../c-api/exceptions.rst:1255 +msgid "Warning types" msgstr "" -#: ../../c-api/exceptions.rst:1207 -msgid ":c:data:`PyExc_Warning`" -msgstr ":c:data:`PyExc_Warning`" - -#: ../../c-api/exceptions.rst:1207 +#: ../../c-api/exceptions.rst:1265 msgid ":exc:`Warning`" msgstr ":exc:`Warning`" -#: ../../c-api/exceptions.rst:1207 -msgid "[3]_" -msgstr "[3]_" - -#: ../../c-api/exceptions.rst:1209 -msgid ":c:data:`PyExc_BytesWarning`" -msgstr ":c:data:`PyExc_BytesWarning`" - -#: ../../c-api/exceptions.rst:1209 +#: ../../c-api/exceptions.rst:1267 msgid ":exc:`BytesWarning`" msgstr ":exc:`BytesWarning`" -#: ../../c-api/exceptions.rst:1211 -msgid ":c:data:`PyExc_DeprecationWarning`" -msgstr ":c:data:`PyExc_DeprecationWarning`" - -#: ../../c-api/exceptions.rst:1211 +#: ../../c-api/exceptions.rst:1269 msgid ":exc:`DeprecationWarning`" msgstr ":exc:`DeprecationWarning`" -#: ../../c-api/exceptions.rst:1213 -msgid ":c:data:`PyExc_FutureWarning`" -msgstr ":c:data:`PyExc_FutureWarning`" +#: ../../c-api/exceptions.rst:1271 +msgid ":exc:`EncodingWarning`" +msgstr ":exc:`EncodingWarning`" -#: ../../c-api/exceptions.rst:1213 +#: ../../c-api/exceptions.rst:1273 msgid ":exc:`FutureWarning`" msgstr ":exc:`FutureWarning`" -#: ../../c-api/exceptions.rst:1215 -msgid ":c:data:`PyExc_ImportWarning`" -msgstr ":c:data:`PyExc_ImportWarning`" - -#: ../../c-api/exceptions.rst:1215 +#: ../../c-api/exceptions.rst:1275 msgid ":exc:`ImportWarning`" msgstr ":exc:`ImportWarning`" -#: ../../c-api/exceptions.rst:1217 -msgid ":c:data:`PyExc_PendingDeprecationWarning`" -msgstr ":c:data:`PyExc_PendingDeprecationWarning`" - -#: ../../c-api/exceptions.rst:1217 +#: ../../c-api/exceptions.rst:1277 msgid ":exc:`PendingDeprecationWarning`" msgstr ":exc:`PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1219 -msgid ":c:data:`PyExc_ResourceWarning`" -msgstr ":c:data:`PyExc_ResourceWarning`" - -#: ../../c-api/exceptions.rst:1219 +#: ../../c-api/exceptions.rst:1279 msgid ":exc:`ResourceWarning`" msgstr ":exc:`ResourceWarning`" -#: ../../c-api/exceptions.rst:1221 -msgid ":c:data:`PyExc_RuntimeWarning`" -msgstr ":c:data:`PyExc_RuntimeWarning`" - -#: ../../c-api/exceptions.rst:1221 +#: ../../c-api/exceptions.rst:1281 msgid ":exc:`RuntimeWarning`" msgstr ":exc:`RuntimeWarning`" -#: ../../c-api/exceptions.rst:1223 -msgid ":c:data:`PyExc_SyntaxWarning`" -msgstr ":c:data:`PyExc_SyntaxWarning`" - -#: ../../c-api/exceptions.rst:1223 +#: ../../c-api/exceptions.rst:1283 msgid ":exc:`SyntaxWarning`" msgstr ":exc:`SyntaxWarning`" -#: ../../c-api/exceptions.rst:1225 -msgid ":c:data:`PyExc_UnicodeWarning`" -msgstr ":c:data:`PyExc_UnicodeWarning`" - -#: ../../c-api/exceptions.rst:1225 +#: ../../c-api/exceptions.rst:1285 msgid ":exc:`UnicodeWarning`" msgstr ":exc:`UnicodeWarning`" -#: ../../c-api/exceptions.rst:1227 -msgid ":c:data:`PyExc_UserWarning`" -msgstr ":c:data:`PyExc_UserWarning`" - -#: ../../c-api/exceptions.rst:1227 +#: ../../c-api/exceptions.rst:1287 msgid ":exc:`UserWarning`" msgstr ":exc:`UserWarning`" -#: ../../c-api/exceptions.rst:1230 +#: ../../c-api/exceptions.rst:1289 msgid ":c:data:`PyExc_ResourceWarning`." msgstr ":c:data:`PyExc_ResourceWarning`." -#: ../../c-api/exceptions.rst:1236 -msgid "This is a base class for other standard warning categories." -msgstr "Esta é uma classe base para outras categorias de aviso padrão." - -#: ../../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 "módulo" - -#: ../../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 "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_BaseException (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_Exception (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_ArithmeticError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_AssertionError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_AttributeError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_BlockingIOError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_BrokenPipeError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_BufferError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_ChildProcessError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_ConnectionAbortedError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_ConnectionError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_ConnectionRefusedError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_ConnectionResetError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_EOFError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_FileExistsError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_FileNotFoundError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_FloatingPointError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_GeneratorExit (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_ImportError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_IndentationError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_IndexError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_InterruptedError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_IsADirectoryError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_KeyError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_KeyboardInterrupt (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_LookupError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_MemoryError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_ModuleNotFoundError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_NameError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_NotADirectoryError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_NotImplementedError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_OSError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_OverflowError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_PermissionError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_ProcessLookupError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_RecursionError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_ReferenceError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_RuntimeError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_StopAsyncIteration (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_StopIteration (C var)" -msgstr "" +#: ../../c-api/exceptions.rst:1292 +msgid ":c:data:`PyExc_EncodingWarning`." +msgstr ":c:data:`PyExc_EncodingWarning`." -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_SyntaxError (C var)" +#: ../../c-api/exceptions.rst:1297 +msgid "Tracebacks" msgstr "" -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_SystemError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_SystemExit (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_TabError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_TimeoutError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_TypeError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_UnboundLocalError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_UnicodeDecodeError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_UnicodeEncodeError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_UnicodeError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_UnicodeTranslateError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_ValueError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:971 -msgid "PyExc_ZeroDivisionError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:1154 -msgid "PyExc_EnvironmentError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:1154 -msgid "PyExc_IOError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:1154 -msgid "PyExc_WindowsError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:1191 -msgid "PyExc_Warning (C var)" +#: ../../c-api/exceptions.rst:1301 +msgid "" +"Type object for traceback objects. This is available " +"as :class:`types.TracebackType` in the Python layer." msgstr "" -#: ../../c-api/exceptions.rst:1191 -msgid "PyExc_BytesWarning (C var)" +#: ../../c-api/exceptions.rst:1307 +msgid "" +"Return true if *op* is a traceback object, false otherwise. This function " +"does not account for subtypes." msgstr "" -#: ../../c-api/exceptions.rst:1191 -msgid "PyExc_DeprecationWarning (C var)" +#: ../../c-api/exceptions.rst:1313 +msgid "" +"Replace the :attr:`~BaseException.__traceback__` attribute on the current " +"exception with a new traceback prepending *f* to the existing chain." msgstr "" -#: ../../c-api/exceptions.rst:1191 -msgid "PyExc_FutureWarning (C var)" +#: ../../c-api/exceptions.rst:1316 +msgid "Calling this function without an exception set is undefined behavior." msgstr "" -#: ../../c-api/exceptions.rst:1191 -msgid "PyExc_ImportWarning (C var)" +#: ../../c-api/exceptions.rst:1318 ../../c-api/exceptions.rst:1326 +msgid "" +"This function returns ``0`` on success, and returns ``-1`` with an exception " +"set on failure." msgstr "" +"Esta função retorna ``0`` em caso de sucesso e retorna ``-1`` com uma " +"exceção definida em caso de falha." -#: ../../c-api/exceptions.rst:1191 -msgid "PyExc_PendingDeprecationWarning (C var)" +#: ../../c-api/exceptions.rst:1324 +msgid "Write the traceback *tb* into the file *f*." msgstr "" -#: ../../c-api/exceptions.rst:1191 -msgid "PyExc_ResourceWarning (C var)" -msgstr "" +#: ../../c-api/exceptions.rst:198 +msgid "strerror (C function)" +msgstr "strerror (função C)" -#: ../../c-api/exceptions.rst:1191 -msgid "PyExc_RuntimeWarning (C var)" -msgstr "" +#: ../../c-api/exceptions.rst:688 ../../c-api/exceptions.rst:731 +#: ../../c-api/exceptions.rst:746 +msgid "module" +msgstr "módulo" -#: ../../c-api/exceptions.rst:1191 -msgid "PyExc_SyntaxWarning (C var)" -msgstr "" +#: ../../c-api/exceptions.rst:688 ../../c-api/exceptions.rst:731 +#: ../../c-api/exceptions.rst:746 +msgid "signal" +msgstr "signal" -#: ../../c-api/exceptions.rst:1191 -msgid "PyExc_UnicodeWarning (C var)" -msgstr "" +#: ../../c-api/exceptions.rst:688 ../../c-api/exceptions.rst:731 +msgid "SIGINT (C macro)" +msgstr "SIGINT (macro C)" -#: ../../c-api/exceptions.rst:1191 -msgid "PyExc_UserWarning (C var)" -msgstr "" +#: ../../c-api/exceptions.rst:688 ../../c-api/exceptions.rst:731 +#: ../../c-api/exceptions.rst:746 +msgid "KeyboardInterrupt (built-in exception)" +msgstr "KeyboardInterrupt (exceção embutida)" diff --git a/c-api/file.po b/c-api/file.po index 3120316c8..4905d363d 100644 --- a/c-api/file.po +++ b/c-api/file.po @@ -1,25 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 +# Rafael Fontenelle , 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-08-03 20:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -31,21 +32,22 @@ msgstr "Objetos arquivos" 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 " -"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 " -"C wrappers over these new APIs, and meant mostly for internal error " -"reporting in the interpreter; third-party code is advised to access the :mod:" -"`io` APIs instead." +"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 C wrappers over these new APIs, and meant mostly for internal " +"error reporting in the interpreter; third-party code is advised to access " +"the :mod:`io` APIs instead." msgstr "" "Essas APIs são uma emulação mínima da API C do Python 2 para objetos arquivo " -"embutidos, que costumavam depender do suporte de E/S em buffer (:c:expr:" -"`FILE*`) da biblioteca C padrão. No Python 3, arquivos e streams usam o novo " -"módulo :mod:`io`, que define várias camadas sobre a E/S sem buffer de baixo " -"nível do sistema operacional. As funções descritas a seguir são invólucros " -"de conveniência para o C sobre essas novas APIs e são destinadas " -"principalmente para relatórios de erros internos no interpretador; código de " -"terceiros é recomendado para acessar as APIs de :mod:`io`." +"embutidos, que costumavam depender do suporte de E/S em buffer " +"(:c:expr:`FILE*`) da biblioteca C padrão. No Python 3, arquivos e streams " +"usam o novo módulo :mod:`io`, que define várias camadas sobre a E/S sem " +"buffer de baixo nível do sistema operacional. As funções descritas a seguir " +"são invólucros de conveniência para o C sobre essas novas APIs e são " +"destinadas principalmente para relatórios de erros internos no " +"interpretador; código de terceiros é recomendado para acessar as APIs " +"de :mod:`io`." #: ../../c-api/file.rst:22 msgid "" @@ -80,34 +82,34 @@ msgstr "Ignora atributo *name*." #: ../../c-api/file.rst:41 msgid "" "Return the file descriptor associated with *p* as an :c:expr:`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." +"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 "" "Retorna o descritor de arquivo associado a *p* como um :c:expr:`int`. Se o " -"objeto for um inteiro, seu valor será retornado. Caso contrário, o método :" -"meth:`~io.IOBase.fileno` do objeto será chamado se existir; o método deve " -"retornar um inteiro, que é retornado como o valor do descritor de arquivo. " -"Define uma exceção e retorna ``-1`` em caso de falha." +"objeto for um inteiro, seu valor será retornado. Caso contrário, o " +"método :meth:`~io.IOBase.fileno` do objeto será chamado se existir; o método " +"deve retornar um inteiro, que é retornado como o valor do descritor de " +"arquivo. Define uma exceção e retorna ``-1`` em caso de falha." #: ../../c-api/file.rst:52 msgid "" "Equivalent to ``p.readline([n])``, this function reads one line from the " -"object *p*. *p* may be a file object or any object with a :meth:`~io.IOBase." -"readline` method. If *n* is ``0``, exactly one line is read, regardless of " -"the length of the line. If *n* is greater than ``0``, no more than *n* " -"bytes will be read from the file; a partial line can be returned. In both " -"cases, an empty string is returned if the end of the file is reached " -"immediately. If *n* is less than ``0``, however, one line is read " -"regardless of length, but :exc:`EOFError` is raised if the end of the file " -"is reached immediately." +"object *p*. *p* may be a file object or any object with " +"a :meth:`~io.IOBase.readline` method. If *n* is ``0``, exactly one line is " +"read, regardless of the length of the line. If *n* is greater than ``0``, " +"no more than *n* bytes will be read from the file; a partial line can be " +"returned. In both cases, an empty string is returned if the end of the file " +"is reached immediately. If *n* is less than ``0``, however, one line is " +"read regardless of length, but :exc:`EOFError` is raised if the end of the " +"file is reached immediately." msgstr "" "Equivalente a ``p.readline([n])``, esta função lê uma linha do objeto *p*. " -"*p* pode ser um objeto arquivo ou qualquer objeto com um método :meth:`~io." -"IOBase.readline`. Se *n* for ``0``, exatamente uma linha é lida, " -"independentemente do comprimento da linha. Se *n* for maior que ``0``, não " -"mais do que *n* bytes serão lidos do arquivo; uma linha parcial pode ser " +"*p* pode ser um objeto arquivo ou qualquer objeto com um " +"método :meth:`~io.IOBase.readline`. Se *n* for ``0``, exatamente uma linha é " +"lida, independentemente do comprimento da linha. Se *n* for maior que ``0``, " +"não mais do que *n* bytes serão lidos do arquivo; uma linha parcial pode ser " "retornada. Em ambos os casos, uma string vazia é retornada se o final do " "arquivo for alcançado imediatamente. Se *n* for menor que ``0``, entretanto, " "uma linha é lida independentemente do comprimento, mas :exc:`EOFError` é " @@ -176,19 +178,58 @@ msgstr "" "Levanta um :ref:`evento de auditoria` ``setopencodehook`` sem " "argumentos." -#: ../../c-api/file.rst:101 +#: ../../c-api/file.rst:98 +msgid "" +"Open *path* with the mode ``'rb'``. *path* must be a Python :class:`str` " +"object. The behavior of this function may be overridden " +"by :c:func:`PyFile_SetOpenCodeHook` to allow for some preprocessing of the " +"text." +msgstr "" +"Abre o arquivo *path* com o modo ``'rb'``. *path* deve ser um objeto Python " +"da classe :class:`str`. O comportamento desta função pode ser substituído " +"por :c:func:`PyFile_SetOpenCodeHook` para permitir algum pré-processamento " +"do texto." + +#: ../../c-api/file.rst:103 +msgid "This is analogous to :func:`io.open_code` in Python." +msgstr "Isso é análogo a :func:`io.open_code` no Python." + +#: ../../c-api/file.rst:105 +msgid "" +"On success, this function returns a :term:`strong reference` to a Python " +"file object. On failure, this function returns ``NULL`` with an exception " +"set." +msgstr "" +"Em caso de sucesso, esta função retorna uma :term:`referência forte` a um " +"objeto arquivo Python. Em caso de falha, esta função retorna ``NULL`` com " +"uma exceção definida." + +#: ../../c-api/file.rst:114 +msgid "" +"Similar to :c:func:`PyFile_OpenCodeObject`, but *path* is a UTF-8 " +"encoded :c:expr:`const char*`." +msgstr "" +"Semelhante a :c:func:`PyFile_OpenCodeObject`, mas *path* é um :c:expr:`const " +"char*` codificado em UTF-8." + +#: ../../c-api/file.rst:124 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." +"written instead of the :func:`repr`." +msgstr "" + +#: ../../c-api/file.rst:128 +msgid "If *obj* is ``NULL``, write the string ``\"\"``." +msgstr "" + +#: ../../c-api/file.rst:130 +msgid "" +"Return ``0`` on success or ``-1`` on failure; the appropriate exception will " +"be set." msgstr "" -"Escreve o objeto *obj* no objeto arquivo *p*. O único sinalizador suportado " -"para *flags* é :c:macro:`Py_PRINT_RAW`; se fornecido, o :func:`str` do " -"objeto é escrito em vez de :func:`repr`. Retorna ``0`` em caso de sucesso ou " -"``-1`` em caso de falha; a exceção apropriada será definida." -#: ../../c-api/file.rst:109 +#: ../../c-api/file.rst:135 msgid "" "Write string *s* to file object *p*. Return ``0`` on success or ``-1`` on " "failure; the appropriate exception will be set." @@ -208,6 +249,6 @@ msgstr "arquivo" msgid "EOFError (built-in exception)" msgstr "EOFError (exceção embutida)" -#: ../../c-api/file.rst:99 +#: ../../c-api/file.rst:122 msgid "Py_PRINT_RAW (C macro)" msgstr "Py_PRINT_RAW (macro C)" diff --git a/c-api/float.po b/c-api/float.po index 8ec9d225f..bc40afe5d 100644 --- a/c-api/float.po +++ b/c-api/float.po @@ -1,26 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Adorilson Bezerra , 2024 -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 +# Rafael Fontenelle , 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-08-03 20:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -46,11 +46,11 @@ msgstr "" #: ../../c-api/float.rst:24 msgid "" -"Return true if its argument is a :c:type:`PyFloatObject` or a subtype of :c:" -"type:`PyFloatObject`. This function always succeeds." +"Return true if its argument is a :c:type:`PyFloatObject` or a subtype " +"of :c:type:`PyFloatObject`. This function always succeeds." msgstr "" -"Retorna true se seu argumento é um :c:type:`PyFloatObject` ou um subtipo de :" -"c:type:`PyFloatObject`. Esta função sempre tem sucesso." +"Retorna true se seu argumento é um :c:type:`PyFloatObject` ou um subtipo " +"de :c:type:`PyFloatObject`. Esta função sempre tem sucesso." #: ../../c-api/float.rst:30 msgid "" @@ -76,18 +76,19 @@ msgstr "Cria um objeto :c:type:`PyFloatObject` de *v* ou ``NULL`` em falha." #: ../../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." +"*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 "" "Retorna uma representação C :c:expr:`double` do conteúdo de *pyfloat*. Se " -"*pyfloat* não é um objeto de ponto flutuante do Python, mas possui o método :" -"meth:`~object.__float__`, esse método será chamado primeiro para converter " -"*pyfloat* em um ponto flutuante. Se :meth:`!__float__` não estiver definido, " -"será usado :meth:`__index__`. Este método retorna ``-1.0`` em caso de falha, " -"portanto, deve-se chamar :c:func:`PyErr_Occurred` para verificar se há erros." +"*pyfloat* não é um objeto de ponto flutuante do Python, mas possui o " +"método :meth:`~object.__float__`, esse método será chamado primeiro para " +"converter *pyfloat* em um ponto flutuante. Se :meth:`!__float__` não estiver " +"definido, será usado :meth:`~object.__index__`. Este método retorna ``-1.0`` " +"em caso de falha, portanto, deve-se chamar :c:func:`PyErr_Occurred` para " +"verificar se há erros." #: ../../c-api/float.rst:54 msgid "Use :meth:`~object.__index__` if available." @@ -113,33 +114,181 @@ msgstr "" #: ../../c-api/float.rst:73 msgid "" -"Return the maximum representable finite float *DBL_MAX* as C :c:expr:" -"`double`." +"Return the maximum representable finite float *DBL_MAX* as " +"C :c:expr:`double`." msgstr "" -"Retorna o ponto flutuante finito máximo representável *DBL_MAX* como :c:expr:" -"`double` do C." +"Retorna o ponto flutuante finito máximo representável *DBL_MAX* " +"como :c:expr:`double` do C." #: ../../c-api/float.rst:78 msgid "" "Return the minimum normalized positive float *DBL_MIN* as C :c:expr:`double`." msgstr "" -"Retorna o ponto flutuante positivo mínimo normalizado *DBL_MIN* como :c:expr:" -"`double` do C." +"Retorna o ponto flutuante positivo mínimo normalizado *DBL_MIN* " +"como :c:expr:`double` do C." -#: ../../c-api/float.rst:82 -msgid "Pack and Unpack functions" +#: ../../c-api/float.rst:83 +msgid "" +"This macro expands to a constant expression of type :c:expr:`double`, that " +"represents the positive infinity." +msgstr "" + +#: ../../c-api/float.rst:86 +msgid "" +"On most platforms, this is equivalent to the :c:macro:`!INFINITY` macro from " +"the C11 standard ```` header." +msgstr "" +"Na maioria das plataformas, isso equivale à macro :c:macro:`!INFINITY` do " +"cabeçalho ```` do padrão C11." + +#: ../../c-api/float.rst:92 +msgid "" +"This macro expands to a constant expression of type :c:expr:`double`, that " +"represents a quiet not-a-number (qNaN) value." +msgstr "" + +#: ../../c-api/float.rst:95 +msgid "" +"On most platforms, this is equivalent to the :c:macro:`!NAN` macro from the " +"C11 standard ```` header." +msgstr "" +"Na maioria das plataformas, isso equivale à macro :c:macro:`!NAN` do " +"cabeçalho ```` do padrão C11." + +#: ../../c-api/float.rst:101 +msgid "Equivalent to :c:macro:`!INFINITY`." +msgstr "Equivalente a :c:macro:`!INFINITY`." + +#: ../../c-api/float.rst:103 +msgid "The macro is :term:`soft deprecated`." +msgstr "" +"A macro está :term:`suavemente descontinuada `." + +#: ../../c-api/float.rst:109 +msgid "" +"The definition (accurate for a :c:expr:`double` type) of the :data:`math.e` " +"constant." +msgstr "" +"A definição (precisa para um tipo :c:expr:`double`) da " +"constante :data:`math.e`." + +#: ../../c-api/float.rst:114 +msgid "High precision (long double) definition of :data:`~math.e` constant." +msgstr "Definição de alta precisão (long double) da constante :data:`~math.e`." + +#: ../../c-api/float.rst:119 +msgid "" +"The definition (accurate for a :c:expr:`double` type) of the :data:`math.pi` " +"constant." +msgstr "" +"A definição (precisa para um tipo :c:expr:`double`) da " +"constante :data:`math.pi`." + +#: ../../c-api/float.rst:124 +msgid "High precision (long double) definition of :data:`~math.pi` constant." +msgstr "" +"Definição de alta precisão (long double) da constante :data:`~math.pi`." + +#: ../../c-api/float.rst:129 +msgid "" +"The definition (accurate for a :c:expr:`double` type) of " +"the :data:`math.tau` constant." +msgstr "" +"A definição (precisa para um tipo :c:expr:`double`) da " +"constante :data:`math.tau`." + +#: ../../c-api/float.rst:136 +msgid "Return :data:`math.nan` from a function." +msgstr "Retorna :data:`math.nan` de uma função." + +#: ../../c-api/float.rst:138 +msgid "" +"On most platforms, this is equivalent to ``return PyFloat_FromDouble(NAN)``." +msgstr "" +"Na maioria das plataformas, isso equivale a ``return " +"PyFloat_FromDouble(NAN)``." + +#: ../../c-api/float.rst:143 +msgid "" +"Return :data:`math.inf` or :data:`-math.inf ` from a function, " +"depending on the sign of *sign*." +msgstr "" +"Retorna :data:`math.inf` ou :data:`-math.inf ` de uma função, " +"dependendo do sinal de *sign*." + +#: ../../c-api/float.rst:146 +msgid "On most platforms, this is equivalent to the following::" +msgstr "Na maioria das plataformas, isso equivale ao seguinte::" + +#: ../../c-api/float.rst:148 +msgid "return PyFloat_FromDouble(copysign(INFINITY, sign));" +msgstr "return PyFloat_FromDouble(copysign(INFINITY, sign));" + +#: ../../c-api/float.rst:153 +msgid "" +"Return ``1`` if the given floating-point number *X* is finite, that is, it " +"is normal, subnormal or zero, but not infinite or NaN. Return ``0`` " +"otherwise." +msgstr "" +"Retorna ``1`` se o número de ponto flutuante *X* fornecido for finito, ou " +"seja, for normal, subnormal ou zero, mas não infinito ou NaN. Caso " +"contrário, retorna ``0``." + +#: ../../c-api/float.rst:157 +msgid "" +"The macro is :term:`soft deprecated`. Use :c:macro:`!isfinite` instead." +msgstr "" +"A macro está :term:`suavemente descontinuada `. " +"Use :c:macro:`!isfinite` em vez disso." + +#: ../../c-api/float.rst:163 +msgid "" +"Return ``1`` if the given floating-point number *X* is positive or negative " +"infinity. Return ``0`` otherwise." +msgstr "" +"Retorna ``1`` se o número de ponto flutuante *X* fornecido for infinito " +"positivo ou negativo. Caso contrário, retorna ``0``." + +#: ../../c-api/float.rst:166 +msgid "The macro is :term:`soft deprecated`. Use :c:macro:`!isinf` instead." +msgstr "" +"A macro está :term:`suavemente descontinuada `. " +"Use :c:macro:`!isinf` em vez disso." + +#: ../../c-api/float.rst:172 +msgid "" +"Return ``1`` if the given floating-point number *X* is a not-a-number (NaN) " +"value. Return ``0`` otherwise." msgstr "" +"Retorna ``1`` se o número de ponto flutuante fornecido *X* for um valor não " +"numérico (NaN). Caso contrário, retorna ``0``." -#: ../../c-api/float.rst:84 +#: ../../c-api/float.rst:175 +msgid "The macro is :term:`soft deprecated`. Use :c:macro:`!isnan` instead." +msgstr "" +"A macro está :term:`suavemente descontinuada `. " +"Use :c:macro:`!isnan` em vez disso." + +#: ../../c-api/float.rst:180 +msgid "Pack and Unpack functions" +msgstr "As funções Pack e Unpack" + +#: ../../c-api/float.rst:182 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." +"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 +"As funções de empacotamento e desempacotamento, pack e unpack " +"respectivamente, fornecem uma maneira eficiente e independente de plataforma " +"de armazenar valores de ponto flutuante como strings de bytes. As rotinas de " +"Pack produzem uma string de bytes a partir de um C :c:expr:`double`, e as " +"rotinas de Unpack produzem um C :c:expr:`double` a partir dessa string de " +"bytes. O sufixo (2, 4 ou 8) especifica o número de bytes na string de bytes." + +#: ../../c-api/float.rst:188 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 " @@ -150,97 +299,138 @@ msgid "" "attempting to unpack a bytes string containing an IEEE INF or NaN will raise " "an exception." msgstr "" - -#: ../../c-api/float.rst:99 +"Em plataformas que parecem usar o formato IEEE 754, essas funções funcionam " +"copiando bits. Em outras plataformas, o formato de 2 bytes é idêntico ao " +"formato de meia precisão binário 16 do IEEE 754, o formato de 4 bytes (32 " +"bits) é idêntico ao formato de precisão simples binário 32 do IEEE 754 e o " +"formato de 8 bytes ao formato de precisão dupla binário 64 do IEEE 754, " +"embora o empacotamento de INFs e NaNs (se tais recursos existirem na " +"plataforma) não seja tratado corretamente, e tentar desempacotar uma string " +"de bytes contendo um INF ou NaN do IEEE levantará uma exceção." + +#: ../../c-api/float.rst:197 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 "" +"Em plataformas que não aderem IEEE com maior precisão ou maior alcance " +"dinâmico do que o suportado pelo IEEE 754, nem todos os valores podem ser " +"empacotados; em plataformas que não aderem IEEE com menor precisão ou menor " +"alcance dinâmico, nem todos os valores podem ser desempacotados. O que " +"acontece nesses casos é em parte acidental (infelizmente)." -#: ../../c-api/float.rst:107 +#: ../../c-api/float.rst:205 msgid "Pack functions" -msgstr "" +msgstr "Funções Pack" -#: ../../c-api/float.rst:109 +#: ../../c-api/float.rst:207 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." +"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:116 +"As rotinas de empacotamento gravam 2, 4 ou 8 bytes, começando em *p*. *le* é " +"um argumento :c:expr:`int`, diferente de zero se você quiser a sequência de " +"bytes no formato little-endian (expoente por último, em ``p+1``, ``p+3`` ou " +"``p+6`` ``p+7``), zero se você quiser o formato big-endian (expoente " +"primeiro, em *p*). A constante :c:macro:`PY_BIG_ENDIAN` pode ser usada para " +"usar o endian nativo: é igual a ``1`` em processadores big-endian ou ``0`` " +"em processadores little-endian." + +#: ../../c-api/float.rst:214 msgid "" "Return value: ``0`` if all is OK, ``-1`` if error (and an exception is set, " "most likely :exc:`OverflowError`)." msgstr "" +"Valor de retorno: ``0`` se tudo estiver OK, ``-1`` se houver erro (e uma " +"exceção for definida, provavelmente :exc:`OverflowError`)." -#: ../../c-api/float.rst:119 +#: ../../c-api/float.rst:217 msgid "There are two problems on non-IEEE platforms:" -msgstr "" +msgstr "Existem dois problemas em plataformas não IEEE:" -#: ../../c-api/float.rst:121 +#: ../../c-api/float.rst:219 msgid "What this does is undefined if *x* is a NaN or infinity." -msgstr "" +msgstr "O que isso faz é indefinido se *x* é um NaN ou infinito." -#: ../../c-api/float.rst:122 +#: ../../c-api/float.rst:220 msgid "``-0.0`` and ``+0.0`` produce the same bytes string." -msgstr "" +msgstr "``-0.0`` e ``+0.0`` produzem a mesma sequência de bytes." -#: ../../c-api/float.rst:126 +#: ../../c-api/float.rst:224 msgid "Pack a C double as the IEEE 754 binary16 half-precision format." msgstr "" +"Empacota um C duplo como o formato de meia precisão binário16 IEEE 754." -#: ../../c-api/float.rst:130 +#: ../../c-api/float.rst:228 msgid "Pack a C double as the IEEE 754 binary32 single precision format." msgstr "" +"Empacota um C duplo como o formato de precisão simples binário32 IEEE 754." -#: ../../c-api/float.rst:134 +#: ../../c-api/float.rst:232 msgid "Pack a C double as the IEEE 754 binary64 double precision format." msgstr "" +"Empacota um C duplo como o formato de precisão dupla binária 64 IEEE 754." -#: ../../c-api/float.rst:138 +#: ../../c-api/float.rst:236 msgid "Unpack functions" -msgstr "" +msgstr "Funções de Unpack" -#: ../../c-api/float.rst:140 +#: ../../c-api/float.rst:238 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 " +"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:147 +"As rotinas de desempacotamento leem 2, 4 ou 8 bytes, começando em *p*. *le* " +"é um argumento :c:expr:`int`, diferente de zero se a sequência de bytes " +"estiver no formato little-endian (expoente por último, em ``p+1``, ``p+3`` " +"ou ``p+6`` e ``p+7``), zero se big-endian (expoente primeiro, em *p*). A " +"constante :c:macro:`PY_BIG_ENDIAN` pode ser usada para usar o endian nativo: " +"é igual a ``1`` em processadores big-endian ou ``0`` em processadores little-" +"endian." + +#: ../../c-api/float.rst:245 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`)." +"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 "" +"Valor de retorno: O double descompactado. Em caso de erro, é ``-1.0`` " +"e :c:func:`PyErr_Occurred` é verdadeiro (e uma exceção é definida, " +"provavelmente :exc:`OverflowError`)." -#: ../../c-api/float.rst:151 +#: ../../c-api/float.rst:249 msgid "" "Note that on a non-IEEE platform this will refuse to unpack a bytes string " "that represents a NaN or infinity." msgstr "" +"Observe que em uma plataforma que não adere IEEE isso se recusará a " +"descompactar uma sequência de bytes que representa um NaN ou infinito." -#: ../../c-api/float.rst:156 +#: ../../c-api/float.rst:254 msgid "Unpack the IEEE 754 binary16 half-precision format as a C double." msgstr "" +"Descompacta o formato de meia precisão IEEE 754 binary16 como um double C." -#: ../../c-api/float.rst:160 +#: ../../c-api/float.rst:258 msgid "Unpack the IEEE 754 binary32 single precision format as a C double." msgstr "" +"Descompacta o formato IEEE 754 binary32 de precisão simples como um C double." -#: ../../c-api/float.rst:164 +#: ../../c-api/float.rst:262 msgid "Unpack the IEEE 754 binary64 double precision format as a C double." msgstr "" +"Descompacta o formato IEEE 754 binary64 de precisão dupla como um C double." #: ../../c-api/float.rst:8 msgid "object" diff --git a/c-api/frame.po b/c-api/frame.po index 60ca00632..ceef98633 100644 --- a/c-api/frame.po +++ b/c-api/frame.po @@ -1,33 +1,32 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Ruan Aragão , 2022 -# Flávio Neves, 2023 -# Rafael Fontenelle , 2023 +# python-doc bot, 2026 +# Rafael Fontenelle , 2026 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-24 14:15+0000\n" -"PO-Revision-Date: 2022-11-05 19:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2026-10-19 21:31+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2026\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../c-api/frame.rst:4 -msgid "Frame Objects" -msgstr "Objetos Frame" +msgid "Frame objects" +msgstr "Objetos quadro" #: ../../c-api/frame.rst:8 msgid "The C structure of the objects used to describe frame objects." @@ -42,8 +41,8 @@ msgid "" "The members of this structure were removed from the public C API. Refer to " "the :ref:`What's New entry ` for details." msgstr "" -"Os membros dessa estrutura foram removidos da API C pública. Consulte a :ref:" -"`entrada O Que há de Novo ` para detalhes." +"Os membros dessa estrutura foram removidos da API C pública. Consulte " +"a :ref:`entrada O Que há de Novo ` para detalhes." #: ../../c-api/frame.rst:17 msgid "" @@ -59,8 +58,8 @@ msgstr "Veja também :ref:`Reflexão `." #: ../../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." +"The type of frame objects. It is the same object " +"as :py:class:`types.FrameType` in the Python layer." msgstr "" "O tipo de objetos frame. É o mesmo objeto que :py:class:`types.FrameType` na " "camada Python." @@ -69,54 +68,63 @@ msgstr "" msgid "" "Previously, this type was only available after including ````." msgstr "" -"Anteriormente, este tipo só estava disponível após incluir ````." +"Anteriormente, este tipo só estava disponível após incluir " +"````." #: ../../c-api/frame.rst:34 +msgid "" +"Create a new frame object. This function returns a :term:`strong reference` " +"to the new frame object on success, and returns ``NULL`` with an exception " +"set on failure." +msgstr "" +"Cria um novo objeto quadro. Esta função retorna uma :term:`referência forte` " +"ao novo objeto quadro em caso de sucesso e retorna ``NULL`` com uma exceção " +"definida em caso de falha." + +#: ../../c-api/frame.rst:40 msgid "Return non-zero if *obj* is a frame object." msgstr "Retorna diferente de zero se *obj* é um objeto frame" -#: ../../c-api/frame.rst:38 +#: ../../c-api/frame.rst:44 msgid "" -"Previously, this function was only available after including ````." +"Previously, this function was only available after including " +"````." msgstr "" -"Anteriormente, esta função só estava disponível após incluir ````." +"Anteriormente, esta função só estava disponível após incluir " +"````." -#: ../../c-api/frame.rst:43 +#: ../../c-api/frame.rst:49 msgid "Get the *frame* next outer frame." msgstr "Obtém o *frame* próximo ao quadro externo." -#: ../../c-api/frame.rst:45 +#: ../../c-api/frame.rst:51 msgid "" -"Return a :term:`strong reference`, or ``NULL`` if *frame* has no outer frame." +"Return a :term:`strong reference`, or ``NULL`` if *frame* has no outer " +"frame. This raises no exceptions." msgstr "" -"Retorna uma :term:`referência forte` ou ``NULL`` se *frame* não tiver quadro " -"externo." -#: ../../c-api/frame.rst:53 +#: ../../c-api/frame.rst:60 msgid "Get the *frame*'s :attr:`~frame.f_builtins` attribute." -msgstr "" +msgstr "Obtém o atributo :attr:`~frame.f_builtins` do *frame*." -#: ../../c-api/frame.rst:55 ../../c-api/frame.rst:86 +#: ../../c-api/frame.rst:62 ../../c-api/frame.rst:93 msgid "Return a :term:`strong reference`. The result cannot be ``NULL``." msgstr "" "Retorna uma :term:`referência forte`. O resultado não pode ser ``NULL``." -#: ../../c-api/frame.rst:62 +#: ../../c-api/frame.rst:69 msgid "Get the *frame* code." msgstr "Obtém o código de *frame*." -#: ../../c-api/frame.rst:64 ../../c-api/frame.rst:130 +#: ../../c-api/frame.rst:71 ../../c-api/frame.rst:137 msgid "Return a :term:`strong reference`." msgstr "Retorna uma :term:`referência forte`." -#: ../../c-api/frame.rst:66 +#: ../../c-api/frame.rst:73 msgid "The result (frame code) cannot be ``NULL``." msgstr "O resultado (código do frame) não pode ser ``NULL``." -#: ../../c-api/frame.rst:73 +#: ../../c-api/frame.rst:80 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 " @@ -126,87 +134,218 @@ msgstr "" "``NULL`` se o frame não pertence a um gerador. Não levanta exceção, mesmo " "que o valor retornado seja ``NULL``." -#: ../../c-api/frame.rst:77 +#: ../../c-api/frame.rst:84 msgid "Return a :term:`strong reference`, or ``NULL``." msgstr "Retorna uma :term:`referência forte`, ou ``NULL``." -#: ../../c-api/frame.rst:84 +#: ../../c-api/frame.rst:91 msgid "Get the *frame*'s :attr:`~frame.f_globals` attribute." -msgstr "" +msgstr "Obtenha o atributo :attr:`~frame.f_globals` do *frame*." -#: ../../c-api/frame.rst:93 +#: ../../c-api/frame.rst:100 msgid "Get the *frame*'s :attr:`~frame.f_lasti` attribute." -msgstr "" +msgstr "Obtenha o atributo :attr:`~frame.f_lasti` do *frame*." -#: ../../c-api/frame.rst:95 +#: ../../c-api/frame.rst:102 msgid "Returns -1 if ``frame.f_lasti`` is ``None``." msgstr "Retorna -1 se ``frame.f_lasti`` é ``None``." -#: ../../c-api/frame.rst:102 +#: ../../c-api/frame.rst:109 msgid "Get the variable *name* of *frame*." -msgstr "" +msgstr "Obtém a variável *name* de *frame*." -#: ../../c-api/frame.rst:104 +#: ../../c-api/frame.rst:111 msgid "Return a :term:`strong reference` to the variable value on success." msgstr "" +"Retorna uma :term:`referência forte` ao valor da variável em caso de sucesso." -#: ../../c-api/frame.rst:105 +#: ../../c-api/frame.rst:112 msgid "" "Raise :exc:`NameError` and return ``NULL`` if the variable does not exist." msgstr "" +"Levanta uma exceção :exc:`NameError` e retorna ``NULL`` se a variável não " +"existir." -#: ../../c-api/frame.rst:106 +#: ../../c-api/frame.rst:113 msgid "Raise an exception and return ``NULL`` on error." -msgstr "" +msgstr "Levanta uma exceção e retorna ``NULL`` em caso de erro." -#: ../../c-api/frame.rst:108 +#: ../../c-api/frame.rst:115 msgid "*name* type must be a :class:`str`." -msgstr "" +msgstr "Tipo de *name* deve ser um :class:`str`." -#: ../../c-api/frame.rst:115 +#: ../../c-api/frame.rst:122 msgid "" "Similar to :c:func:`PyFrame_GetVar`, but the variable name is a C string " "encoded in UTF-8." msgstr "" +"Semelhante a :c:func:`PyFrame_GetVar`, mas o nome da variável é uma string C " +"codificada em UTF-8." -#: ../../c-api/frame.rst:123 +#: ../../c-api/frame.rst:130 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`)." +"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 a proxy object for optimized scopes." +"Obtém o atributo :attr:`~frame.f_locals` do *frame*. Se o quadro se referir " +"a um :term:`escopo otimizado`, isso retorna um objeto proxy de escrita " +"direta que permite modificar as variáveis locais. Em todos os outros casos " +"(classes, módulos, :func:`exec` e :func:`eval`), retorna o mapeamento que " +"representa as variáveis locais do frame diretamente (como descrito " +"para :func:`locals`)." + +#: ../../c-api/frame.rst:141 +msgid "" +"As part of :pep:`667`, return an instance " +"of :c:var:`PyFrameLocalsProxy_Type`." msgstr "" +"Como parte de :pep:`667`, retorna uma instância " +"de :c:var:`PyFrameLocalsProxy_Type`." -#: ../../c-api/frame.rst:140 +#: ../../c-api/frame.rst:147 msgid "Return the line number that *frame* is currently executing." msgstr "Retorna o número da linha do *frame* atualmente em execução." -#: ../../c-api/frame.rst:145 -msgid "Internal Frames" +#: ../../c-api/frame.rst:151 +msgid "Frame locals proxies" msgstr "" -#: ../../c-api/frame.rst:147 +#: ../../c-api/frame.rst:155 +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:161 +msgid "See :pep:`667` for more information." +msgstr "" + +#: ../../c-api/frame.rst:165 +msgid "The type of frame :func:`locals` proxy objects." +msgstr "" + +#: ../../c-api/frame.rst:169 +msgid "Return non-zero if *obj* is a frame :func:`locals` proxy." +msgstr "" + +#: ../../c-api/frame.rst:173 +msgid "Legacy local variable APIs" +msgstr "" + +#: ../../c-api/frame.rst:175 +msgid "" +"These APIs are :term:`soft deprecated`. As of Python 3.13, they do nothing. " +"They exist solely for backwards compatibility." +msgstr "" + +#: ../../c-api/frame.rst:181 +msgid "" +"Prior to Python 3.13, this function would copy the :attr:`~frame.f_locals` " +"attribute of *f* to the internal \"fast\" array of local variables, allowing " +"changes in frame objects to be visible to the interpreter. If *clear* was " +"true, this function would process variables that were unset in the locals " +"dictionary." +msgstr "" + +#: ../../c-api/frame.rst:187 ../../c-api/frame.rst:198 +#: ../../c-api/frame.rst:208 +msgid "This function now does nothing." +msgstr "Esta função agora não faz nada." + +#: ../../c-api/frame.rst:193 +msgid "" +"Prior to Python 3.13, this function would copy the internal \"fast\" array " +"of local variables (which is used by the interpreter) to " +"the :attr:`~frame.f_locals` attribute of *f*, allowing changes in local " +"variables to be visible to frame objects." +msgstr "" + +#: ../../c-api/frame.rst:204 +msgid "" +"Prior to Python 3.13, this function was similar " +"to :c:func:`PyFrame_FastToLocals`, but would return ``0`` on success, and " +"``-1`` with an exception set on failure." +msgstr "" + +#: ../../c-api/frame.rst:213 +msgid ":pep:`667`" +msgstr ":pep:`667`" + +#: ../../c-api/frame.rst:217 +msgid "Internal frames" +msgstr "" + +#: ../../c-api/frame.rst:219 msgid "Unless using :pep:`523`, you will not need this." msgstr "" -#: ../../c-api/frame.rst:151 +#: ../../c-api/frame.rst:223 msgid "The interpreter's internal frame representation." msgstr "" -#: ../../c-api/frame.rst:157 +#: ../../c-api/frame.rst:229 msgid "Return a :term:`strong reference` to the code object for the frame." msgstr "" -#: ../../c-api/frame.rst:164 +#: ../../c-api/frame.rst:236 msgid "Return the byte offset into the last executed instruction." msgstr "" -#: ../../c-api/frame.rst:171 +#: ../../c-api/frame.rst:243 msgid "" "Return the currently executing line number, or -1 if there is no line number." msgstr "" + +#: ../../c-api/frame.rst:250 +msgid "" +"An array of executable kinds (executor types) for frames, used for internal " +"debugging and tracing." +msgstr "" + +#: ../../c-api/frame.rst:253 +msgid "" +"Tools like debuggers and profilers can use this to identify the type of " +"execution context associated with a frame (such as to filter out internal " +"frames). The entries are indexed by the following constants:" +msgstr "" + +#: ../../c-api/frame.rst:261 +msgid "Constant" +msgstr "Constante" + +#: ../../c-api/frame.rst:262 +msgid "Description" +msgstr "Descrição" + +#: ../../c-api/frame.rst:264 +msgid "" +"The frame is internal (For example: inlined) and should be skipped by tools." +msgstr "" + +#: ../../c-api/frame.rst:266 +msgid "The frame corresponds to a standard Python function." +msgstr "" + +#: ../../c-api/frame.rst:268 +msgid "The frame corresponds to a function defined in native code." +msgstr "" + +#: ../../c-api/frame.rst:270 +msgid "The frame corresponds to a method on a class instance." +msgstr "" + +#: ../../c-api/frame.rst:272 +msgid "" +"Note that reading the executable kind from a frame is currently only " +"possible with undocumented internal APIs." +msgstr "" + +#: ../../c-api/frame.rst:280 +msgid "The number of entries in :c:data:`PyUnstable_ExecutableKinds`." +msgstr "" diff --git a/c-api/function.po b/c-api/function.po index 1280ab1f9..9922dc590 100644 --- a/c-api/function.po +++ b/c-api/function.po @@ -1,32 +1,32 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Italo Penaforte , 2021 -# Rafael Fontenelle , 2023 +# python-doc bot, 2025 +# Rafael Fontenelle , 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-24 14:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../c-api/function.rst:6 msgid "Function Objects" -msgstr "Objetos Função" +msgstr "Objetos Function" #: ../../c-api/function.rst:10 msgid "There are a few functions specific to Python functions." @@ -39,21 +39,21 @@ msgstr "A estrutura C usada para funções." #: ../../c-api/function.rst:22 msgid "" "This is an instance of :c:type:`PyTypeObject` and represents the Python " -"function type. It is exposed to Python programmers as ``types." -"FunctionType``." +"function type. It is exposed to Python programmers as " +"``types.FunctionType``." msgstr "" "Esta é uma instância de :c:type:`PyTypeObject` e representa o tipo de função " -"Python. Está exposto aos programadores Python como ``types.FunctionType``." +"Python. Está exposta a programadores Python como ``types.FunctionType``." #: ../../c-api/function.rst:28 msgid "" -"Return true if *o* is a function object (has type :c:data:" -"`PyFunction_Type`). The parameter must not be ``NULL``. This function " -"always succeeds." +"Return true if *o* is a function object (has " +"type :c:data:`PyFunction_Type`). The parameter must not be ``NULL``. This " +"function always succeeds." msgstr "" -"Retorna verdadeiro se *o* é um objeto de função (tem tipo :c:data:" -"`PyFunction_Type`). O parâmetro não deve ser ``NULL``. Esta função sempre " -"tem sucesso." +"Retorna verdadeiro se *o* for um objeto função (tem " +"tipo :c:data:`PyFunction_Type`). O parâmetro não deve ser ``NULL``. Esta " +"função sempre obtém sucesso." #: ../../c-api/function.rst:34 msgid "" @@ -61,29 +61,40 @@ msgid "" "*globals* must be a dictionary with the global variables accessible to the " "function." msgstr "" -"Retorna um novo objeto função associado ao código objeto *code*. *globals* " +"Retorna um novo objeto função associado ao objeto código *code*. *globals* " "deve ser um dicionário com as variáveis globais acessíveis à função." #: ../../c-api/function.rst:37 msgid "" -"The function's docstring and name are retrieved from the code object. :attr:" -"`~function.__module__` is retrieved from *globals*. The argument defaults, " -"annotations and closure are set to ``NULL``. :attr:`~function.__qualname__` " -"is set to the same value as the code object's :attr:`~codeobject." -"co_qualname` field." +"The function's docstring and name are retrieved from the code " +"object. :attr:`~function.__module__` is retrieved from *globals*. The " +"argument defaults, annotations and closure are set to " +"``NULL``. :attr:`~function.__qualname__` is set to the same value as the " +"code object's :attr:`~codeobject.co_qualname` field." msgstr "" +"O nome e *docstring* da função são adquiridos pelo objeto código. O " +"atributo :attr:`~function.__module__` é adquirido por meio de *globals*. Os " +"valores-padrão de argumentos, anotações, e fechamento são definidos como " +"``NULL``. O atributo :attr:`~function.__qualname__` é definido com o mesmo " +"valor do campo :attr:`~codeobject.co_qualname` de um objeto código." #: ../../c-api/function.rst:46 msgid "" -"As :c:func:`PyFunction_New`, but also allows setting the function object's :" -"attr:`~function.__qualname__` attribute. *qualname* should be a unicode " -"object or ``NULL``; if ``NULL``, the :attr:`!__qualname__` attribute is set " -"to the same value as the code object's :attr:`~codeobject.co_qualname` field." +"As :c:func:`PyFunction_New`, but also allows setting the function " +"object's :attr:`~function.__qualname__` attribute. *qualname* should be a " +"unicode object or ``NULL``; if ``NULL``, the :attr:`!__qualname__` attribute " +"is set to the same value as the code " +"object's :attr:`~codeobject.co_qualname` field." msgstr "" +"Similar a :c:func:`PyFunction_New`, mas também permite definir o " +"atributo :attr:`~function.__qualname__` do objeto função. *qualname* deve " +"ser um objeto Unicode ou ``NULL``. Se ``NULL``, o atributo :attr:`!" +"__qualname__` é definido com o mesmo valor do " +"campo :attr:`~codeobject.co_qualname` do objeto código." #: ../../c-api/function.rst:57 msgid "Return the code object associated with the function object *op*." -msgstr "Retorna o objeto de código associado ao objeto função *op*." +msgstr "Retorna o objeto código associado ao objeto função *op*." #: ../../c-api/function.rst:62 msgid "Return the globals dictionary associated with the function object *op*." @@ -95,53 +106,85 @@ msgid "" "attribute of the :ref:`function object ` *op*. It can be " "*NULL*." msgstr "" +"Retorna uma :term:`referência emprestada` ao " +"atributo :attr:`~function.__module__` do :ref:`objeto função ` *op*. Pode ser `NULL`." #: ../../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 "" +"Normalmente, trata-se de um :class:`string ` contendo o nome do módulo, " +"mas pode ser definido como qualquer outro objeto pelo código Python." #: ../../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 "" -"Retorna o argumento os valores padrão do objeto função *op*. Isso pode ser " -"uma tupla de argumentos ou ``NULL``." +"Retorna os valores-padrão de argumentos do objeto função *op*. Pode ser uma " +"tupla de argumentos ou ``NULL``." #: ../../c-api/function.rst:83 msgid "" "Set the argument default values for the function object *op*. *defaults* " "must be ``Py_None`` or a tuple." msgstr "" -"Define o argumento valores padrão para o objeto função *op*. *defaults* deve " -"ser ``Py_None`` ou uma tupla." +"Define os valores-padrão dos argumentos do objeto função *op*. *defaults* " +"deve ser ``Py_None`` ou uma tupla." -#: ../../c-api/function.rst:86 ../../c-api/function.rst:109 -#: ../../c-api/function.rst:123 +#: ../../c-api/function.rst:86 ../../c-api/function.rst:125 +#: ../../c-api/function.rst:139 msgid "Raises :exc:`SystemError` and returns ``-1`` on failure." -msgstr "Levanta :exc:`SystemError` e retorna ``-1`` em falha." +msgstr "Levanta :exc:`SystemError` e retorna ``-1`` em caso de falha." #: ../../c-api/function.rst:91 msgid "Set the vectorcall field of a given function object *func*." -msgstr "" +msgstr "Define o campo *vectorcall* de um objeto função *func*." #: ../../c-api/function.rst:93 msgid "" "Warning: extensions using this API must preserve the behavior of the " "unaltered (default) vectorcall function!" msgstr "" +"Atenção: extensões que usam essa API devem preservar o comportamento " +"inalterado (padrão) de uma função *vectorcall*!" + +#: ../../c-api/function.rst:101 +msgid "" +"Return the keyword-only argument default values of the function object *op*. " +"This can be a dictionary of arguments or ``NULL``." +msgstr "" +"Retorna os valores-padrão de argumentos somente-nomeados do objeto função " +"*op*. Pode ser um dicionário de argumentos ou ``NULL``." + +#: ../../c-api/function.rst:107 +msgid "" +"Set the keyword-only argument default values of the function object *op*. " +"*defaults* must be a dictionary of keyword-only arguments or ``Py_None``." +msgstr "" +"Define os valores padrão dos argumentos somente-nomeados do objeto função " +"*op*. *defaults* deve ser um dicionário de argumentos somente-nomeados ou " +"``Py_None``." -#: ../../c-api/function.rst:100 +#: ../../c-api/function.rst:110 +msgid "" +"This function returns ``0`` on success, and returns ``-1`` with an exception " +"set on failure." +msgstr "" +"Esta função retorna ``0`` em caso de sucesso e retorna ``-1`` com uma " +"exceção definida em caso de falha." + +#: ../../c-api/function.rst:116 msgid "" "Return the closure associated with the function object *op*. This can be " "``NULL`` or a tuple of cell objects." msgstr "" -"Retorna o fechamento associado ao objeto função *op*. Isso pode ser ``NULL`` " -"ou uma tupla de objetos de célula." +"Retorna o fechamento associado ao objeto função *op*. Pode ser ``NULL`` ou " +"uma tupla de objetos célula." -#: ../../c-api/function.rst:106 +#: ../../c-api/function.rst:122 msgid "" "Set the closure associated with the function object *op*. *closure* must be " "``Py_None`` or a tuple of cell objects." @@ -149,7 +192,7 @@ msgstr "" "Define o fechamento associado ao objeto função *op*. *closure* deve ser " "``Py_None`` ou uma tupla de objetos de célula." -#: ../../c-api/function.rst:114 +#: ../../c-api/function.rst:130 msgid "" "Return the annotations of the function object *op*. This can be a mutable " "dictionary or ``NULL``." @@ -157,7 +200,7 @@ msgstr "" "Retorna as anotações do objeto função *op*. Este pode ser um dicionário " "mutável ou ``NULL``." -#: ../../c-api/function.rst:120 +#: ../../c-api/function.rst:136 msgid "" "Set the annotations for the function object *op*. *annotations* must be a " "dictionary or ``Py_None``." @@ -165,52 +208,92 @@ msgstr "" "Define as anotações para o objeto função *op*. *annotations* deve ser um " "dicionário ou ``Py_None``." -#: ../../c-api/function.rst:128 +#: ../../c-api/function.rst:150 +msgid "" +"These functions are similar to their ``PyFunction_Get*`` counterparts, but " +"do not do type checking. Passing anything other than an instance " +"of :c:data:`PyFunction_Type` is undefined behavior." +msgstr "" +"Essas funções são semelhantes às suas contrapartes ``PyFunction_Get*``, mas " +"não realizam verificação de tipos. Passar qualquer coisa que não seja uma " +"instância de :c:data:`PyFunction_Type` é um comportamento indefinido." + +#: ../../c-api/function.rst:157 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 "" +"Registra *callback* como uma sentinela de função para o interpretador atual. " +"Retorna um ID que pode ser passado para :c:func:`PyFunction_ClearWatcher`. " +"Em caso de erro (por exemplo, sem novos IDs de sentinelas disponíveis), " +"retorna ``-1`` e define uma exceção." -#: ../../c-api/function.rst:138 +#: ../../c-api/function.rst:167 msgid "" -"Clear watcher identified by *watcher_id* previously returned from :c:func:" -"`PyFunction_AddWatcher` for the current interpreter. Return ``0`` on " -"success, or ``-1`` and set an exception on error (e.g. if the given " -"*watcher_id* was never registered.)" +"Clear watcher identified by *watcher_id* previously returned " +"from :c:func:`PyFunction_AddWatcher` for the current interpreter. Return " +"``0`` on success, or ``-1`` and set an exception on error (e.g. if the " +"given *watcher_id* was never registered.)" msgstr "" +"Cancela o registro da sentinela identificada pelo *watcher_id* retornado " +"por :c:func:`PyFunction_AddWatcher` para o interpretador atual. Retorna " +"``0`` em caso de sucesso, ou ``-1`` e define uma exceção em caso de erro " +"(por exemplo, ao receber um *watcher_id* desconhecido.)" -#: ../../c-api/function.rst:148 -msgid "" -"Enumeration of possible function watcher events: - " -"``PyFunction_EVENT_CREATE`` - ``PyFunction_EVENT_DESTROY`` - " -"``PyFunction_EVENT_MODIFY_CODE`` - ``PyFunction_EVENT_MODIFY_DEFAULTS`` - " -"``PyFunction_EVENT_MODIFY_KWDEFAULTS``" -msgstr "" +#: ../../c-api/function.rst:177 +msgid "Enumeration of possible function watcher events:" +msgstr "Enumeração de possíveis eventos do observador de funções:" + +#: ../../c-api/function.rst:179 +msgid "``PyFunction_EVENT_CREATE``" +msgstr "``PyFunction_EVENT_CREATE``" + +#: ../../c-api/function.rst:180 +msgid "``PyFunction_EVENT_DESTROY``" +msgstr "``PyFunction_EVENT_DESTROY``" -#: ../../c-api/function.rst:160 +#: ../../c-api/function.rst:181 +msgid "``PyFunction_EVENT_MODIFY_CODE``" +msgstr "``PyFunction_EVENT_MODIFY_CODE``" + +#: ../../c-api/function.rst:182 +msgid "``PyFunction_EVENT_MODIFY_DEFAULTS``" +msgstr "``PyFunction_EVENT_MODIFY_DEFAULTS``" + +#: ../../c-api/function.rst:183 +msgid "``PyFunction_EVENT_MODIFY_KWDEFAULTS``" +msgstr "``PyFunction_EVENT_MODIFY_KWDEFAULTS``" + +#: ../../c-api/function.rst:190 msgid "Type of a function watcher callback function." -msgstr "" +msgstr "Tipo de uma função de retorno de sentinela de função." -#: ../../c-api/function.rst:162 +#: ../../c-api/function.rst:192 msgid "" "If *event* is ``PyFunction_EVENT_CREATE`` or ``PyFunction_EVENT_DESTROY`` " -"then *new_value* will be ``NULL``. Otherwise, *new_value* will hold a :term:" -"`borrowed reference` to the new value that is about to be stored in *func* " -"for the attribute that is being modified." +"then *new_value* will be ``NULL``. Otherwise, *new_value* will hold " +"a :term:`borrowed reference` to the new value that is about to be stored in " +"*func* for the attribute that is being modified." msgstr "" +"Se *event* for ``PyFunction_EVENT_CREATE`` ou ``PyFunction_EVENT_DESTROY``, " +"*new_value* será ``NULL``. Senão, *new_value* portará uma :term:`referência " +"emprestada` ao novo valor prestes a ser guardado em *func* para o atributo " +"que está sendo modificado." -#: ../../c-api/function.rst:167 +#: ../../c-api/function.rst:197 msgid "" "The callback may inspect but must not modify *func*; doing so could have " "unpredictable effects, including infinite recursion." msgstr "" +"A função de retorno poderá somente inspecionar, e não modificar *func*. Caso " +"contrário, poderíamos ter efeitos imprevisíveis, incluindo recursão infinita." -#: ../../c-api/function.rst:170 +#: ../../c-api/function.rst:200 msgid "" "If *event* is ``PyFunction_EVENT_CREATE``, then the callback is invoked " -"after `func` has been fully initialized. Otherwise, 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. " @@ -218,26 +301,40 @@ msgid "" "behavior depending on optimization decisions, it does not change the " "semantics of the Python code being executed." msgstr "" - -#: ../../c-api/function.rst:179 +"Se *event* for ``PyFunction_EVENT_CREATE``, a função de retorno será " +"invocada após *func* ter sido completamente inicializada. Caso contrário, a " +"função de retorno será invocada antes de modificar *func*, então o estado " +"anterior de *func* poderá ser inspecionado. O ambiente de execução pode " +"otimizar a criação de objetos função, quando possível, ao ignorá-las. Nesses " +"casos, nenhum evento será emitido. Apesar de decisões de otimização criarem " +"diferenças de comportamento em tempo de execução, elas não mudam a semântica " +"do código Python sendo executado." + +#: ../../c-api/function.rst:209 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 "" +"Se *event* for ``PyFunction_EVENT_DESTROY``, então obter uma referência " +"dentro da função de retorno para a função prestes a ser destruída irá revivê-" +"la, impedindo que esta função seja liberada nesse tempo. Quando o objeto " +"revivido for destruído, quaisquer funções de retorno sentinelas ativas nesse " +"momento poderão ser chamadas novamente." -#: ../../c-api/function.rst:184 +#: ../../c-api/function.rst:214 msgid "" "If the callback sets an exception, it must return ``-1``; this exception " -"will be printed as an unraisable exception using :c:func:" -"`PyErr_WriteUnraisable`. Otherwise it should return ``0``." +"will be printed as an unraisable exception " +"using :c:func:`PyErr_WriteUnraisable`. Otherwise it should return ``0``." msgstr "" -"Se a função de retorno definir uma exceção, ela deverá retornar ``-1``; essa " -"exceção será impressa como uma exceção não reprovável usando :c:func:" -"`PyErr_WriteUnraisable`. Caso contrário, deverá retornar ``0``." +"Se a função de retorno definir uma exceção, ela deverá retornar ``-1``. Essa " +"exceção será exibida como uma exceção não levantável " +"usando :c:func:`PyErr_WriteUnraisable`. Caso contrário, deverá retornar " +"``0``." -#: ../../c-api/function.rst:188 +#: ../../c-api/function.rst:218 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 " @@ -245,11 +342,11 @@ msgid "" "exception unless it saves and clears the exception state first, and restores " "it before returning." msgstr "" -"É possível que já exista uma exceção pendente definida na entrada da chamada " +"É possível que já exista uma exceção pendente definida na entrada da função " "de retorno. Nesse caso, a função de retorno deve retornar ``0`` com a mesma " -"exceção ainda definida. Isso significa que a callback não pode chamar " -"nenhuma outra API que possa definir uma exceção, a menos que salve e limpe o " -"estado da exceção primeiro e o restaure antes de retornar." +"exceção ainda definida. Isso significa que a função de retorno não pode " +"chamar nenhuma outra API que possa definir uma exceção, a menos que salve e " +"limpe o estado da exceção primeiro e restaure a exceção antes de retornar." #: ../../c-api/function.rst:8 msgid "object" diff --git a/c-api/gcsupport.po b/c-api/gcsupport.po index 3ab930a46..2bf10bf78 100644 --- a/c-api/gcsupport.po +++ b/c-api/gcsupport.po @@ -1,27 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Rodrigo Cândido, 2022 -# Andressa Lima Ferreira, 2023 -# Rafael Fontenelle , 2023 +# python-doc bot, 2025 +# Rafael Fontenelle , 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-17 14:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -39,8 +38,8 @@ msgid "" "explicit support for garbage collection." msgstr "" "O suporte do Python para detectar e coletar o lixo, que envolve referencias " -"circulares, requer suporte dos tipos de objetos que são \"contêiners\" para " -"outros objetos que também podem ser contêiners. Tipos que não armazenam " +"circulares, requer suporte dos tipos de objetos que são \"contêineres\" para " +"outros objetos que também podem ser contêineres. Tipos que não armazenam " "referências a outros tipos de objetos, ou que apenas armazenam referências a " "tipos atômicos (como números ou strings), não precisam fornecer nenhum " "suporte explicito para coleta de lixo." @@ -83,8 +82,8 @@ msgid "" "Once all the fields which may contain references to other containers are " "initialized, it must call :c:func:`PyObject_GC_Track`." msgstr "" -"Uma vez que todos os campos que podem conter referências a outros containers " -"foram inicializados, deve-se chamar :c:func:`PyObject_GC_Track`." +"Uma vez que todos os campos que podem conter referências a outros " +"contêineres foram inicializados, deve-se chamar :c:func:`PyObject_GC_Track`." #: ../../c-api/gcsupport.rst:34 msgid "" @@ -96,47 +95,47 @@ msgstr "" #: ../../c-api/gcsupport.rst:37 msgid "" -"Before fields which refer to other containers are invalidated, :c:func:" -"`PyObject_GC_UnTrack` must be called." +"Before fields which refer to other containers are " +"invalidated, :c:func:`PyObject_GC_UnTrack` must be called." msgstr "" -"Antes que os campos que fazer referência a outros containers sejam " +"Antes que os campos que fazer referência a outros contêineres sejam " "invalidados, :c:func:`PyObject_GC_UnTrack` deve ser chamado." #: ../../c-api/gcsupport.rst:40 msgid "" "The object's memory must be deallocated using :c:func:`PyObject_GC_Del`." msgstr "" -"A memória destinada ao objeto deve ser desalocada usando :c:func:" -"`PyObject_GC_Del`." +"A memória destinada ao objeto deve ser desalocada " +"usando :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." +"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 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 " -"interpreter will automatically populate the :c:member:`~PyTypeObject." -"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." +"interpreter will automatically populate " +"the :c:member:`~PyTypeObject.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." +"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:62 msgid "" -"Analogous to :c:macro:`PyObject_NewVar` but for container objects with the :" -"c:macro:`Py_TPFLAGS_HAVE_GC` flag set." +"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:67 @@ -157,8 +156,8 @@ msgstr "" 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." +"number of fields, prefer using :c:type:`PyVarObject` " +"and :c:member:`~PyTypeObject.tp_itemsize` instead." msgstr "" #: ../../c-api/gcsupport.rst:88 @@ -217,18 +216,18 @@ msgstr "" #: ../../c-api/gcsupport.rst:136 msgid "" -"Releases memory allocated to an object using :c:macro:`PyObject_GC_New` or :" -"c:macro:`PyObject_GC_NewVar`." +"Releases memory allocated to an object using :c:macro:`PyObject_GC_New` " +"or :c:macro:`PyObject_GC_NewVar`." msgstr "" #: ../../c-api/gcsupport.rst:142 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 " -"this object to add it back to the set of tracked objects. The deallocator (:" -"c:member:`~PyTypeObject.tp_dealloc` handler) should call this for the object " -"before any of the fields used by the :c:member:`~PyTypeObject.tp_traverse` " -"handler become invalid." +"this object to add it back to the set of tracked objects. The deallocator " +"(:c:member:`~PyTypeObject.tp_dealloc` handler) should call this for the " +"object before any of the fields used by " +"the :c:member:`~PyTypeObject.tp_traverse` handler become invalid." msgstr "" #: ../../c-api/gcsupport.rst:151 @@ -245,12 +244,12 @@ msgstr "" #: ../../c-api/gcsupport.rst:159 msgid "" -"Type of the visitor function passed to the :c:member:`~PyTypeObject." -"tp_traverse` handler. The function should be called with an object to " -"traverse as *object* and the third parameter to the :c:member:`~PyTypeObject." -"tp_traverse` handler as *arg*. The Python core uses several visitor " -"functions to implement cyclic garbage detection; it's not expected that " -"users will need to write their own visitor functions." +"Type of the visitor function passed to " +"the :c:member:`~PyTypeObject.tp_traverse` handler. The function should be " +"called with an object to traverse as *object* and the third parameter to " +"the :c:member:`~PyTypeObject.tp_traverse` handler as *arg*. The Python core " +"uses several visitor functions to implement cyclic garbage detection; it's " +"not expected that users will need to write their own visitor functions." msgstr "" #: ../../c-api/gcsupport.rst:166 @@ -271,26 +270,45 @@ msgstr "" #: ../../c-api/gcsupport.rst:178 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:" -"member:`~PyTypeObject.tp_traverse` implementation must name its arguments " -"exactly *visit* and *arg*:" +"The traversal function must not have any side effects. Implementations may " +"not modify the reference counts of any Python objects nor create or destroy " +"any Python objects." +msgstr "" + +#: ../../c-api/gcsupport.rst:182 +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:member:`~PyTypeObject.tp_traverse` implementation must name its " +"arguments exactly *visit* and *arg*:" msgstr "" -#: ../../c-api/gcsupport.rst:185 +#: ../../c-api/gcsupport.rst:189 msgid "" -"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::" +"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:198 +#: ../../c-api/gcsupport.rst:194 msgid "" -"The :c:member:`~PyTypeObject.tp_clear` handler must be of the :c:type:" -"`inquiry` type, or ``NULL`` if the object is immutable." +"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" +"}" msgstr "" -#: ../../c-api/gcsupport.rst:204 +#: ../../c-api/gcsupport.rst:202 +msgid "" +"The :c:member:`~PyTypeObject.tp_clear` handler must be of " +"the :c:type:`inquiry` type, or ``NULL`` if the object is immutable." +msgstr "" + +#: ../../c-api/gcsupport.rst:208 msgid "" "Drop references that may have created reference cycles. Immutable objects " "do not have to define this method since they can never directly create " @@ -300,82 +318,82 @@ msgid "" "in a reference cycle." msgstr "" -#: ../../c-api/gcsupport.rst:213 +#: ../../c-api/gcsupport.rst:217 msgid "Controlling the Garbage Collector State" msgstr "Controlando o estado do coletor de lixo" -#: ../../c-api/gcsupport.rst:215 +#: ../../c-api/gcsupport.rst:219 msgid "" "The C-API provides the following functions for controlling garbage " "collection runs." msgstr "" -#: ../../c-api/gcsupport.rst:220 +#: ../../c-api/gcsupport.rst:224 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:223 +#: ../../c-api/gcsupport.rst:227 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." +"returns ``0`` immediately. Errors during garbage collection are passed " +"to :data:`sys.unraisablehook`. This function does not raise exceptions." msgstr "" -#: ../../c-api/gcsupport.rst:233 +#: ../../c-api/gcsupport.rst:237 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:241 +#: ../../c-api/gcsupport.rst:245 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:249 +#: ../../c-api/gcsupport.rst:253 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:256 +#: ../../c-api/gcsupport.rst:260 msgid "Querying Garbage Collector State" msgstr "" -#: ../../c-api/gcsupport.rst:258 +#: ../../c-api/gcsupport.rst:262 msgid "" "The C-API provides the following interface for querying information about " "the garbage collector." msgstr "" -#: ../../c-api/gcsupport.rst:263 +#: ../../c-api/gcsupport.rst:267 msgid "" "Run supplied *callback* on all live GC-capable objects. *arg* is passed " "through to all invocations of *callback*." msgstr "" -#: ../../c-api/gcsupport.rst:267 +#: ../../c-api/gcsupport.rst:271 msgid "" "If new objects are (de)allocated by the callback it is undefined if they " "will be visited." msgstr "" -#: ../../c-api/gcsupport.rst:270 +#: ../../c-api/gcsupport.rst:274 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:278 +#: ../../c-api/gcsupport.rst:282 msgid "" -"Type of the visitor function to be passed to :c:func:" -"`PyUnstable_GC_VisitObjects`. *arg* is the same as the *arg* passed to " -"``PyUnstable_GC_VisitObjects``. Return ``0`` to continue iteration, return " -"``1`` to stop iteration. Other return values are reserved for now so " -"behavior on returning anything else is undefined." +"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 99276656a..1b98f5407 100644 --- a/c-api/gen.po +++ b/c-api/gen.po @@ -1,25 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 +# python-doc bot, 2025 +# Rafael Fontenelle , 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-24 14:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2021\n" +"POT-Creation-Date: 2026-10-13 21:57+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -31,13 +32,13 @@ msgstr "Objetos Geradores" msgid "" "Generator objects are what Python uses to implement generator iterators. " "They are normally created by iterating over a function that yields values, " -"rather than explicitly calling :c:func:`PyGen_New` or :c:func:" -"`PyGen_NewWithQualName`." +"rather than explicitly calling :c:func:`PyGen_New` " +"or :c:func:`PyGen_NewWithQualName`." msgstr "" "Objetos geradores são o que o Python usa para implementar iteradores " "geradores. Eles são normalmente criados por iteração sobre uma função que " -"produz valores, em vez de invocar explicitamente :c:func:`PyGen_New` ou :c:" -"func:`PyGen_NewWithQualName`." +"produz valores, em vez de invocar explicitamente :c:func:`PyGen_New` " +"ou :c:func:`PyGen_NewWithQualName`." #: ../../c-api/gen.rst:15 msgid "The C structure used for generator objects." @@ -66,21 +67,63 @@ msgstr "" #: ../../c-api/gen.rst:37 msgid "" "Create and return a new generator object based on the *frame* object. A " -"reference to *frame* is stolen by this function. The argument must not be " -"``NULL``." +"reference to *frame* is \":term:`stolen `\" by this function (even on " +"error). The argument must not be ``NULL``." msgstr "" -"Cria e retorna um novo objeto gerador com base no objeto *frame*. Uma " -"referência a *quadro* é roubada por esta função. O argumento não deve ser " -"``NULL``." #: ../../c-api/gen.rst:43 msgid "" "Create and return a new generator object based on the *frame* object, with " "``__name__`` and ``__qualname__`` set to *name* and *qualname*. A reference " -"to *frame* is stolen by this function. The *frame* argument must not be " -"``NULL``." +"to *frame* is \":term:`stolen `\" by this function (even on error). " +"The *frame* argument must not be ``NULL``." +msgstr "" + +#: ../../c-api/gen.rst:50 +msgid "" +"Return a new :term:`strong reference` to the code object wrapped by *gen*. " +"This function always succeeds." +msgstr "" +"Retorna uma nova :term:`referência forte` ao objeto de código encapsulado " +"por *gen*. Esta função sempre tem sucesso." + +#: ../../c-api/gen.rst:55 +msgid "Asynchronous Generator Objects" +msgstr "Objetos geradores assíncronos" + +#: ../../c-api/gen.rst:58 +msgid ":pep:`525`" +msgstr ":pep:`525`" + +#: ../../c-api/gen.rst:62 +msgid "" +"The type object corresponding to asynchronous generator objects. This is " +"available as :class:`types.AsyncGeneratorType` in the Python layer." +msgstr "" +"O objeto de tipo correspondente aos objetos geradores assíncronos. Está " +"disponível como :class:`types.AsyncGeneratorType` na camada Python." + +#: ../../c-api/gen.rst:69 +msgid "" +"Create a new asynchronous generator wrapping *frame*, with ``__name__`` and " +"``__qualname__`` set to *name* and *qualname*. *frame* is \":term:`stolen " +"`\" by this function (even on error) and must not be ``NULL``." +msgstr "" + +#: ../../c-api/gen.rst:74 +msgid "" +"On success, this function returns a :term:`strong reference` to the new " +"asynchronous generator. On failure, this function returns ``NULL`` with an " +"exception set." +msgstr "" +"Em caso de sucesso, esta função retorna uma :term:`referência forte` ao novo " +"gerador assíncrono. Em caso de falha, esta função retorna ``NULL`` com uma " +"exceção definida." + +#: ../../c-api/gen.rst:82 +msgid "" +"Return true if *op* is an asynchronous generator object, false otherwise. " +"This function always succeeds." msgstr "" -"Cria e retorna um novo objeto gerador com base no objeto *frame*, com " -"``__name__`` e ``__qualname__`` definidos como *name* e *qualname*. Uma " -"referência a *frame* é roubada por esta função. O argumento *frame* não deve " -"ser ``NULL``." +"Retorna verdadeiro se *op* for um objeto gerador assíncrono, falso caso " +"contrário. Esta função sempre tem sucesso." diff --git a/c-api/hash.po b/c-api/hash.po index 55e397dff..53a23d5fa 100644 --- a/c-api/hash.po +++ b/c-api/hash.po @@ -1,26 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Adorilson Bezerra , 2024 -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 +# Rafael Fontenelle , 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-08-09 16:36+0000\n" -"PO-Revision-Date: 2024-02-23 14:15+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -38,11 +38,75 @@ msgstr "" msgid "Hash value type: signed integer." msgstr "Tipo de valor do hash: inteiro com sinal." -#: ../../c-api/hash.rst:16 +#: ../../c-api/hash.rst:17 msgid "Hash value type: unsigned integer." msgstr "Tipo de valor do hash: inteiro sem sinal." -#: ../../c-api/hash.rst:22 +#: ../../c-api/hash.rst:24 +msgid "" +"A numerical value indicating the algorithm for hashing " +"of :class:`str`, :class:`bytes`, and :class:`memoryview`." +msgstr "" +"Um valor numérico que indica o algoritmo de hash " +"para :class:`str`, :class:`bytes` e :class:`memoryview`." + +#: ../../c-api/hash.rst:27 +msgid "The algorithm name is exposed by :data:`sys.hash_info.algorithm`." +msgstr "O nome do algoritmo é exposto por :data:`sys.hash_info.algorithm`." + +#: ../../c-api/hash.rst:36 +msgid "" +"Numerical values to compare to :c:macro:`Py_HASH_ALGORITHM` to determine " +"which algorithm is used for hashing. The hash algorithm can be configured " +"via the configure :option:`--with-hash-algorithm` option." +msgstr "" +"Valores numéricos a serem comparados com :c:macro:`Py_HASH_ALGORITHM` para " +"determinar qual algoritmo é usado para o hashing. O algoritmo de hash pode " +"ser configurado através da opção :option:`--with-hash-algorithm` do comando " +"configure." + +#: ../../c-api/hash.rst:40 +msgid "Add :c:macro:`!Py_HASH_FNV` and :c:macro:`!Py_HASH_SIPHASH24`." +msgstr "Adiciona :c:macro:`!Py_HASH_FNV` e :c:macro:`!Py_HASH_SIPHASH24`." + +#: ../../c-api/hash.rst:43 +msgid "Add :c:macro:`!Py_HASH_SIPHASH13`." +msgstr "Adiciona :c:macro:`!Py_HASH_SIPHASH13`." + +#: ../../c-api/hash.rst:49 +msgid "" +"Buffers of length in range ``[1, Py_HASH_CUTOFF)`` are hashed using DJBX33A " +"instead of the algorithm described by :c:macro:`Py_HASH_ALGORITHM`." +msgstr "" +"Buffers de comprimento no intervalo ``[1, Py_HASH_CUTOFF)`` são hasheados " +"usando DJBX33A em vez do algoritmo descrito por :c:macro:`Py_HASH_ALGORITHM`." + +#: ../../c-api/hash.rst:52 +msgid "A :c:macro:`!Py_HASH_CUTOFF` of 0 disables the optimization." +msgstr "Uma :c:macro:`!Py_HASH_CUTOFF` de 0 desabilita a otimização." + +#: ../../c-api/hash.rst:53 +msgid "" +":c:macro:`!Py_HASH_CUTOFF` must be non-negative and less or equal than 7." +msgstr "" +":c:macro:`!Py_HASH_CUTOFF` deve ser não-negativo ou menor ou igual a 7." + +#: ../../c-api/hash.rst:55 +msgid "" +"32-bit platforms should use a cutoff smaller than 64-bit platforms because " +"it is easier to create colliding strings. A cutoff of 7 on 64-bit platforms " +"and 5 on 32-bit platforms should provide a decent safety margin." +msgstr "" +"Plataformas de 32 bits devem usar um limite de corte menor do que " +"plataformas de 64 bits, pois é mais fácil criar strings que colidam. Um " +"limite de corte de 7 em plataformas de 64 bits e 5 em plataformas de 32 bits " +"deve fornecer uma margem de segurança adequada." + +#: ../../c-api/hash.rst:59 +msgid "This corresponds to the :data:`sys.hash_info.cutoff` constant." +msgstr "Isso corresponde à constante :data:`sys.hash_info.cutoff`." + +#: ../../c-api/hash.rst:66 msgid "" "The `Mersenne prime `_ ``P = " "2**n -1``, used for numeric hash scheme." @@ -50,47 +114,75 @@ msgstr "" "O `primo de Mersenne `_ ``P " "= 2**n -1``, usado para esquema de hash numérico." -#: ../../c-api/hash.rst:28 +#: ../../c-api/hash.rst:69 +msgid "This corresponds to the :data:`sys.hash_info.modulus` constant." +msgstr "Isso corresponde à constante :data:`sys.hash_info.modulus`." + +#: ../../c-api/hash.rst:76 msgid "The exponent ``n`` of ``P`` in :c:macro:`PyHASH_MODULUS`." msgstr "O expoente ``n`` de ``P`` em :c:macro:`PyHASH_MODULUS`." -#: ../../c-api/hash.rst:34 +#: ../../c-api/hash.rst:83 msgid "Prime multiplier used in string and various other hashes." msgstr "Multiplicador de primo usado em strings e vários outros hashes." -#: ../../c-api/hash.rst:40 +#: ../../c-api/hash.rst:90 msgid "The hash value returned for a positive infinity." msgstr "O valor de hash retornado para um infinito positivo." -#: ../../c-api/hash.rst:46 +#: ../../c-api/hash.rst:92 +msgid "This corresponds to the :data:`sys.hash_info.inf` constant." +msgstr "Isso corresponde à constante :data:`sys.hash_info.inf`." + +#: ../../c-api/hash.rst:99 msgid "The multiplier used for the imaginary part of a complex number." msgstr "O multiplicador usado para a parte imaginária de um número complexo." -#: ../../c-api/hash.rst:52 +#: ../../c-api/hash.rst:101 +msgid "This corresponds to the :data:`sys.hash_info.imag` constant." +msgstr "Isso corresponde à constante :data:`sys.hash_info.imag`." + +#: ../../c-api/hash.rst:108 msgid "Hash function definition used by :c:func:`PyHash_GetFuncDef`." msgstr "Definição de função de hash usada por :c:func:`PyHash_GetFuncDef`." -#: ../../c-api/hash.rst:60 +#: ../../c-api/hash.rst:112 +msgid "Hash function." +msgstr "Função de hash." + +#: ../../c-api/hash.rst:116 msgid "Hash function name (UTF-8 encoded string)." msgstr "Nome de função hash (string codificada em UTF-8)." -#: ../../c-api/hash.rst:64 +#: ../../c-api/hash.rst:118 +msgid "This corresponds to the :data:`sys.hash_info.algorithm` constant." +msgstr "Isso corresponde à constante :data:`sys.hash_info.algorithm`." + +#: ../../c-api/hash.rst:122 msgid "Internal size of the hash value in bits." msgstr "Tamanho interno do valor do hash em bits." -#: ../../c-api/hash.rst:68 +#: ../../c-api/hash.rst:124 +msgid "This corresponds to the :data:`sys.hash_info.hash_bits` constant." +msgstr "Isso corresponde à constante :data:`sys.hash_info.hash_bits`." + +#: ../../c-api/hash.rst:128 msgid "Size of seed input in bits." msgstr "Tamanho da entrada de seed em bits." -#: ../../c-api/hash.rst:75 +#: ../../c-api/hash.rst:130 +msgid "This corresponds to the :data:`sys.hash_info.seed_bits` constant." +msgstr "Isso corresponde à constante :data:`sys.hash_info.seed_bits`." + +#: ../../c-api/hash.rst:137 msgid "Get the hash function definition." msgstr "Obtém a definição de função de hash." -#: ../../c-api/hash.rst:78 +#: ../../c-api/hash.rst:140 msgid ":pep:`456` \"Secure and interchangeable hash algorithm\"." msgstr ":pep:`456` \"Algoritmo de hash seguro e intercambiável\"." -#: ../../c-api/hash.rst:85 +#: ../../c-api/hash.rst:147 msgid "" "Hash a pointer value: process the pointer value as an integer (cast it to " "``uintptr_t`` internally). The pointer is not dereferenced." @@ -99,11 +191,11 @@ msgstr "" "(converte-o para ``uintptr_t`` internamente). O ponteiro não é " "desreferenciado." -#: ../../c-api/hash.rst:88 +#: ../../c-api/hash.rst:150 msgid "The function cannot fail: it cannot return ``-1``." msgstr "A função não pode falhar: ela não pode retornar ``-1``." -#: ../../c-api/hash.rst:94 +#: ../../c-api/hash.rst:156 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." @@ -111,6 +203,6 @@ msgstr "" "Função de hash genérica que deve ser colocada no slot ``tp_hash`` de um " "objeto de tipo. Seu resultado depende apenas da identidade do objeto." -#: ../../c-api/hash.rst:99 +#: ../../c-api/hash.rst:161 msgid "In CPython, it is equivalent to :c:func:`Py_HashPointer`." msgstr "No CPython, é equivalente a :c:func:`Py_HashPointer`." diff --git a/c-api/import.po b/c-api/import.po index 642f57785..cf95a2913 100644 --- a/c-api/import.po +++ b/c-api/import.po @@ -1,26 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Ozeas Santos , 2021 -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 +# Rafael Fontenelle , 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-19 14:16+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -30,9 +30,12 @@ msgstr "Importando módulos" #: ../../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 *`." +"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 "" +"Esta é uma função auxiliar em torno de :c:func:`PyImport_Import()`, que " +"recebe um :c:expr:`const char *` como argumento em vez de " +"um :c:expr:`PyObject *`." #: ../../c-api/import.rst:21 msgid "This function is a deprecated alias of :c:func:`PyImport_ImportModule`." @@ -53,7 +56,7 @@ msgstr "" #: ../../c-api/import.rst:29 msgid "Use :c:func:`PyImport_ImportModule` instead." -msgstr "" +msgstr "Use :c:func:`PyImport_ImportModule`." #: ../../c-api/import.rst:37 msgid "" @@ -66,9 +69,10 @@ msgstr "" #: ../../c-api/import.rst:40 ../../c-api/import.rst:56 msgid "" "The return value is a new reference to the imported module or top-level " -"package, or ``NULL`` with an exception set on failure. Like for :func:" -"`__import__`, the return value when a submodule of a package was requested " -"is normally the top-level package, unless a non-empty *fromlist* was given." +"package, or ``NULL`` with an exception set on failure. Like " +"for :func:`__import__`, the return value when a submodule of a package was " +"requested is normally the top-level package, unless a non-empty *fromlist* " +"was given." msgstr "" "O valor de retorno é uma nova referência ao módulo importado ou pacote de " "nível superior, ou ``NULL`` com uma exceção definida em caso de falha. Como " @@ -78,11 +82,11 @@ msgstr "" #: ../../c-api/import.rst:46 msgid "" -"Failing imports remove incomplete module objects, like with :c:func:" -"`PyImport_ImportModule`." +"Failing imports remove incomplete module objects, like " +"with :c:func:`PyImport_ImportModule`." msgstr "" -"As importações com falhas removem objetos incompletos do módulo, como em :c:" -"func:`PyImport_ImportModule`." +"As importações com falhas removem objetos incompletos do módulo, como " +"em :c:func:`PyImport_ImportModule`." #: ../../c-api/import.rst:52 msgid "" @@ -135,7 +139,7 @@ msgstr "" #: ../../c-api/import.rst:91 msgid "Return the module object corresponding to a module name." -msgstr "" +msgstr "Retorna o objeto do módulo correspondente ao nome do módulo." #: ../../c-api/import.rst:93 msgid "" @@ -143,37 +147,51 @@ msgid "" "modules dictionary if there's one there, and if not, create a new one and " "insert it in the modules dictionary." msgstr "" +"O argumento *name* pode ter o formato ``pacote.módulo``. Primeiro, verifica " +"se existe um módulo no dicionário de módulos e, caso contrário, cria um novo " +"e insere-o no dicionário de módulos." #: ../../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 "" +"Retorna uma :term:`referência forte` ao módulo em caso de sucesso. Retorna " +"``NULL`` com uma exceção definida em caso de falha." #: ../../c-api/import.rst:100 msgid "The module name *name* is decoded from UTF-8." -msgstr "" +msgstr "O nome do módulo *name* é decodificado de UTF-8." #: ../../c-api/import.rst:102 msgid "" "This function does not load or import the module; if the module wasn't " -"already loaded, you will get an empty module object. Use :c:func:" -"`PyImport_ImportModule` or one of its variants to import a module. Package " -"structures implied by a dotted name for *name* are not created if not " -"already present." +"already loaded, you will get an empty module object. " +"Use :c:func:`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 "" +"Esta função não carrega nem importa o módulo; se o módulo ainda não estiver " +"carregado, você receberá um objeto de módulo vazio. " +"Use :c:func:`PyImport_ImportModule` ou uma de suas variantes para importar " +"um módulo. Estruturas de pacotes implícitas por um nome com pontos para " +"*name* não são criadas se ainda não existirem." #: ../../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 "" +"Semelhante a :c:func:`PyImport_AddModuleRef`, mas retorna " +"uma :term:`referência emprestada` e *name* é um objeto Python :class:`str`." #: ../../c-api/import.rst:121 msgid "" "Similar to :c:func:`PyImport_AddModuleRef`, but return a :term:`borrowed " "reference`." msgstr "" +"Semelhante a :c:func:`PyImport_AddModuleRef`, mas retorna " +"uma :term:`referência emprestada`." #: ../../c-api/import.rst:129 msgid "" @@ -182,35 +200,55 @@ msgid "" "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:" -"`PyImport_ExecCodeModule`. Leaving incompletely initialized modules in :" -"data:`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 "" +"was already in :data:`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 know that the module object is an unknown (and probably damaged " +"with respect to the module author's intents) state." +msgstr "" +"Dado um nome de módulo (possivelmente no formato ``pacote.módulo``) e um " +"objeto código lido de um arquivo bytecode Python ou obtido da função " +"embutida :func:`compile`, carrea o módulo. Retorna uma nova referência ao " +"objeto do módulo ou ``NULL`` com uma exceção definida se ocorrer um erro. " +"*name* é removido de :data:`sys.modules` em casos de erro, mesmo que *name* " +"já estivesse em :data:`sys.modules` na entrada " +"de :c:func:`PyImport_ExecCodeModule`. Deixar módulos incompletamente " +"inicializados em :data:`sys.modules` é perigoso, pois as importações desses " +"módulos não têm como saber que o objeto do módulo está em um estado " +"desconhecido (e provavelmente corrompido em relação às intenções do autor do " +"módulo)." #: ../../c-api/import.rst:139 msgid "" -"The module's :attr:`__spec__` and :attr:`__loader__` will be set, if not set " -"already, with the appropriate values. The spec's loader will be set to the " -"module's ``__loader__`` (if set) and to an instance of :class:`~importlib." -"machinery.SourceFileLoader` otherwise." +"The module's :attr:`~module.__spec__` and :attr:`~module.__loader__` will be " +"set, if not set already, with the appropriate values. The spec's loader " +"will be set to the module's :attr:`!__loader__` (if set) and to an instance " +"of :class:`~importlib.machinery.SourceFileLoader` otherwise." msgstr "" +"Os atributos :attr:`~module.__spec__` e :attr:`~module.__loader__` do módulo " +"serão definidos, caso ainda não estejam, com os valores apropriados. O " +"carregador do spec será definido como o atributo :attr:`!__loader__` do " +"módulo (se definido) e, caso contrário, como uma instância " +"de :class:`~importlib.machinery.SourceFileLoader`." #: ../../c-api/import.rst:144 msgid "" -"The module's :attr:`__file__` attribute will be set to the code object's :" -"attr:`~codeobject.co_filename`. If applicable, :attr:`__cached__` will also " -"be set." +"The module's :attr:`~module.__file__` attribute will be set to the code " +"object's :attr:`~codeobject.co_filename`. If " +"applicable, :attr:`~module.__cached__` will also be set." msgstr "" +"O atributo :attr:`~module.__file__` do módulo será definido para " +"o :attr:`~codeobject.co_filename` do objeto código. Se " +"aplicável, :attr:`~module.__cached__` também será definido." #: ../../c-api/import.rst:148 msgid "" -"This function will reload the module if it was already imported. See :c:" -"func:`PyImport_ReloadModule` for the intended way to reload a module." +"This function will reload the module if it was already imported. " +"See :c:func:`PyImport_ReloadModule` for the intended way to reload a module." msgstr "" -"Esta função recarregará o módulo se este já tiver sido importado. Veja :c:" -"func:`PyImport_ReloadModule` para forma desejada de recarregar um módulo." +"Esta função recarregará o módulo se este já tiver sido importado. " +"Veja :c:func:`PyImport_ReloadModule` para forma desejada de recarregar um " +"módulo." #: ../../c-api/import.rst:151 msgid "" @@ -222,25 +260,29 @@ msgstr "" #: ../../c-api/import.rst:154 msgid "" -"See also :c:func:`PyImport_ExecCodeModuleEx` and :c:func:" -"`PyImport_ExecCodeModuleWithPathnames`." +"See also :c:func:`PyImport_ExecCodeModuleEx` " +"and :c:func:`PyImport_ExecCodeModuleWithPathnames`." msgstr "" -"Veja também :c:func:`PyImport_ExecCodeModuleEx` e :c:func:" -"`PyImport_ExecCodeModuleWithPathnames`." +"Veja também :c:func:`PyImport_ExecCodeModuleEx` " +"e :c:func:`PyImport_ExecCodeModuleWithPathnames`." #: ../../c-api/import.rst:157 msgid "" -"The setting of :attr:`__cached__` and :attr:`__loader__` is deprecated. See :" -"class:`~importlib.machinery.ModuleSpec` for alternatives." +"The setting of :attr:`~module.__cached__` and :attr:`~module.__loader__` is " +"deprecated. See :class:`~importlib.machinery.ModuleSpec` for alternatives." msgstr "" +"A configuração de :attr:`~module.__cached__` e :attr:`~module.__loader__` " +"está descontinuada. Consulte :class:`~importlib.machinery.ModuleSpec` para " +"alternativas." #: ../../c-api/import.rst:165 msgid "" -"Like :c:func:`PyImport_ExecCodeModule`, but the :attr:`__file__` attribute " -"of the module object is set to *pathname* if it is non-``NULL``." +"Like :c:func:`PyImport_ExecCodeModule`, but the :attr:`~module.__file__` " +"attribute of the module object is set to *pathname* if it is non-``NULL``." msgstr "" -"Como :c:func:`PyImport_ExecCodeModule`, mas o atributo :attr:`__file__` do " -"objeto módulo é definido como *pathname* se não for ``NULL``." +"Como :c:func:`PyImport_ExecCodeModule`, mas o " +"atributo :attr:`~module.__file__` do objeto módulo é definido como " +"*pathname* se não for ``NULL``." #: ../../c-api/import.rst:168 msgid "See also :c:func:`PyImport_ExecCodeModuleWithPathnames`." @@ -248,19 +290,22 @@ msgstr "Veja também :c:func:`PyImport_ExecCodeModuleWithPathnames`." #: ../../c-api/import.rst:173 msgid "" -"Like :c:func:`PyImport_ExecCodeModuleEx`, but the :attr:`__cached__` " +"Like :c:func:`PyImport_ExecCodeModuleEx`, but the :attr:`~module.__cached__` " "attribute of the module object is set to *cpathname* if it is non-``NULL``. " "Of the three functions, this is the preferred one to use." msgstr "" -"Como :c:func:`PyImport_ExecCodeModuleEx`, mas o atributo :attr:`__cached__` " -"do objeto módulo é definido como *cpathname* se não for ``NULL``. Das três " -"funções, esta é a preferida para usar." +"Como :c:func:`PyImport_ExecCodeModuleEx`, mas o " +"atributo :attr:`~module.__cached__` do objeto módulo é definido como " +"*cpathname* se não for ``NULL``. Das três funções, esta é a preferida para " +"usar." #: ../../c-api/import.rst:179 msgid "" -"Setting :attr:`__cached__` is deprecated. See :class:`~importlib.machinery." -"ModuleSpec` for alternatives." +"Setting :attr:`~module.__cached__` is deprecated. " +"See :class:`~importlib.machinery.ModuleSpec` for alternatives." msgstr "" +"A configuração de :attr:`~module.__cached__` está descontinuada. " +"Consulte :class:`~importlib.machinery.ModuleSpec` para alternativas." #: ../../c-api/import.rst:186 msgid "" @@ -276,13 +321,15 @@ msgstr "" #: ../../c-api/import.rst:192 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 "" +"Usa :func:`!imp.source_from_cache` no cálculo do caminho de origem se apenas " +"o caminho do bytecode for fornecido." #: ../../c-api/import.rst:195 msgid "No longer uses the removed :mod:`!imp` module." -msgstr "" +msgstr "Não usa mais o módulo :mod:`!imp` removido." #: ../../c-api/import.rst:201 msgid "" @@ -306,13 +353,14 @@ msgid "" "authoritative and should be used instead of this function." msgstr "" "Retorna a string de tag mágica para nomes de arquivo de bytecode Python no " -"formato de :pep:`3147`. Tenha em mente que o valor em ``sys.implementation." -"cache_tag`` é autoritativo e deve ser usado no lugar desta função." +"formato de :pep:`3147`. Tenha em mente que o valor em " +"``sys.implementation.cache_tag`` é autoritativo e deve ser usado no lugar " +"desta função." #: ../../c-api/import.rst:219 msgid "" -"Return the dictionary used for the module administration (a.k.a. ``sys." -"modules``). Note that this is a per-interpreter variable." +"Return the dictionary used for the module administration (a.k.a. " +"``sys.modules``). Note that this is a per-interpreter variable." msgstr "" "Retorna o dicionário usado para a administração do módulo (também conhecido " "como ``sys.modules``). Observe que esta é uma variável por interpretador." @@ -334,17 +382,18 @@ msgid "" "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; " "this tells our caller that the :term:`path based finder` could not find a " -"finder for this path item. Cache the result in :data:`sys." -"path_importer_cache`. Return a new reference to the finder object." +"finder for this path item. Cache the result " +"in :data:`sys.path_importer_cache`. Return a new reference to the finder " +"object." msgstr "" #: ../../c-api/import.rst:243 msgid "" "Load a frozen module named *name*. Return ``1`` for success, ``0`` if the " "module is not found, and ``-1`` with an exception set if the initialization " -"failed. To access the imported module on a successful load, use :c:func:" -"`PyImport_ImportModule`. (Note the misnomer --- this function would reload " -"the module if it was already imported.)" +"failed. To access the imported module on a successful load, " +"use :c:func:`PyImport_ImportModule`. (Note the misnomer --- this function " +"would reload the module if it was already imported.)" msgstr "" "Carrega um módulo congelado chamado *name*. Retorna ``1`` para sucesso, " "``0`` se o módulo não for encontrado e ``-1`` com uma exceção definida se a " @@ -368,13 +417,23 @@ msgstr "" msgid "" "This is the structure type definition for frozen module descriptors, as " "generated by the :program:`freeze` utility (see :file:`Tools/freeze/` in the " -"Python source distribution). Its definition, found in :file:`Include/import." -"h`, is::" +"Python source distribution). Its definition, found in :file:`Include/" +"import.h`, is::" msgstr "" "Esta é a definição do tipo de estrutura para descritores de módulo " -"congelados, conforme gerado pelo utilitário :program:`freeze` (veja :file:" -"`Tools/freeze/` na distribuição fonte do Python). Sua definição, encontrada " -"em :file:`Include/import.h`, é::" +"congelados, conforme gerado pelo utilitário :program:`freeze` " +"(veja :file:`Tools/freeze/` na distribuição fonte do Python). Sua definição, " +"encontrada em :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 msgid "" @@ -392,10 +451,10 @@ msgid "" "could play tricks with this to provide a dynamically created collection of " "frozen modules." msgstr "" -"Este ponteiro é inicializado para apontar para um vetor de registros de :c:" -"struct:`_frozen`, terminado por um cujos membros são todos ``NULL`` ou zero. " -"Quando um módulo congelado é importado, ele é pesquisado nesta tabela. O " -"código de terceiros pode fazer truques com isso para fornecer uma coleção " +"Este ponteiro é inicializado para apontar para um vetor de registros " +"de :c:struct:`_frozen`, terminado por um cujos membros são todos ``NULL`` ou " +"zero. Quando um módulo congelado é importado, ele é pesquisado nesta tabela. " +"O código de terceiros pode fazer truques com isso para fornecer uma coleção " "criada dinamicamente de módulos congelados." #: ../../c-api/import.rst:291 @@ -411,8 +470,8 @@ msgstr "" "invólucro prático em torno de :c:func:`PyImport_ExtendInittab`, retornando " "``-1`` se a tabela não puder ser estendida. O novo módulo pode ser importado " "pelo nome *name* e usa a função *initfunc* como a função de inicialização " -"chamada na primeira tentativa de importação. Deve ser chamado antes de :c:" -"func:`Py_Initialize`." +"chamada na primeira tentativa de importação. Deve ser chamado antes " +"de :c:func:`Py_Initialize`." #: ../../c-api/import.rst:301 msgid "" @@ -433,12 +492,12 @@ msgstr "" #: ../../c-api/import.rst:318 msgid "" "Add a collection of modules to the table of built-in modules. The *newtab* " -"array must end with a sentinel entry which contains ``NULL`` for the :c:" -"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`." +"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 @@ -447,10 +506,17 @@ msgid "" "or :c:func:`PyImport_ExtendInittab` must be called before each Python " "initialization." msgstr "" -"Se Python é inicializado várias vezes, :c:func:`PyImport_AppendInittab` ou :" -"c:func:`PyImport_ExtendInittab` devem ser chamados antes de cada " +"Se Python é inicializado várias vezes, :c:func:`PyImport_AppendInittab` " +"ou :c:func:`PyImport_ExtendInittab` devem ser chamados antes de cada " "inicialização do Python." +#: ../../c-api/import.rst:332 +msgid "" +"The table of built-in modules used by Python initialization. Do not use this " +"directly; use :c:func:`PyImport_AppendInittab` " +"and :c:func:`PyImport_ExtendInittab` instead." +msgstr "" + #: ../../c-api/import.rst:11 msgid "package variable" msgstr "" diff --git a/c-api/index.po b/c-api/index.po index 8a9928fe7..9b1a105a4 100644 --- a/c-api/index.po +++ b/c-api/index.po @@ -1,26 +1,25 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Marco Rougeth , 2021 +# python-doc bot, 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-24 14:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Marco Rougeth , 2021\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: python-doc bot, 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -31,11 +30,11 @@ msgstr "Manual de referência da API Python/C" #: ../../c-api/index.rst:7 msgid "" "This manual documents the API used by C and C++ programmers who want to " -"write extension modules or embed Python. It is a companion to :ref:" -"`extending-index`, which describes the general principles of extension " -"writing but does not document the API functions in detail." +"write extension modules or embed Python. It is a companion " +"to :ref:`extending-index`, which describes the general principles of " +"extension writing but does not document the API functions in detail." msgstr "" "Este manual documenta a API usada por programadores C e C++ que desejam " -"escrever módulos de extensões ou embutir Python. É um complemento para :ref:" -"`extending-index`, que descreve os princípios gerais da escrita de extensões " -"mas não documenta as funções da API em detalhes." +"escrever módulos de extensões ou embutir Python. É um complemento " +"para :ref:`extending-index`, que descreve os princípios gerais da escrita de " +"extensões mas não documenta as funções da API em detalhes." diff --git a/c-api/init.po b/c-api/init.po index 41551dddd..2539b02c0 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -1,50 +1,47 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Rafael Marques , 2021 -# a76d6fb6142d7607ab0526dcbddb02d7_7bf0da0 <3b5fb0f281c8dfb4c0170f2ee2a6cfcf_843623>, 2021 -# Andre Weber, 2021 -# Rodrigo Cândido, 2022 -# Claudio Rogerio Carvalho Filho , 2023 -# Marco Rougeth , 2023 -# i17obot , 2024 -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 +# Rafael Fontenelle , 2026 +# willian ohara, 2026 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-08-03 20:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-13 21:57+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: willian ohara, 2026\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../c-api/init.rst:8 msgid "Initialization, Finalization, and Threads" -msgstr "Inicialização, Finalização e Threads" +msgstr "Inicialização, finalização e threads" #: ../../c-api/init.rst:10 -msgid "See also :ref:`Python Initialization Configuration `." +msgid "" +"See :ref:`Python Initialization Configuration ` for details on " +"how to configure the interpreter prior to initialization." msgstr "" -"Consulte também :ref:`Configuração de Inicialização do Python `." +"Veja :ref:`Configuração de inicialização do Python ` para " +"detalhes sobre como configurar o interpretador antes da inicialização." -#: ../../c-api/init.rst:15 +#: ../../c-api/init.rst:16 msgid "Before Python Initialization" -msgstr "Antes da Inicialização do Python" +msgstr "Antes da inicialização do Python" -#: ../../c-api/init.rst:17 +#: ../../c-api/init.rst:18 msgid "" "In an application embedding Python, the :c:func:`Py_Initialize` function " "must be called before using any other Python/C API functions; with the " @@ -56,199 +53,244 @@ msgstr "" "de algumas funções e as :ref:`variáveis globais de configuração `." -#: ../../c-api/init.rst:22 +#: ../../c-api/init.rst:23 msgid "" "The following functions can be safely called before Python is initialized:" msgstr "" "As seguintes funções podem ser seguramente chamadas antes da inicialização " "do Python." -#: ../../c-api/init.rst:24 +#: ../../c-api/init.rst:25 +msgid "Functions that initialize the interpreter:" +msgstr "Funções que inicializam o interpretador:" + +#: ../../c-api/init.rst:27 +msgid ":c:func:`Py_Initialize`" +msgstr ":c:func:`Py_Initialize`" + +#: ../../c-api/init.rst:28 +msgid ":c:func:`Py_InitializeEx`" +msgstr ":c:func:`Py_InitializeEx`" + +#: ../../c-api/init.rst:29 +msgid ":c:func:`Py_InitializeFromConfig`" +msgstr ":c:func:`Py_InitializeFromConfig`" + +#: ../../c-api/init.rst:30 +msgid ":c:func:`Py_BytesMain`" +msgstr ":c:func:`Py_BytesMain`" + +#: ../../c-api/init.rst:31 +msgid ":c:func:`Py_Main`" +msgstr ":c:func:`Py_Main`" + +#: ../../c-api/init.rst:32 +msgid "the runtime pre-initialization functions covered in :ref:`init-config`" +msgstr "" +"as funções de pré-inicialização de tempo de execução cobertas em :ref:`init-" +"config`" + +#: ../../c-api/init.rst:34 msgid "Configuration functions:" -msgstr "Funções de Configuração" +msgstr "Funções de configuração" -#: ../../c-api/init.rst:26 +#: ../../c-api/init.rst:36 msgid ":c:func:`PyImport_AppendInittab`" msgstr ":c:func:`PyImport_AppendInittab`" -#: ../../c-api/init.rst:27 +#: ../../c-api/init.rst:37 msgid ":c:func:`PyImport_ExtendInittab`" msgstr ":c:func:`PyImport_ExtendInittab`" -#: ../../c-api/init.rst:28 +#: ../../c-api/init.rst:38 msgid ":c:func:`!PyInitFrozenExtensions`" -msgstr "" +msgstr ":c:func:`!PyInitFrozenExtensions`" -#: ../../c-api/init.rst:29 +#: ../../c-api/init.rst:39 msgid ":c:func:`PyMem_SetAllocator`" msgstr ":c:func:`PyMem_SetAllocator`" -#: ../../c-api/init.rst:30 +#: ../../c-api/init.rst:40 msgid ":c:func:`PyMem_SetupDebugHooks`" msgstr ":c:func:`PyMem_SetupDebugHooks`" -#: ../../c-api/init.rst:31 +#: ../../c-api/init.rst:41 msgid ":c:func:`PyObject_SetArenaAllocator`" msgstr ":c:func:`PyObject_SetArenaAllocator`" -#: ../../c-api/init.rst:32 +#: ../../c-api/init.rst:42 msgid ":c:func:`Py_SetProgramName`" msgstr ":c:func:`Py_SetProgramName`" -#: ../../c-api/init.rst:33 +#: ../../c-api/init.rst:43 msgid ":c:func:`Py_SetPythonHome`" msgstr ":c:func:`Py_SetPythonHome`" -#: ../../c-api/init.rst:34 +#: ../../c-api/init.rst:44 msgid ":c:func:`PySys_ResetWarnOptions`" msgstr ":c:func:`PySys_ResetWarnOptions`" -#: ../../c-api/init.rst:36 +#: ../../c-api/init.rst:45 +msgid "the configuration functions covered in :ref:`init-config`" +msgstr "as funções de configuração cobertas em :ref:`init-config`" + +#: ../../c-api/init.rst:47 msgid "Informative functions:" -msgstr "Funções Informativas:" +msgstr "Funções informativas:" -#: ../../c-api/init.rst:38 +#: ../../c-api/init.rst:49 ../../c-api/init.rst:57 msgid ":c:func:`Py_IsInitialized`" msgstr ":c:func:`Py_IsInitialized`" -#: ../../c-api/init.rst:39 +#: ../../c-api/init.rst:50 msgid ":c:func:`PyMem_GetAllocator`" msgstr ":c:func:`PyMem_GetAllocator`" -#: ../../c-api/init.rst:40 +#: ../../c-api/init.rst:51 msgid ":c:func:`PyObject_GetArenaAllocator`" msgstr ":c:func:`PyObject_GetArenaAllocator`" -#: ../../c-api/init.rst:41 +#: ../../c-api/init.rst:52 msgid ":c:func:`Py_GetBuildInfo`" msgstr ":c:func:`Py_GetBuildInfo`" -#: ../../c-api/init.rst:42 +#: ../../c-api/init.rst:53 msgid ":c:func:`Py_GetCompiler`" msgstr ":c:func:`Py_GetCompiler`" -#: ../../c-api/init.rst:43 +#: ../../c-api/init.rst:54 msgid ":c:func:`Py_GetCopyright`" msgstr ":c:func:`Py_GetCopyright`" -#: ../../c-api/init.rst:44 +#: ../../c-api/init.rst:55 msgid ":c:func:`Py_GetPlatform`" msgstr ":c:func:`Py_GetPlatform`" -#: ../../c-api/init.rst:45 +#: ../../c-api/init.rst:56 msgid ":c:func:`Py_GetVersion`" msgstr ":c:func:`Py_GetVersion`" -#: ../../c-api/init.rst:47 +#: ../../c-api/init.rst:59 msgid "Utilities:" msgstr "Utilitários:" -#: ../../c-api/init.rst:49 +#: ../../c-api/init.rst:61 msgid ":c:func:`Py_DecodeLocale`" msgstr ":c:func:`Py_DecodeLocale`" -#: ../../c-api/init.rst:51 +#: ../../c-api/init.rst:62 +msgid "" +"the status reporting and utility functions covered in :ref:`init-config`" +msgstr "" +"o relatório de status e funções utilitárias cobertas em :ref:`init-config`" + +#: ../../c-api/init.rst:64 msgid "Memory allocators:" msgstr "Alocadores de memória:" -#: ../../c-api/init.rst:53 +#: ../../c-api/init.rst:66 msgid ":c:func:`PyMem_RawMalloc`" msgstr ":c:func:`PyMem_RawMalloc`" -#: ../../c-api/init.rst:54 +#: ../../c-api/init.rst:67 msgid ":c:func:`PyMem_RawRealloc`" msgstr ":c:func:`PyMem_RawRealloc`" -#: ../../c-api/init.rst:55 +#: ../../c-api/init.rst:68 msgid ":c:func:`PyMem_RawCalloc`" msgstr ":c:func:`PyMem_RawCalloc`" -#: ../../c-api/init.rst:56 +#: ../../c-api/init.rst:69 msgid ":c:func:`PyMem_RawFree`" msgstr ":c:func:`PyMem_RawFree`" -#: ../../c-api/init.rst:58 +#: ../../c-api/init.rst:71 msgid "Synchronization:" -msgstr "" +msgstr "Sincronização:" -#: ../../c-api/init.rst:60 +#: ../../c-api/init.rst:73 msgid ":c:func:`PyMutex_Lock`" -msgstr "" +msgstr ":c:func:`PyMutex_Lock`" -#: ../../c-api/init.rst:61 +#: ../../c-api/init.rst:74 msgid ":c:func:`PyMutex_Unlock`" -msgstr "" +msgstr ":c:func:`PyMutex_Unlock`" -#: ../../c-api/init.rst:65 +#: ../../c-api/init.rst:78 msgid "" -"The following functions **should not be called** before :c:func:" -"`Py_Initialize`: :c:func:`Py_EncodeLocale`, :c:func:`Py_GetPath`, :c:func:" -"`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, :c:func:" -"`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome`, :c:func:" -"`Py_GetProgramName` and :c:func:`PyEval_InitThreads`." +"Despite their apparent similarity to some of the functions listed above, the " +"following functions **should not be called** before the interpreter has been " +"initialized: :c:func:`Py_EncodeLocale`, :c:func:`Py_GetPath`, :c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, :c:func:`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome`, :c:func:`Py_GetProgramName`, :c:func:`PyEval_InitThreads`, " +"and :c:func:`Py_RunMain`." msgstr "" -"As seguintes funções **não devem ser chamadas** antes :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` e :c:func:`PyEval_InitThreads`." +"Apesar de sua aparente semelhança com algumas das funções listadas acima, as " +"seguintes funções **não devem ser chamadas** antes que o interpretador tenha " +"sido " +"inicializado: :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`, " +"e :c:func:`Py_RunMain`." -#: ../../c-api/init.rst:75 +#: ../../c-api/init.rst:90 msgid "Global configuration variables" msgstr "Variáveis de configuração global" -#: ../../c-api/init.rst:77 +#: ../../c-api/init.rst:92 msgid "" "Python has variables for the global configuration to control different " -"features and options. By default, these flags are controlled by :ref:" -"`command line options `." +"features and options. By default, these flags are controlled " +"by :ref:`command line options `." msgstr "" "Python tem variáveis para a configuração global a fim de controlar " "diferentes características e opções. Por padrão, estes sinalizadores são " "controlados por :ref:`opções de linha de comando `." -#: ../../c-api/init.rst:81 +#: ../../c-api/init.rst:96 msgid "" "When a flag is set by an option, the value of the flag is the number of " -"times that the option was set. For example, ``-b`` sets :c:data:" -"`Py_BytesWarningFlag` to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to " -"2." +"times that the option was set. For example, ``-b`` " +"sets :c:data:`Py_BytesWarningFlag` to 1 and ``-bb`` " +"sets :c:data:`Py_BytesWarningFlag` to 2." msgstr "" "Quando um sinalizador é definido por uma opção, o valor do sinalizador é o " -"número de vezes que a opção foi definida. Por exemplo,``-b`` define :c:data:" -"`Py_BytesWarningFlag` para 1 e ``-bb`` define :c:data:`Py_BytesWarningFlag` " -"para 2." +"número de vezes que a opção foi definida. Por exemplo, ``-b`` " +"define :c:data:`Py_BytesWarningFlag` para 1 e ``-bb`` " +"define :c:data:`Py_BytesWarningFlag` para 2." -#: ../../c-api/init.rst:87 +#: ../../c-api/init.rst:102 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"bytes_warning` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.bytes_warning` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" +"Esta API é mantida para compatibilidade com versões anteriores: a " +"configuração :c:member:`PyConfig.bytes_warning` deve ser usada em seu lugar, " +"consulte :ref:`Configuração de inicialização do Python `." -#: ../../c-api/init.rst:91 +#: ../../c-api/init.rst:106 msgid "" -"Issue a warning when comparing :class:`bytes` or :class:`bytearray` with :" -"class:`str` or :class:`bytes` with :class:`int`. Issue an error if greater " -"or equal to ``2``." +"Issue a warning when comparing :class:`bytes` or :class:`bytearray` " +"with :class:`str` or :class:`bytes` with :class:`int`. Issue an error if " +"greater or equal to ``2``." msgstr "" -"Emite um aviso ao comparar :class:`bytes` ou :class:`bytearray` com :class:" -"`str` ou :class:`bytes` com :class:`int`. Emite um erro se for maior ou " -"igual a ``2``." +"Emite um aviso ao comparar :class:`bytes` ou :class:`bytearray` " +"com :class:`str` ou :class:`bytes` com :class:`int`. Emite um erro se for " +"maior ou igual a ``2``." -#: ../../c-api/init.rst:95 +#: ../../c-api/init.rst:110 msgid "Set by the :option:`-b` option." msgstr "Definida pela opção :option:`-b`." -#: ../../c-api/init.rst:101 +#: ../../c-api/init.rst:116 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"parser_debug` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.parser_debug` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" +"Esta API é mantida para compatibilidade com versões anteriores: a " +"configuração :c:member:`PyConfig.parser_debug` deve ser usada em seu lugar, " +"consulte :ref:`Configuração de inicialização do Python `." -#: ../../c-api/init.rst:105 +#: ../../c-api/init.rst:120 msgid "" "Turn on parser debugging output (for expert only, depending on compilation " "options)." @@ -256,64 +298,77 @@ msgstr "" "Ativa a saída de depuração do analisador sintático (somente para " "especialistas, dependendo das opções de compilação)." -#: ../../c-api/init.rst:108 +#: ../../c-api/init.rst:123 msgid "" "Set by the :option:`-d` option and the :envvar:`PYTHONDEBUG` environment " "variable." msgstr "" -"Definida pela a opção :option:`-d` e a variável de ambiente :envvar:" -"`PYTHONDEBUG`." +"Definida pela a opção :option:`-d` e a variável de " +"ambiente :envvar:`PYTHONDEBUG`." -#: ../../c-api/init.rst:115 +#: ../../c-api/init.rst:130 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"write_bytecode` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.write_bytecode` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" +"Esta API é mantida para compatibilidade com versões anteriores: a " +"configuração :c:member:`PyConfig.write_bytecode` deve ser usada em seu " +"lugar, consulte :ref:`Configuração de inicialização do Python `." -#: ../../c-api/init.rst:119 +#: ../../c-api/init.rst:134 msgid "" "If set to non-zero, Python won't try to write ``.pyc`` files on the import " "of source modules." msgstr "" -"Se definido como diferente de zero, o Python não tentará escrever arquivos " +"Se definida como diferente de zero, o Python não tentará escrever arquivos " "``.pyc`` na importação de módulos fonte." -#: ../../c-api/init.rst:122 +#: ../../c-api/init.rst:137 msgid "" "Set by the :option:`-B` option and the :envvar:`PYTHONDONTWRITEBYTECODE` " "environment variable." msgstr "" -"Definida pela opção :option:`-B` e pela variável de ambiente :envvar:" -"`PYTHONDONTWRITEBYTECODE`." +"Definida pela opção :option:`-B` e pela variável de " +"ambiente :envvar:`PYTHONDONTWRITEBYTECODE`." -#: ../../c-api/init.rst:129 +#: ../../c-api/init.rst:144 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"pathconfig_warnings` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.pathconfig_warnings` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" +"Esta API é mantida para compatibilidade com versões anteriores: a " +"configuração :c:member:`PyConfig.pathconfig_warnings` deve ser usada em seu " +"lugar, consulte :ref:`Configuração de inicialização do Python `." -#: ../../c-api/init.rst:133 +#: ../../c-api/init.rst:148 msgid "" -"Suppress error messages when calculating the module search path in :c:func:" -"`Py_GetPath`." +"Suppress error messages when calculating the module search path " +"in :c:func:`Py_GetPath`." msgstr "" -"Suprime mensagens de erro ao calcular o caminho de pesquisa do módulo em :c:" -"func:`Py_GetPath`." +"Suprime mensagens de erro ao calcular o caminho de pesquisa do módulo " +"em :c:func:`Py_GetPath`." -#: ../../c-api/init.rst:136 +#: ../../c-api/init.rst:151 msgid "Private flag used by ``_freeze_module`` and ``frozenmain`` programs." msgstr "" +"Sinalizador privado usado pelos programas ``_freeze_module`` e " +"``frozenmain``." -#: ../../c-api/init.rst:142 +#: ../../c-api/init.rst:157 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"hash_seed` and :c:member:`PyConfig.use_hash_seed` should be used instead, " +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.hash_seed` " +"and :c:member:`PyConfig.use_hash_seed` should be used instead, " "see :ref:`Python Initialization Configuration `." msgstr "" +"Esta API é mantida para compatibilidade com versões anteriores: a " +"configuração de :c:member:`PyConfig.hash_seed` " +"e :c:member:`PyConfig.use_hash_seed` deve ser usada em seu lugar, " +"consulte :ref:`Configuração de inicialização do Python `." -#: ../../c-api/init.rst:147 +#: ../../c-api/init.rst:162 msgid "" "Set to ``1`` if the :envvar:`PYTHONHASHSEED` environment variable is set to " "a non-empty string." @@ -321,39 +376,48 @@ msgstr "" "Definida como ``1`` se a variável de ambiente :envvar:`PYTHONHASHSEED` " "estiver definida como uma string não vazia." -#: ../../c-api/init.rst:150 +#: ../../c-api/init.rst:165 msgid "" "If the flag is non-zero, read the :envvar:`PYTHONHASHSEED` environment " "variable to initialize the secret hash seed." msgstr "" -"Se o sinalizador for diferente de zero, lê a variável de ambiente :envvar:" -"`PYTHONHASHSEED` para inicializar a semente de hash secreta." +"Se o sinalizador for diferente de zero, lê a variável de " +"ambiente :envvar:`PYTHONHASHSEED` para inicializar a semente de hash secreta." -#: ../../c-api/init.rst:157 +#: ../../c-api/init.rst:172 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"use_environment` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.use_environment` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" +"Esta API é mantida para compatibilidade com versões anteriores: a " +"configuração :c:member:`PyConfig.use_environment` deve ser usada em seu " +"lugar, consulte :ref:`Configuração de inicialização do Python `." -#: ../../c-api/init.rst:161 +#: ../../c-api/init.rst:176 msgid "" -"Ignore all :envvar:`!PYTHON*` environment variables, e.g. :envvar:" -"`PYTHONPATH` and :envvar:`PYTHONHOME`, that might be set." +"Ignore all :envvar:`!PYTHON*` environment variables, " +"e.g. :envvar:`PYTHONPATH` and :envvar:`PYTHONHOME`, that might be set." msgstr "" +"Ignora todas as variáveis de ambiente :envvar:`!PYTHON*`, por " +"exemplo :envvar:`PYTHONPATH` e :envvar:`PYTHONHOME`, que podem estar " +"definidas." -#: ../../c-api/init.rst:164 +#: ../../c-api/init.rst:179 msgid "Set by the :option:`-E` and :option:`-I` options." msgstr "Definida pelas opções :option:`-E` e :option:`-I`." -#: ../../c-api/init.rst:170 +#: ../../c-api/init.rst:185 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"inspect` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.inspect` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" +"Esta API é mantida para compatibilidade com versões anteriores: a " +"configuração :c:member:`PyConfig.inspect` deve ser usada em seu lugar, " +"consulte :ref:`Configuração de inicialização do Python `." -#: ../../c-api/init.rst:174 +#: ../../c-api/init.rst:189 msgid "" "When a script is passed as first argument or the :option:`-c` option is " "used, enter interactive mode after executing the script or the command, even " @@ -363,33 +427,39 @@ msgstr "" "usada, entre no modo interativo após executar o script ou o comando, mesmo " "quando :data:`sys.stdin` não parece ser um terminal." -#: ../../c-api/init.rst:178 +#: ../../c-api/init.rst:193 msgid "" "Set by the :option:`-i` option and the :envvar:`PYTHONINSPECT` environment " "variable." msgstr "" -"Definida pela opção :option:`-i` e pela variável de ambiente :envvar:" -"`PYTHONINSPECT`." +"Definida pela opção :option:`-i` e pela variável de " +"ambiente :envvar:`PYTHONINSPECT`." -#: ../../c-api/init.rst:185 +#: ../../c-api/init.rst:200 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"interactive` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.interactive` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" +"Esta API é mantida para compatibilidade com versões anteriores: a " +"configuração :c:member:`PyConfig.interactive` deve ser usada em seu lugar, " +"consulte :ref:`Configuração de inicialização do Python `." -#: ../../c-api/init.rst:189 +#: ../../c-api/init.rst:204 msgid "Set by the :option:`-i` option." msgstr "Definida pela opção :option:`-i`." -#: ../../c-api/init.rst:195 +#: ../../c-api/init.rst:210 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"isolated` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.isolated` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" +"Esta API é mantida para compatibilidade com versões anteriores: a " +"configuração :c:member:`PyConfig.isolated` deve ser usada em seu lugar, " +"consulte :ref:`Configuração de inicialização do Python `." -#: ../../c-api/init.rst:199 +#: ../../c-api/init.rst:214 msgid "" "Run Python in isolated mode. In isolated mode :data:`sys.path` contains " "neither the script's directory nor the user's site-packages directory." @@ -398,18 +468,22 @@ msgstr "" "contém nem o diretório do script nem o diretório de pacotes de sites do " "usuário." -#: ../../c-api/init.rst:202 +#: ../../c-api/init.rst:217 msgid "Set by the :option:`-I` option." msgstr "Definida pela opção :option:`-I`." -#: ../../c-api/init.rst:210 +#: ../../c-api/init.rst:225 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyPreConfig." -"legacy_windows_fs_encoding` should be used instead, see :ref:`Python " -"Initialization Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyPreConfig.legacy_windows_fs_encoding` should be used " +"instead, see :ref:`Python Initialization Configuration `." msgstr "" +"Esta API é mantida para compatibilidade com versões anteriores: a " +"configuração :c:member:`PyPreConfig.legacy_windows_fs_encoding` deve ser " +"usada em seu lugar, consulte :ref:`Configuração de inicialização do Python " +"`." -#: ../../c-api/init.rst:214 +#: ../../c-api/init.rst:229 msgid "" "If the flag is non-zero, use the ``mbcs`` encoding with ``replace`` error " "handler, instead of the UTF-8 encoding with ``surrogatepass`` error handler, " @@ -417,156 +491,181 @@ msgid "" msgstr "" "Se o sinalizador for diferente de zero, use a codificação ``mbcs`` com o " "tratador de erros ``replace``, em vez da codificação UTF-8 com o tratador de " -"erros ``surrogatepass``, para a codificação do sistema de arquivos e :term:" -"`tratador de erros e codificação do sistema de arquivos`." +"erros ``surrogatepass``, para a codificação do sistema de arquivos " +"e :term:`tratador de erros e codificação do sistema de arquivos`." -#: ../../c-api/init.rst:218 +#: ../../c-api/init.rst:233 msgid "" "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment " "variable is set to a non-empty string." msgstr "" -"Definida como ``1`` se a variável de ambiente :envvar:" -"`PYTHONLEGACYWINDOWSFSENCODING` estiver definida como uma string não vazia." +"Definida como ``1`` se a variável de " +"ambiente :envvar:`PYTHONLEGACYWINDOWSFSENCODING` estiver definida como uma " +"string não vazia." -#: ../../c-api/init.rst:221 +#: ../../c-api/init.rst:236 msgid "See :pep:`529` for more details." msgstr "Veja :pep:`529` para mais detalhes." -#: ../../c-api/init.rst:223 ../../c-api/init.rst:241 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`Disponibilidade `: Windows." +#: ../../c-api/init.rst:238 ../../c-api/init.rst:256 +msgid "Availability" +msgstr "Disponibilidade" -#: ../../c-api/init.rst:229 +#: ../../c-api/init.rst:244 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"legacy_windows_stdio` should be used instead, see :ref:`Python " -"Initialization Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.legacy_windows_stdio` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" +"Esta API é mantida para compatibilidade com versões anteriores: a " +"configuração :c:member:`PyConfig.legacy_windows_stdio` deve ser usada em seu " +"lugar, consulte :ref:`Configuração de inicialização do Python `." -#: ../../c-api/init.rst:233 +#: ../../c-api/init.rst:248 msgid "" -"If the flag is non-zero, use :class:`io.FileIO` instead of :class:`!io." -"_WindowsConsoleIO` for :mod:`sys` standard streams." +"If the flag is non-zero, use :class:`io.FileIO` instead of :class:`!" +"io._WindowsConsoleIO` for :mod:`sys` standard streams." msgstr "" +"Se o sinalizador for diferente de zero, usa :class:`io.FileIO` em vez " +"de :class:`!io._WindowsConsoleIO` para fluxos padrão :mod:`sys`." -#: ../../c-api/init.rst:236 +#: ../../c-api/init.rst:251 msgid "" "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment variable " "is set to a non-empty string." msgstr "" -"Definida como ``1`` se a variável de ambiente :envvar:" -"`PYTHONLEGACYWINDOWSSTDIO` estiver definida como uma string não vazia." +"Definida como ``1`` se a variável de " +"ambiente :envvar:`PYTHONLEGACYWINDOWSSTDIO` estiver definida como uma string " +"não vazia." -#: ../../c-api/init.rst:239 +#: ../../c-api/init.rst:254 msgid "See :pep:`528` for more details." -msgstr "Veja :pep:`528` para mais detalhes." +msgstr "Veja a :pep:`528` para mais detalhes." -#: ../../c-api/init.rst:247 +#: ../../c-api/init.rst:262 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"site_import` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.site_import` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" +"Esta API é mantida para compatibilidade com versões anteriores: a " +"configuração :c:member:`PyConfig.site_import` deve ser usada em seu lugar, " +"consulte :ref:`Configuração de inicialização do Python `." -#: ../../c-api/init.rst:251 +#: ../../c-api/init.rst:266 msgid "" "Disable the import of the module :mod:`site` and the site-dependent " "manipulations of :data:`sys.path` that it entails. Also disable these " -"manipulations if :mod:`site` is explicitly imported later (call :func:`site." -"main` if you want them to be triggered)." +"manipulations if :mod:`site` is explicitly imported later " +"(call :func:`site.main` if you want them to be triggered)." msgstr "" -"Desabilita a importação do módulo :mod:`site` e as manipulações dependentes " -"do site de :data:`sys.path` que isso acarreta. Também desabilita essas " -"manipulações se :mod:`site` for explicitamente importado mais tarde (chame :" -"func:`site.main` se você quiser que eles sejam acionados)." +"Desabilita a importação do módulo :mod:`site` e as manipulações " +"do :data:`sys.path` que isso acarreta. Também desabilita essas manipulações " +"se :mod:`site` for explicitamente importado mais tarde " +"(chame :func:`site.main` se você quiser que eles sejam acionados)." -#: ../../c-api/init.rst:256 +#: ../../c-api/init.rst:271 msgid "Set by the :option:`-S` option." msgstr "Definida pela opção :option:`-S`." -#: ../../c-api/init.rst:262 +#: ../../c-api/init.rst:277 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"user_site_directory` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.user_site_directory` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" +"Esta API é mantida para compatibilidade com versões anteriores: a " +"configuração :c:member:`PyConfig.user_site_directory` deve ser usada em seu " +"lugar, consulte :ref:`Configuração de inicialização do Python `." -#: ../../c-api/init.rst:266 +#: ../../c-api/init.rst:281 msgid "" -"Don't add the :data:`user site-packages directory ` to :data:" -"`sys.path`." +"Don't add the :data:`user site-packages directory ` " +"to :data:`sys.path`." msgstr "" -"Não adiciona o :data:`diretório site-packages de usuário ` a :data:`sys.path`." +"Não adiciona o :data:`diretório site-packages do usuário ` " +"a :data:`sys.path`." -#: ../../c-api/init.rst:269 +#: ../../c-api/init.rst:284 msgid "" -"Set by the :option:`-s` and :option:`-I` options, and the :envvar:" -"`PYTHONNOUSERSITE` environment variable." +"Set by the :option:`-s` and :option:`-I` options, and " +"the :envvar:`PYTHONNOUSERSITE` environment variable." msgstr "" "Definida pelas opções :option:`-s` e :option:`-I`, e pela variável de " "ambiente :envvar:`PYTHONNOUSERSITE`." -#: ../../c-api/init.rst:276 +#: ../../c-api/init.rst:291 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"optimization_level` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.optimization_level` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" +"Esta API é mantida para compatibilidade com versões anteriores: a " +"configuração :c:member:`PyConfig.optimization_level` deve ser usada em seu " +"lugar, consulte :ref:`Configuração de inicialização do Python `." -#: ../../c-api/init.rst:280 +#: ../../c-api/init.rst:295 msgid "" "Set by the :option:`-O` option and the :envvar:`PYTHONOPTIMIZE` environment " "variable." msgstr "" -"Definida pela opção :option:`-O` e pela variável de ambiente :envvar:" -"`PYTHONOPTIMIZE`." +"Definida pela opção :option:`-O` e pela variável de " +"ambiente :envvar:`PYTHONOPTIMIZE`." -#: ../../c-api/init.rst:287 +#: ../../c-api/init.rst:302 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"quiet` should be used instead, see :ref:`Python Initialization Configuration " -"`." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.quiet` should be used instead, see :ref:`Python " +"Initialization Configuration `." msgstr "" +"Esta API é mantida para compatibilidade com versões anteriores: a " +"configuração :c:member:`PyConfig.quiet` deve ser usada em seu lugar, " +"consulte :ref:`Configuração de inicialização do Python `." -#: ../../c-api/init.rst:291 +#: ../../c-api/init.rst:306 msgid "" "Don't display the copyright and version messages even in interactive mode." msgstr "" -"Não exibe as mensagens de direito autoral e de versão nem mesmo no modo " +"Não exibe as mensagens de direitos autorais e de versão nem mesmo no modo " "interativo." -#: ../../c-api/init.rst:293 +#: ../../c-api/init.rst:308 msgid "Set by the :option:`-q` option." msgstr "Definida pela opção :option:`-q`." -#: ../../c-api/init.rst:301 +#: ../../c-api/init.rst:316 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"buffered_stdio` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.buffered_stdio` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" +"Esta API é mantida para compatibilidade com versões anteriores: a " +"configuração :c:member:`PyConfig.buffered_stdio` deve ser usada em seu " +"lugar, consulte :ref:`Configuração de inicialização do Python `." -#: ../../c-api/init.rst:305 +#: ../../c-api/init.rst:320 msgid "Force the stdout and stderr streams to be unbuffered." msgstr "Força os fluxos stdout e stderr a não serem armazenados em buffer." -#: ../../c-api/init.rst:307 +#: ../../c-api/init.rst:322 msgid "" "Set by the :option:`-u` option and the :envvar:`PYTHONUNBUFFERED` " "environment variable." msgstr "" -"Definida pela opção :option:`-u` e pela variável de ambiente :envvar:" -"`PYTHONUNBUFFERED`." +"Definida pela opção :option:`-u` e pela variável de " +"ambiente :envvar:`PYTHONUNBUFFERED`." -#: ../../c-api/init.rst:314 +#: ../../c-api/init.rst:329 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"verbose` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.verbose` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" +"Esta API é mantida para compatibilidade com versões anteriores: a " +"configuração :c:member:`PyConfig.verbose` deve ser usada em seu lugar, " +"consulte :ref:`Configuração de inicialização do Python `." -#: ../../c-api/init.rst:318 +#: ../../c-api/init.rst:333 msgid "" "Print a message each time a module is initialized, showing the place " "(filename or built-in module) from which it is loaded. If greater or equal " @@ -579,97 +678,145 @@ msgstr "" "a busca por um módulo. Também fornece informações sobre a limpeza do módulo " "na saída." -#: ../../c-api/init.rst:323 +#: ../../c-api/init.rst:338 msgid "" "Set by the :option:`-v` option and the :envvar:`PYTHONVERBOSE` environment " "variable." msgstr "" -"Definida pela a opção :option:`-v` e a variável de ambiente :envvar:" -"`PYTHONVERBOSE`." +"Definida pela a opção :option:`-v` e a variável de " +"ambiente :envvar:`PYTHONVERBOSE`." -#: ../../c-api/init.rst:330 +#: ../../c-api/init.rst:345 msgid "Initializing and finalizing the interpreter" msgstr "Inicializando e encerrando o interpretador" -#: ../../c-api/init.rst:345 +#: ../../c-api/init.rst:360 msgid "" "Initialize the Python interpreter. In an application embedding Python, " -"this should be called before using any other Python/C API functions; see :" -"ref:`Before Python Initialization ` for the few exceptions." +"this should be called before using any other Python/C API functions; " +"see :ref:`Before Python Initialization ` for the few " +"exceptions." msgstr "" "Inicializa o interpretador Python. Em uma aplicação que incorpora o Python, " "isto deve ser chamado antes do uso de qualquer outra função do Python/C API; " "veja :ref:`Antes da Inicialização do Python ` para algumas " "exceções." -#: ../../c-api/init.rst:349 +#: ../../c-api/init.rst:364 msgid "" "This initializes the table of loaded modules (``sys.modules``), and creates " -"the fundamental modules :mod:`builtins`, :mod:`__main__` and :mod:`sys`. It " +"the fundamental modules :mod:`builtins`, :mod:`__main__` and :mod:`sys`. It " "also initializes the module search path (``sys.path``). It does not set " -"``sys.argv``; use the new :c:type:`PyConfig` API of the :ref:`Python " -"Initialization Configuration ` for that. This is a no-op when " -"called for a second time (without calling :c:func:`Py_FinalizeEx` first). " -"There is no return value; it is a fatal error if the initialization fails." -msgstr "" - -#: ../../c-api/init.rst:359 ../../c-api/init.rst:373 -msgid "" -"Use the :c:func:`Py_InitializeFromConfig` function to customize the :ref:" -"`Python Initialization Configuration `." +"``sys.argv``; use the :ref:`Python Initialization Configuration ` API for that. This is a no-op when called for a second time " +"(without calling :c:func:`Py_FinalizeEx` first). There is no return value; " +"it is a fatal error if the initialization fails." +msgstr "" +"Isso inicializa a tabela de módulos carregados (``sys.modules``) e cria os " +"módulos fundamentais :mod:`builtins`, :mod:`__main__` e :mod:`sys`. Também " +"inicializa o caminho de pesquisa de módulos (``sys.path``). Isso não define " +"``sys.argv``; use a API da :ref:`Configuração de inicialização do Python " +"` para isso. Isso é um no-op quando chamado pela segunda vez " +"(sem chamar :c:func:`Py_FinalizeEx` primeiro). Não há valor de retorno; é um " +"erro fatal se a inicialização falhar." + +#: ../../c-api/init.rst:372 ../../c-api/init.rst:386 +msgid "" +"Use :c:func:`Py_InitializeFromConfig` to customize the :ref:`Python " +"Initialization Configuration `." msgstr "" +"Usa :c:func:`Py_InitializeFromConfig` para personalizar a :ref:`Configuração " +"de inicialização do Python `." -#: ../../c-api/init.rst:363 +#: ../../c-api/init.rst:376 msgid "" "On Windows, changes the console mode from ``O_TEXT`` to ``O_BINARY``, which " "will also affect non-Python uses of the console using the C Runtime." msgstr "" +"No Windows, altera o modo do console de ``O_TEXT`` para ``O_BINARY``, o que " +"também afetará usos não Python do console usando o Runtime C." -#: ../../c-api/init.rst:369 +#: ../../c-api/init.rst:382 msgid "" "This function works like :c:func:`Py_Initialize` if *initsigs* is ``1``. If " "*initsigs* is ``0``, it skips initialization registration of signal " -"handlers, which might be useful when Python is embedded." +"handlers, which may be useful when CPython is embedded as part of a larger " +"application." +msgstr "" +"Esta função funciona como :c:func:`Py_Initialize` se *initsigs* for ``1``. " +"Se *initsigs* for ``0``, ela pula o registro de inicialização de " +"manipuladores de sinal, o que pode ser útil quando o CPython é incorporado " +"como parte de uma aplicação maior." + +#: ../../c-api/init.rst:392 +msgid "" +"Initialize Python from *config* configuration, as described in :ref:`init-" +"from-config`." msgstr "" +"Inicializa o Python a partir da configuração *config*, conforme descrito " +"em :ref:`init-from-config`." -#: ../../c-api/init.rst:379 +#: ../../c-api/init.rst:395 +msgid "" +"See the :ref:`init-config` section for details on pre-initializing the " +"interpreter, populating the runtime configuration structure, and querying " +"the returned status structure." +msgstr "" +"Consulte a seção :ref:`init-config` para obter detalhes sobre como pré-" +"inicializar o interpretador, preencher a estrutura de configuração do tempo " +"de execução e consultar a estrutura de status retornada." + +#: ../../c-api/init.rst:402 msgid "" "Return true (nonzero) when the Python interpreter has been initialized, " "false (zero) if not. After :c:func:`Py_FinalizeEx` is called, this returns " "false until :c:func:`Py_Initialize` is called again." msgstr "" +"Retorna verdadeiro (diferente de zero) quando o interpretador Python foi " +"inicializado, falso (zero) se não. Após :c:func:`Py_FinalizeEx` ser chamado, " +"isso retorna falso até que :c:func:`Py_Initialize` seja chamado novamente." -#: ../../c-api/init.rst:386 +#: ../../c-api/init.rst:409 msgid "" "Return true (non-zero) if the main Python interpreter is :term:`shutting " "down `. Return false (zero) otherwise." msgstr "" +"Retorna verdadeiro (diferente de zero) se o interpretador Python principal " +"estiver em :term:`desligamento `. Retorna falso (zero) " +"caso contrário." -#: ../../c-api/init.rst:394 +#: ../../c-api/init.rst:417 msgid "" "Undo all initializations made by :c:func:`Py_Initialize` and subsequent use " -"of Python/C API functions, and destroy all sub-interpreters (see :c:func:" -"`Py_NewInterpreter` below) that were created and not yet destroyed since the " -"last call to :c:func:`Py_Initialize`. Ideally, this frees all memory " -"allocated by the Python interpreter. This is a no-op when called for a " -"second time (without calling :c:func:`Py_Initialize` again first)." +"of Python/C API functions, and destroy all sub-interpreters " +"(see :c:func:`Py_NewInterpreter` below) that were created and not yet " +"destroyed since the last call to :c:func:`Py_Initialize`. Ideally, this " +"frees all memory allocated by the Python interpreter. This is a no-op when " +"called for a second time (without calling :c:func:`Py_Initialize` again " +"first)." msgstr "" -#: ../../c-api/init.rst:401 +#: ../../c-api/init.rst:424 msgid "" "Since this is the reverse of :c:func:`Py_Initialize`, it should be called in " "the same thread with the same interpreter active. That means the main " -"thread and the main interpreter. This should never be called while :c:func:" -"`Py_RunMain` is running." +"thread and the main interpreter. This should never be called " +"while :c:func:`Py_RunMain` is running." msgstr "" +"Como isso é o inverso de :c:func:`Py_Initialize`, ele deve ser chamado na " +"mesma thread com o mesmo interpretador ativo. Isso significa a thread " +"principal e o interpretador principal. Isso nunca deve ser chamado " +"enquanto :c:func:`Py_RunMain` estiver em execução." -#: ../../c-api/init.rst:406 +#: ../../c-api/init.rst:429 msgid "" "Normally the return value is ``0``. If there were errors during finalization " "(flushing buffered data), ``-1`` is returned." msgstr "" +"Normalmente, o valor de retorno é ``0``. Se houver erros durante a " +"finalização (limpeza de dados armazenados em buffer), ``-1`` será retornado." -#: ../../c-api/init.rst:410 +#: ../../c-api/init.rst:433 msgid "" "This function is provided for a number of reasons. An embedding application " "might want to restart Python without having to restart the application " @@ -679,8 +826,15 @@ msgid "" "in an application a developer might want to free all memory allocated by " "Python before exiting from the application." msgstr "" +"Esta função é fornecida por vários motivos. Uma aplicação de incorporação " +"pode querer reiniciar o Python sem precisar reiniciar a própria aplicação. " +"Uma aplicação que carregou o interpretador Python de uma biblioteca " +"carregável dinamicamente (ou DLL) pode querer liberar toda a memória alocada " +"pelo Python antes de descarregar a DLL. Durante uma busca por vazamentos de " +"memória em uma aplicação, um desenvolvedor pode querer liberar toda a " +"memória alocada pelo Python antes de sair da aplicação." -#: ../../c-api/init.rst:418 +#: ../../c-api/init.rst:441 msgid "" "**Bugs and caveats:** The destruction of modules and objects in modules is " "done in random order; this may cause destructors (:meth:`~object.__del__` " @@ -692,35 +846,236 @@ msgid "" "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." +"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:429 +#: ../../c-api/init.rst:456 msgid "" -"Raises an :ref:`auditing event ` ``cpython." -"_PySys_ClearAuditHooks`` with no arguments." +"Raises an :ref:`auditing event ` " +"``cpython._PySys_ClearAuditHooks`` with no arguments." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``cpython." -"_PySys_ClearAuditHooks`` sem argumentos." +"Levanta um :ref:`evento de auditoria ` " +"``cpython._PySys_ClearAuditHooks`` sem argumentos." -#: ../../c-api/init.rst:435 +#: ../../c-api/init.rst:463 msgid "" "This is a backwards-compatible version of :c:func:`Py_FinalizeEx` that " "disregards the return value." msgstr "" - -#: ../../c-api/init.rst:440 +"Esta é uma versão retrocompatível de :c:func:`Py_FinalizeEx` que " +"desconsidera o valor de retorno." + +#: ../../c-api/init.rst:469 +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 "" +"Semelhante a :c:func:`Py_Main`, mas *argv* é um vetor de strings de bytes, " +"permitindo que a aplicação chamadora delegue a etapa de decodificação de " +"texto ao ambiente de execução do CPython." + +#: ../../c-api/init.rst:478 +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 "" +"O programa principal para o interpretador padrão, encapsulando um ciclo " +"completo de inicialização/finalização, bem como comportamento adicional para " +"implementar a leitura de configurações do ambiente e da linha de comando e, " +"em seguida, executar ``__main__`` de acordo com a :ref:`using-on-cmdline`." + +#: ../../c-api/init.rst:484 +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 "" +"Isso é disponibilizado para programas que desejam oferecer suporte à " +"interface de linha de comando completa do CPython, em vez de apenas " +"incorporar um ambiente de execução do Python em uma aplicação maior." + +#: ../../c-api/init.rst:488 +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 "" +"Os parâmetros *argc* e *argv* são semelhantes aos passados para a " +"função :c:func:`main` de um programa C, exceto que as entradas *argv* são " +"primeiro convertidas para ``wchar_t`` usando :c:func:`Py_DecodeLocale`. " +"Também é importante observar que as entradas da lista de argumentos podem " +"ser modificadas para apontar para strings diferentes daquelas passadas (no " +"entanto, o conteúdo das strings apontadas pela lista de argumentos não é " +"modificado)." + +#: ../../c-api/init.rst:495 +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 "" +"O valor de retorno é ``2`` se a lista de argumentos não representar uma " +"linha de comando Python válida e, caso contrário, o mesmo " +"que :c:func:`Py_RunMain`." + +#: ../../c-api/init.rst:498 +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 "" +"Em termos das APIs de configuração de tempo de execução do CPython " +"documentadas na seção de :ref:`configuração do ambiente de execução ` (e sem levar em conta o tratamento de erros), ``Py_Main`` é " +"aproximadamente equivalente a::" + +#: ../../c-api/init.rst:502 +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 "" +"PyConfig config;\n" +"PyConfig_InitPythonConfig(&config);\n" +"PyConfig_SetArgv(&config, argc, argv);\n" +"Py_InitializeFromConfig(&config);\n" +"PyConfig_Clear(&config);\n" +"\n" +"Py_RunMain();" + +#: ../../c-api/init.rst:510 +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 "" +"Em uso normal, uma aplicação de incorporação chamará esta função *em vez* de " +"chamar :c:func:`Py_Initialize`, :c:func:`Py_InitializeEx` " +"ou :c:func:`Py_InitializeFromConfig` diretamente, e todas as configurações " +"serão aplicadas conforme descrito em outra parte desta documentação. Se esta " +"função for chamada *após* uma chamada anterior à API de inicialização do " +"ambiente de execução, as configurações de ambiente e de linha de comando que " +"serão atualizadas dependem da versão (pois dependem de quais configurações " +"oferecem suporte corretamente à modificação após já terem sido definidas uma " +"vez na primeira inicialização do ambiente de execução)." + +#: ../../c-api/init.rst:523 +msgid "Executes the main module in a fully configured CPython runtime." +msgstr "" +"Executa o módulo principal em um ambiente de execução CPython totalmente " +"configurado." + +#: ../../c-api/init.rst:525 +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 "" +"Executa o comando (:c:member:`PyConfig.run_command`), o script " +"(:c:member:`PyConfig.run_filename`) ou o módulo " +"(:c:member:`PyConfig.run_module`) especificado na linha de comando ou na " +"configuração. Se nenhum desses valores estiver definido, executa o prompt " +"interativo do Python (REPL) usando o espaço de nomes global do módulo " +"``__main__``." + +#: ../../c-api/init.rst:531 +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." +msgstr "" +"Se :c:member:`PyConfig.inspect` não estiver definido (o padrão), o valor de " +"retorno será ``0`` se o interpretador terminar normalmente (ou seja, sem " +"levantar uma exceção), o status de saída de uma exceção :exc:`SystemExit` " +"não tratada ou ``1`` para qualquer outra exceção não tratada." + +#: ../../c-api/init.rst:536 +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." +msgstr "" +"Se :c:member:`PyConfig.inspect` estiver definido (como quando a " +"opção :option:`-i` é usada), em vez de retornar quando o interpretador for " +"encerrado, a execução será retomada em um prompt interativo do Python (REPL) " +"usando o espaço de nomes global do módulo ``__main__``. Se o interpretador " +"for encerrado com uma exceção, ela será imediatamente levantada na sessão do " +"REPL. O valor de retorno da função é então determinado pela forma como a " +"*sessão do REPL* termina: ``0``, ``1`` ou o status de uma " +"exceção :exc:`SystemExit`, conforme especificado acima." + +#: ../../c-api/init.rst:544 +msgid "" +"This function always finalizes the Python interpreter before it returns." +msgstr "Essa função sempre finaliza o interpretador Python antes de retornar." + +#: ../../c-api/init.rst:546 +msgid "" +"See :ref:`Python Configuration ` for an example of a " +"customized Python that always runs in isolated mode " +"using :c:func:`Py_RunMain`." +msgstr "" +"Consulte a :ref:`Configuração do Python ` para obter um " +"exemplo de um Python personalizado que sempre é executado em modo isolado " +"usando :c:func:`Py_RunMain`." + +#: ../../c-api/init.rst:552 +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 "" +"Registra uma função de retorno de chamada :mod:`atexit` para o interpretador " +"de destino *interp*. Isso é semelhante a :c:func:`Py_AtExit`, mas recebe um " +"interpretador explícito e um ponteiro de dados para a função de retorno de " +"chamada." + +#: ../../c-api/init.rst:556 +msgid "The :term:`GIL` must be held for *interp*." +msgstr "" + +#: ../../c-api/init.rst:561 msgid "Process-wide parameters" -msgstr "" +msgstr "Parâmetros de todo o processo" -#: ../../c-api/init.rst:450 +#: ../../c-api/init.rst:571 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"program_name` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.program_name` should be used instead, " +"see :ref:`Python Initialization Configuration `." msgstr "" +"Esta API é mantida para compatibilidade com versões anteriores: em vez " +"disso, deve-se usar a configuração :c:member:`PyConfig.program_name`, " +"consulte :ref:`Configuração de inicialização do Python `." -#: ../../c-api/init.rst:454 +#: ../../c-api/init.rst:575 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 " @@ -744,37 +1099,45 @@ msgstr "" "programa. Nenhum código no interpretador Python mudará o conteúdo deste " "armazenamento." -#: ../../c-api/init.rst:465 ../../c-api/init.rst:704 ../../c-api/init.rst:740 -#: ../../c-api/init.rst:766 +#: ../../c-api/init.rst:586 ../../c-api/init.rst:828 ../../c-api/init.rst:864 +#: ../../c-api/init.rst:890 msgid "" -"Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a :c:expr:" -"`wchar_*` string." +"Use :c:func:`Py_DecodeLocale` to decode a bytes string to get " +"a :c:expr:`wchar_t*` string." msgstr "" +"Use :c:func:`Py_DecodeLocale` para decodificar uma string de bytes e obter " +"uma string :c:expr:`wchar_t*`." -#: ../../c-api/init.rst:473 +#: ../../c-api/init.rst:594 msgid "" "Return the program name set with :c:member:`PyConfig.program_name`, or the " "default. The returned string points into static storage; the caller should " "not modify its value." msgstr "" +"Retorna o nome do programa definido com :c:member:`PyConfig.program_name`, " +"ou o valor padrão. A string retornada aponta para um armazenamento estático; " +"o chamador não deve modificar seu valor." -#: ../../c-api/init.rst:477 ../../c-api/init.rst:499 ../../c-api/init.rst:543 -#: ../../c-api/init.rst:564 ../../c-api/init.rst:590 ../../c-api/init.rst:778 +#: ../../c-api/init.rst:598 ../../c-api/init.rst:620 ../../c-api/init.rst:666 +#: ../../c-api/init.rst:688 ../../c-api/init.rst:714 ../../c-api/init.rst:902 msgid "" "This function should not be called before :c:func:`Py_Initialize`, otherwise " "it returns ``NULL``." msgstr "" +"Esta função não deve ser chamada antes de :c:func:`Py_Initialize`, caso " +"contrário ela retorna ``NULL``." -#: ../../c-api/init.rst:480 ../../c-api/init.rst:502 ../../c-api/init.rst:546 -#: ../../c-api/init.rst:567 ../../c-api/init.rst:595 ../../c-api/init.rst:781 +#: ../../c-api/init.rst:601 ../../c-api/init.rst:623 ../../c-api/init.rst:669 +#: ../../c-api/init.rst:691 ../../c-api/init.rst:719 ../../c-api/init.rst:905 msgid "It now returns ``NULL`` if called before :c:func:`Py_Initialize`." msgstr "" +"Agora retorna ``NULL`` se for chamada antes de :c:func:`Py_Initialize`." -#: ../../c-api/init.rst:483 ../../c-api/init.rst:570 +#: ../../c-api/init.rst:604 ../../c-api/init.rst:694 msgid "Get :data:`sys.executable` instead." msgstr "" -#: ../../c-api/init.rst:489 +#: ../../c-api/init.rst:610 msgid "" "Return the *prefix* for installed platform-independent files. This is " "derived through a number of complicated rules from the program name set " @@ -784,29 +1147,53 @@ msgid "" "should not modify its value. This corresponds to the :makevar:`prefix` " "variable in the top-level :file:`Makefile` and the :option:`--prefix` " "argument to the :program:`configure` script at build time. The value is " -"available to Python code as ``sys.prefix``. It is only useful on Unix. See " -"also the next function." +"available to Python code as ``sys.base_prefix``. It is only useful on Unix. " +"See also the next function." msgstr "" +"Retorna o *prefix* para arquivos instalados que independem da plataforma. " +"Este prefixo é derivado de uma série de regras complexas a partir do nome do " +"programa definido com :c:member:`PyConfig.program_name` e algumas variáveis " +"de ambiente; por exemplo, se o nome do programa for ``'/usr/local/bin/" +"python'``, o prefixo será ``'/usr/local'``. A string retornada aponta para " +"um armazenamento estático; o chamador não deve modificar seu valor. Isso " +"corresponde à variável :makevar:`prefix` no arquivo :file:`Makefile` de " +"nível superior e ao argumento :option:`--prefix` do " +"script :program:`configure` em tempo de construção. O valor está disponível " +"para o código Python como ``sys.base_prefix``. É útil apenas em sistemas " +"Unix. Veja também a próxima função." -#: ../../c-api/init.rst:505 -msgid "Get :data:`sys.prefix` instead." +#: ../../c-api/init.rst:626 +msgid "" +"Get :data:`sys.base_prefix` instead, or :data:`sys.prefix` if :ref:`virtual " +"environments ` need to be handled." msgstr "" -#: ../../c-api/init.rst:511 +#: ../../c-api/init.rst:633 msgid "" "Return the *exec-prefix* for installed platform-*dependent* files. This is " "derived through a number of complicated rules from the program name set " "with :c:member:`PyConfig.program_name` and some environment variables; for " "example, if the program name is ``'/usr/local/bin/python'``, the exec-prefix " "is ``'/usr/local'``. The returned string points into static storage; the " -"caller should not modify its value. This corresponds to the :makevar:" -"`exec_prefix` variable in the top-level :file:`Makefile` and the ``--exec-" -"prefix`` argument to the :program:`configure` script at build time. The " -"value is available to Python code as ``sys.exec_prefix``. It is only useful " -"on Unix." -msgstr "" - -#: ../../c-api/init.rst:521 +"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 "" +"Retorna o *exec-prefix* para arquivos instalados que *dependem* da " +"plataforma. Este prefixo é derivado de uma série de regras complexas a " +"partir do nome do programa definido com :c:member:`PyConfig.program_name` e " +"algumas variáveis de ambiente; por exemplo, se o nome do programa for ``'/" +"usr/local/bin/python'``, o exec-prefix será ``'/usr/local'``. A string " +"retornada aponta para um armazenamento estático; o chamador não deve " +"modificar seu valor. Isso corresponde à variável :makevar:`exec_prefix` no " +"arquivo :file:`Makefile` de nível superior e ao argumento ``--exec-prefix`` " +"do script :program:`configure` em tempo de construção. O valor está " +"disponível para o código Python como ``sys.base_exec_prefix``. É útil apenas " +"em sistemas Unix." + +#: ../../c-api/init.rst:644 msgid "" "Background: The exec-prefix differs from the prefix when platform dependent " "files (such as executables and shared libraries) are installed in a " @@ -814,8 +1201,14 @@ msgid "" "files may be installed in the :file:`/usr/local/plat` subtree while platform " "independent may be installed in :file:`/usr/local`." msgstr "" +"Contexto: O exec-prefix difere do prefixo padrão quando arquivos dependentes " +"da plataforma (como executáveis e bibliotecas compartilhadas) são instalados " +"em uma árvore de diretórios diferente. Em uma instalação típica, arquivos " +"dependentes da plataforma podem ser instalados na subárvore :file:`/usr/" +"local/plat`, enquanto arquivos independentes da plataforma podem ser " +"instalados em :file:`/usr/local`." -#: ../../c-api/init.rst:527 +#: ../../c-api/init.rst:650 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 " @@ -828,20 +1221,37 @@ msgid "" "Note that compiled Python bytecode files are platform independent (but not " "independent from the Python version by which they were compiled!)." msgstr "" +"De modo geral, uma plataforma é uma combinação de famílias de hardware e " +"software. Por exemplo, máquinas Sparc executando o sistema operacional " +"Solaris 2.x são consideradas a mesma plataforma, mas máquinas Intel " +"executando Solaris 2.x são outra plataforma, e máquinas Intel executando " +"Linux são uma terceira. Diferentes revisões principais do mesmo sistema " +"operacional geralmente também formam plataformas diferentes. Sistemas " +"operacionais não-Unix são um caso à parte; as estratégias de instalação " +"nesses sistemas são tão diferentes que o prefixo e o prefixo de execução são " +"irrelevantes e definidos como uma string vazia. Observe que arquivos de " +"bytecode Python compilados são independentes de plataforma (mas não " +"independentes da versão do Python com a qual foram compilados!)." -#: ../../c-api/init.rst:538 +#: ../../c-api/init.rst:661 msgid "" -"System administrators will know how to configure the :program:`mount` or :" -"program:`automount` programs to share :file:`/usr/local` between platforms " -"while having :file:`/usr/local/plat` be a different filesystem for each " -"platform." +"System administrators will know how to configure the :program:`mount` " +"or :program:`automount` programs to share :file:`/usr/local` between " +"platforms while having :file:`/usr/local/plat` be a different filesystem for " +"each platform." msgstr "" +"Os administradores de sistema saberão como configurar os " +"programas :program:`mount` ou :program:`automount` para compartilhar o " +"arquivo :file:`/usr/local` entre plataformas, mantendo o arquivo :file:`/usr/" +"local/plat` como um sistema de arquivos diferente para cada plataforma." -#: ../../c-api/init.rst:549 -msgid "Get :data:`sys.exec_prefix` instead." +#: ../../c-api/init.rst:672 +msgid "" +"Get :data:`sys.base_exec_prefix` instead, or :data:`sys.exec_prefix` " +"if :ref:`virtual environments ` need to be handled." msgstr "" -#: ../../c-api/init.rst:558 +#: ../../c-api/init.rst:682 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 " @@ -849,8 +1259,14 @@ msgid "" "into static storage; the caller should not modify its value. The value is " "available to Python code as ``sys.executable``." msgstr "" +"Retorna o nome completo do executável Python; este valor é calculado como um " +"efeito colateral da obtenção do caminho de pesquisa de módulos padrão a " +"partir do nome do programa (definido por :c:member:`PyConfig.program_name`). " +"A string retornada aponta para um armazenamento estático; o chamador não " +"deve modificar seu valor. O valor está disponível para o código Python como " +"``sys.executable``." -#: ../../c-api/init.rst:580 +#: ../../c-api/init.rst:704 msgid "" "Return the default module search path; this is computed from the program " "name (set by :c:member:`PyConfig.program_name`) and some environment " @@ -862,12 +1278,22 @@ msgid "" "startup; it can be (and usually is) modified later to change the search path " "for loading modules." msgstr "" - -#: ../../c-api/init.rst:598 +"Retorna o caminho de pesquisa de módulos padrão; este é calculado a partir " +"do nome do programa (definido por :c:member:`PyConfig.program_name`) e " +"algumas variáveis de ambiente. A string retornada consiste em uma série de " +"nomes de diretórios separados por um caractere delimitador que depende da " +"plataforma. O caractere delimitador é ``':'`` no Unix e macOS, e ``';'`` no " +"Windows. A string retornada aponta para um armazenamento estático; o " +"chamador não deve modificar seu valor. A lista :data:`sys.path` é " +"inicializada com este valor na inicialização do interpretador; ela pode ser " +"(e geralmente é) modificada posteriormente para alterar o caminho de " +"pesquisa para carregamento de módulos." + +#: ../../c-api/init.rst:722 msgid "Get :data:`sys.path` instead." msgstr "" -#: ../../c-api/init.rst:604 +#: ../../c-api/init.rst:728 msgid "" "Return the version of this Python interpreter. This is a string that looks " "something like ::" @@ -875,20 +1301,29 @@ msgstr "" "Retorna a verão deste interpretador Python. Esta é uma string que se parece " "com ::" -#: ../../c-api/init.rst:611 +#: ../../c-api/init.rst:731 +msgid "\"3.0a5+ (py3k:63103M, May 12 2008, 00:53:55) \\n[GCC 4.2.3]\"" +msgstr "\"3.0a5+ (py3k:63103M, May 12 2008, 00:53:55) \\n[GCC 4.2.3]\"" + +#: ../../c-api/init.rst:735 msgid "" "The first word (up to the first space character) is the current Python " "version; the first characters are the major and minor version separated by a " "period. The returned string points into static storage; the caller should " -"not modify its value. The value is available to Python code as :data:`sys." -"version`." +"not modify its value. The value is available to Python code " +"as :data:`sys.version`." msgstr "" +"A primeira palavra (até o primeiro espaço em branco) representa a versão " +"atual do Python; os primeiros caracteres indicam a versão principal e a " +"versão secundária, separados por um ponto. A string retornada aponta para um " +"armazenamento estático; o chamador não deve modificar seu valor. O valor " +"fica disponível para o código Python como :data:`sys.version`." -#: ../../c-api/init.rst:616 +#: ../../c-api/init.rst:740 msgid "See also the :c:var:`Py_Version` constant." -msgstr "" +msgstr "Veja também a constante :c:var:`Py_Version`." -#: ../../c-api/init.rst:623 +#: ../../c-api/init.rst:747 msgid "" "Return the platform identifier for the current platform. On Unix, this is " "formed from the \"official\" name of the operating system, converted to " @@ -898,8 +1333,15 @@ msgid "" "into static storage; the caller should not modify its value. The value is " "available to Python code as ``sys.platform``." msgstr "" +"Retorna o identificador da plataforma atual. No Unix, este identificador é " +"formado pelo nome \"oficial\" do sistema operacional, convertido para " +"minúsculas, seguido pelo número da revisão principal; por exemplo, para " +"Solaris 2.x, também conhecido como SunOS 5.x, o valor é ``'sunos5'``. No " +"macOS, é ``'darwin'``. No Windows, é ``'win'``. A string retornada aponta " +"para um armazenamento estático; o chamador não deve modificar seu valor. O " +"valor está disponível para o código Python como ``sys.platform``." -#: ../../c-api/init.rst:634 +#: ../../c-api/init.rst:758 msgid "" "Return the official copyright string for the current Python version, for " "example" @@ -907,17 +1349,20 @@ msgstr "" "Retorna a string oficial de direitos autoriais para a versão atual do " "Python, por exemplo" -#: ../../c-api/init.rst:636 +#: ../../c-api/init.rst:760 msgid "``'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam'``" -msgstr "" +msgstr "``'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam'``" -#: ../../c-api/init.rst:640 +#: ../../c-api/init.rst:764 msgid "" "The returned string points into static storage; the caller should not modify " "its value. The value is available to Python code as ``sys.copyright``." msgstr "" +"A string retornada aponta para o armazenamento estático; o chamador não deve " +"modificar o seu valor. O valor está disponível para o código Python como " +"``sys.copyright``." -#: ../../c-api/init.rst:646 +#: ../../c-api/init.rst:770 msgid "" "Return an indication of the compiler used to build the current Python " "version, in square brackets, for example::" @@ -925,14 +1370,21 @@ msgstr "" "Retorna uma indicação do compilador usado para construir a atual versão do " "Python, em colchetes, por exemplo::" -#: ../../c-api/init.rst:653 ../../c-api/init.rst:667 +#: ../../c-api/init.rst:773 +msgid "\"[GCC 2.7.2.2]\"" +msgstr "\"[GCC 2.7.2.2]\"" + +#: ../../c-api/init.rst:777 ../../c-api/init.rst:791 msgid "" "The returned string points into static storage; the caller should not modify " "its value. The value is available to Python code as part of the variable " "``sys.version``." msgstr "" +"A string retornada aponta para o armazenamento estático; o chamador não deve " +"modificar o seu valor. O valor está disponível para o código Python como " +"``sys.version``." -#: ../../c-api/init.rst:660 +#: ../../c-api/init.rst:784 msgid "" "Return information about the sequence number and build date and time of the " "current Python interpreter instance, for example ::" @@ -940,15 +1392,24 @@ msgstr "" "Retorna informação sobre o número de sequência e a data e hora da construção " "da instância atual do interpretador Python, por exemplo ::" -#: ../../c-api/init.rst:679 +#: ../../c-api/init.rst:787 +msgid "\"#67, Aug 1 1997, 22:34:28\"" +msgstr "\"#67, Aug 1 1997, 22:34:28\"" + +#: ../../c-api/init.rst:803 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"argv`, :c:member:`PyConfig.parse_argv` and :c:member:`PyConfig.safe_path` " -"should be used instead, see :ref:`Python Initialization Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.argv`, :c:member:`PyConfig.parse_argv` " +"and :c:member:`PyConfig.safe_path` should be used instead, see :ref:`Python " +"Initialization Configuration `." msgstr "" +"Esta API é mantida para compatibilidade com versões anteriores: em vez " +"disso, deve-se usar a " +"configuração :c:member:`PyConfig.argv`, :c:member:`PyConfig.parse_argv` " +"e :c:member:`PyConfig.safe_path`, consulte :ref:`Configuração de " +"inicialização do Python `." -#: ../../c-api/init.rst:684 +#: ../../c-api/init.rst:808 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 " @@ -958,8 +1419,15 @@ msgid "" "empty string. If this function fails to initialize :data:`sys.argv`, a " "fatal condition is signalled using :c:func:`Py_FatalError`." msgstr "" +"Define :data:`sys.argv` com base em *argc* e *argv*. Esses parâmetros são " +"semelhantes aos passados para a função :c:func:`main` do programa, com a " +"diferença de que a primeira entrada deve se referir ao arquivo de script a " +"ser executado, em vez do executável que hospeda o interpretador Python. Se " +"não houver um script a ser executado, a primeira entrada em *argv* pode ser " +"uma string vazia. Se esta função falhar ao inicializar :data:`sys.argv`, uma " +"condição fatal será sinalizada usando :c:func:`Py_FatalError`." -#: ../../c-api/init.rst:692 +#: ../../c-api/init.rst:816 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 " @@ -969,98 +1437,140 @@ msgstr "" "é zero, a função também modifica :data:`sys.path` de acordo com o seguinte " "algoritmo:" -#: ../../c-api/init.rst:696 +#: ../../c-api/init.rst:820 msgid "" "If the name of an existing script is passed in ``argv[0]``, the absolute " -"path of the directory where the script is located is prepended to :data:`sys." -"path`." +"path of the directory where the script is located is prepended " +"to :data:`sys.path`." msgstr "" +"Se o nome de um script existente for passado em ``argv[0]``, o caminho " +"absoluto do diretório onde o script está localizado será adicionado " +"a :data:`sys.path`." -#: ../../c-api/init.rst:699 +#: ../../c-api/init.rst:823 msgid "" "Otherwise (that is, if *argc* is ``0`` or ``argv[0]`` doesn't point to an " "existing file name), an empty string is prepended to :data:`sys.path`, which " "is the same as prepending the current working directory (``\".\"``)." msgstr "" +"Caso contrário (isto é, se *argc* for ``0`` ou ``argv[0]`` não apontar para " +"um nome de arquivo existente), uma string vazia é adicionada ao início " +"de :data:`sys.path`, o que é o mesmo que adicionar o diretório de trabalho " +"atual (``\".\"``)." -#: ../../c-api/init.rst:707 ../../c-api/init.rst:743 +#: ../../c-api/init.rst:831 ../../c-api/init.rst:867 msgid "" "See also :c:member:`PyConfig.orig_argv` and :c:member:`PyConfig.argv` " "members of the :ref:`Python Initialization Configuration `." msgstr "" +"Veja também os membros :c:member:`PyConfig.orig_argv` " +"e :c:member:`PyConfig.argv` da :ref:`Configuração de inicialização do Python " +"`." -#: ../../c-api/init.rst:711 +#: ../../c-api/init.rst:835 msgid "" "It is recommended that applications embedding the Python interpreter for " "purposes other than executing a single script pass ``0`` as *updatepath*, " "and update :data:`sys.path` themselves if desired. See :cve:`2008-5983`." msgstr "" +"Recomenda-se que aplicações que incorporam o interpretador Python para fins " +"que não sejam a execução de um único script passem ``0`` como *updatepath*, " +"e atualizem :data:`sys.path` por conta própria, se desejarem. " +"Veja :cve:`2008-5983`." -#: ../../c-api/init.rst:716 +#: ../../c-api/init.rst:840 msgid "" "On versions before 3.1.3, you can achieve the same effect by manually " -"popping the first :data:`sys.path` element after having called :c:func:" -"`PySys_SetArgv`, for example using::" +"popping the first :data:`sys.path` element after having " +"called :c:func:`PySys_SetArgv`, for example using::" msgstr "" +"Em versões anteriores à 3.1.3, você pode obter o mesmo efeito removendo " +"manualmente o primeiro elemento de :data:`sys.path` após ter " +"chamado :c:func:`PySys_SetArgv`, por exemplo, usando::" -#: ../../c-api/init.rst:732 +#: ../../c-api/init.rst:844 +msgid "PyRun_SimpleString(\"import sys; sys.path.pop(0)\\n\");" +msgstr "PyRun_SimpleString(\"import sys; sys.path.pop(0)\\n\");" + +#: ../../c-api/init.rst:856 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"argv` and :c:member:`PyConfig.parse_argv` should be used instead, see :ref:" -"`Python Initialization Configuration `." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.argv` and :c:member:`PyConfig.parse_argv` should " +"be used instead, see :ref:`Python Initialization Configuration `." msgstr "" +"Esta API é mantida para retrocompatibilidade: em vez disso, devem ser usadas " +"as configurações :c:member:`PyConfig.argv` " +"e :c:member:`PyConfig.parse_argv`, consulte a :ref:`Configuração de " +"inicialização do Python `." -#: ../../c-api/init.rst:736 +#: ../../c-api/init.rst:860 msgid "" "This function works like :c:func:`PySys_SetArgvEx` with *updatepath* set to " -"``1`` unless the :program:`python` interpreter was started with the :option:" -"`-I`." +"``1`` unless the :program:`python` interpreter was started with " +"the :option:`-I`." msgstr "" +"Esta função funciona como :c:func:`PySys_SetArgvEx` com *updatepath* " +"definido como ``1`` a menos que o interpretador :program:`python` tenha sido " +"iniciado com a :option:`-I`." -#: ../../c-api/init.rst:746 +#: ../../c-api/init.rst:870 msgid "The *updatepath* value depends on :option:`-I`." -msgstr "" +msgstr "O valor *updatepath* depende de :option:`-I`." -#: ../../c-api/init.rst:753 +#: ../../c-api/init.rst:877 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"home` should be used instead, see :ref:`Python Initialization Configuration " -"`." +"This API is kept for backward compatibility: " +"setting :c:member:`PyConfig.home` should be used instead, see :ref:`Python " +"Initialization Configuration `." msgstr "" +"Esta API é mantida para retrocompatibilidade: em vez disso, deve-se usar a " +"configuração :c:member:`PyConfig.home`, consulte a :ref:`Configuração de " +"inicialização do Python `." -#: ../../c-api/init.rst:757 +#: ../../c-api/init.rst:881 msgid "" "Set the default \"home\" directory, that is, the location of the standard " "Python libraries. See :envvar:`PYTHONHOME` for the meaning of the argument " "string." msgstr "" +"Define o diretório pessoal (\"home\") padrão, ou seja, o local das " +"bibliotecas padrão do Python. Consulte :envvar:`PYTHONHOME` para obter o " +"significado da string do argumento." -#: ../../c-api/init.rst:761 +#: ../../c-api/init.rst:885 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 " "execution. No code in the Python interpreter will change the contents of " "this storage." msgstr "" +"O argumento deve apontar para uma string terminada em zero em um " +"armazenamento estático, cujo conteúdo não será alterado durante a execução " +"do programa. Nenhum código no interpretador Python alterará o conteúdo desse " +"armazenamento." -#: ../../c-api/init.rst:774 +#: ../../c-api/init.rst:898 msgid "" -"Return the default \"home\", that is, the value set by :c:member:`PyConfig." -"home`, or the value of the :envvar:`PYTHONHOME` environment variable if it " -"is set." +"Return the default \"home\", that is, the value set " +"by :c:member:`PyConfig.home`, or the value of the :envvar:`PYTHONHOME` " +"environment variable if it is set." msgstr "" +"Retorna o \"home\" padrão, ou seja, o valor definido " +"por :c:member:`PyConfig.home`, ou o valor da variável de " +"ambiente :envvar:`PYTHONHOME` se estiver definida." -#: ../../c-api/init.rst:784 +#: ../../c-api/init.rst:908 msgid "" "Get :c:member:`PyConfig.home` or :envvar:`PYTHONHOME` environment variable " "instead." msgstr "" -#: ../../c-api/init.rst:792 +#: ../../c-api/init.rst:916 msgid "Thread State and the Global Interpreter Lock" -msgstr "" +msgstr "Estado de thread e a trava global do interpretador" -#: ../../c-api/init.rst:799 +#: ../../c-api/init.rst:923 msgid "" "The Python interpreter is not fully thread-safe. In order to support multi-" "threaded Python programs, there's a global lock, called the :term:`global " @@ -1072,17 +1582,25 @@ msgid "" "once instead of twice." msgstr "" -#: ../../c-api/init.rst:809 +#: ../../c-api/init.rst:933 msgid "" -"Therefore, the rule exists that only the thread that has acquired the :term:" -"`GIL` may operate on Python objects or call Python/C API functions. In order " -"to emulate concurrency of execution, the interpreter regularly tries to " -"switch threads (see :func:`sys.setswitchinterval`). The lock is also " -"released around potentially blocking I/O operations like reading or writing " -"a file, so that other Python threads can run in the meantime." +"Therefore, the rule exists that only the thread that has acquired " +"the :term:`GIL` may operate on Python objects or call Python/C API " +"functions. In order to emulate concurrency of execution, the interpreter " +"regularly tries to switch threads (see :func:`sys.setswitchinterval`). The " +"lock is also released around potentially blocking I/O operations like " +"reading or writing a file, so that other Python threads can run in the " +"meantime." msgstr "" +"Portanto, existe a regra de que somente a thread que adquiriu a :term:`GIL` " +"pode operar em objetos Python ou chamar funções da API C/Python. Para emular " +"a simultaneidade de execução, o interpretador tenta alternar threads " +"regularmente (consulte :func:`sys.setswitchinterval`). A trava também é " +"liberada em operações de E/S potencialmente bloqueantes, como ler ou " +"escrever um arquivo, para que outras threads Python possam ser executadas " +"enquanto isso." -#: ../../c-api/init.rst:819 +#: ../../c-api/init.rst:943 msgid "" "The Python interpreter keeps some thread-specific bookkeeping information " "inside a data structure called :c:type:`PyThreadState`. There's also one " @@ -1090,11 +1608,11 @@ msgid "" "retrieved using :c:func:`PyThreadState_Get`." msgstr "" -#: ../../c-api/init.rst:825 +#: ../../c-api/init.rst:949 msgid "Releasing the GIL from extension code" msgstr "" -#: ../../c-api/init.rst:827 +#: ../../c-api/init.rst:951 msgid "" "Most extension code manipulating the :term:`GIL` has the following simple " "structure::" @@ -1102,11 +1620,30 @@ msgstr "" "A maioria dos códigos de extensão que manipulam a :term:`GIL` tem a seguinte " "estrutura::" -#: ../../c-api/init.rst:836 +#: ../../c-api/init.rst:954 +msgid "" +"Save the thread state in a local variable.\n" +"Release the global interpreter lock.\n" +"... Do some blocking I/O operation ...\n" +"Reacquire the global interpreter lock.\n" +"Restore the thread state from the local variable." +msgstr "" + +#: ../../c-api/init.rst:960 msgid "This is so common that a pair of macros exists to simplify it::" +msgstr "Isso é tão comum que existe um par de macros para simplificá-lo::" + +#: ../../c-api/init.rst:962 +msgid "" +"Py_BEGIN_ALLOW_THREADS\n" +"... Do some blocking I/O operation ...\n" +"Py_END_ALLOW_THREADS" msgstr "" +"Py_BEGIN_ALLOW_THREADS\n" +"... Faça alguma operação de E/S com bloqueio...\n" +"Py_END_ALLOW_THREADS" -#: ../../c-api/init.rst:846 +#: ../../c-api/init.rst:970 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 " @@ -1115,11 +1652,25 @@ msgstr "" "A macro :c:macro:`Py_BEGIN_ALLOW_THREADS` abre um novo bloco e declara uma " "variável local oculta; a macro :c:macro:`Py_END_ALLOW_THREADS` fecha o bloco." -#: ../../c-api/init.rst:850 +#: ../../c-api/init.rst:974 msgid "The block above expands to the following code::" +msgstr "O bloco acima se expande para o seguinte código::" + +#: ../../c-api/init.rst:976 +msgid "" +"PyThreadState *_save;\n" +"\n" +"_save = PyEval_SaveThread();\n" +"... Do some blocking I/O operation ...\n" +"PyEval_RestoreThread(_save);" msgstr "" +"PyThreadState *_save;\n" +"\n" +"_save = PyEval_SaveThread();\n" +"... Faça alguma operação de E/S com bloqueio...\n" +"PyEval_RestoreThread(_save);" -#: ../../c-api/init.rst:862 +#: ../../c-api/init.rst:986 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 " @@ -1130,7 +1681,7 @@ msgid "" "state, the lock must be acquired before storing the thread state pointer." msgstr "" -#: ../../c-api/init.rst:871 +#: ../../c-api/init.rst:995 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 " @@ -1140,21 +1691,21 @@ msgid "" "compressing or hashing data." msgstr "" -#: ../../c-api/init.rst:882 +#: ../../c-api/init.rst:1006 msgid "Non-Python created threads" -msgstr "" +msgstr "Threads não-Python criadas" -#: ../../c-api/init.rst:884 +#: ../../c-api/init.rst:1008 msgid "" -"When threads are created using the dedicated Python APIs (such as the :mod:" -"`threading` module), a thread state is automatically associated to them and " -"the code showed above is therefore correct. However, when threads are " -"created from C (for example by a third-party library with its own thread " +"When threads are created using the dedicated Python APIs (such as " +"the :mod:`threading` module), a thread state is automatically associated to " +"them and the code showed above is therefore correct. However, when threads " +"are created from C (for example by a third-party library with its own thread " "management), they don't hold the GIL, nor is there a thread state structure " "for them." msgstr "" -#: ../../c-api/init.rst:891 +#: ../../c-api/init.rst:1015 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 " @@ -1165,27 +1716,52 @@ msgid "" "finally free the thread state data structure." msgstr "" -#: ../../c-api/init.rst:899 +#: ../../c-api/init.rst:1023 msgid "" "The :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release` functions " "do all of the above automatically. The typical idiom for calling into " "Python from a C thread is::" msgstr "" - -#: ../../c-api/init.rst:913 +"As funções :c:func:`PyGILState_Ensure` e :c:func:`PyGILState_Release` fazem " +"tudo isso automaticamente. O padrão típico para chamar o Python a partir de " +"uma thread C é:" + +#: ../../c-api/init.rst:1027 +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 "" +"PyGILState_STATE gstate;\n" +"gstate = PyGILState_Ensure();\n" +"\n" +"/* Executa ações do Python aqui. */\n" +"result = ChamaAlgumaFunção();\n" +"/* avalia resultado ou trata de exceção */\n" +"\n" +"/* Libera a thread. Na API do Python permitida além deste ponto. */\n" +"PyGILState_Release(gstate);" + +#: ../../c-api/init.rst:1037 msgid "" "Note that the ``PyGILState_*`` functions assume there is only one global " "interpreter (created automatically by :c:func:`Py_Initialize`). Python " -"supports the creation of additional interpreters (using :c:func:" -"`Py_NewInterpreter`), but mixing multiple interpreters and the " -"``PyGILState_*`` API is unsupported." +"supports the creation of additional interpreters " +"(using :c:func:`Py_NewInterpreter`), but mixing multiple interpreters and " +"the ``PyGILState_*`` API is unsupported." msgstr "" -#: ../../c-api/init.rst:923 +#: ../../c-api/init.rst:1047 msgid "Cautions about fork()" msgstr "Cuidados com o uso de fork()" -#: ../../c-api/init.rst:925 +#: ../../c-api/init.rst:1049 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 " @@ -1193,8 +1769,14 @@ msgid "" "concrete impact both on how locks must be handled and on all stored state in " "CPython's runtime." msgstr "" +"Outro aspecto importante a observar sobre threads é o seu comportamento " +"diante da chamada de :c:func:`fork` da linguagem C. Na maioria dos sistemas " +"com :c:func:`fork`, após um processo ser criado (\"fork\"), apenas a thread " +"que emitiu o fork continuará existindo. Isso tem um impacto concreto tanto " +"na forma como as travas devem ser gerenciados quanto em todo o estado " +"armazenado no ambiente de execução do CPython." -#: ../../c-api/init.rst:931 +#: ../../c-api/init.rst:1055 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` " @@ -1204,14 +1786,14 @@ msgid "" "of additional (non-Python) locks that need to be acquired before or reset " "after a fork. OS facilities such as :c:func:`!pthread_atfork` would need to " "be used to accomplish the same thing. Additionally, when extending or " -"embedding Python, calling :c:func:`fork` directly rather than through :func:" -"`os.fork` (and returning to or calling into Python) may result in a deadlock " -"by one of Python's internal locks being held by a thread that is defunct " -"after the fork. :c:func:`PyOS_AfterFork_Child` tries to reset the necessary " -"locks, but is not always able to." +"embedding Python, calling :c:func:`fork` directly rather than " +"through :func:`os.fork` (and returning to or calling into Python) may result " +"in a deadlock by one of Python's internal locks being held by a thread that " +"is defunct after the fork. :c:func:`PyOS_AfterFork_Child` tries to reset the " +"necessary locks, but is not always able to." msgstr "" -#: ../../c-api/init.rst:946 +#: ../../c-api/init.rst:1070 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 " @@ -1224,11 +1806,50 @@ msgid "" "called immediately after." msgstr "" -#: ../../c-api/init.rst:959 +#: ../../c-api/init.rst:1084 +msgid "Cautions regarding runtime finalization" +msgstr "" + +#: ../../c-api/init.rst:1086 +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:1094 +msgid "" +"If any thread, other than the finalization thread, attempts to acquire the " +"GIL during finalization, either explicitly " +"via :c:func:`PyGILState_Ensure`, :c:macro:`Py_END_ALLOW_THREADS`, :c:func:`PyEval_AcquireThread`, " +"or :c:func:`!PyEval_AcquireLock`, or implicitly when the interpreter " +"attempts to reacquire it after having yielded it, 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:1104 +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.7 and earlier. The CPython runtime GIL acquiring " +"C APIs have never had any error reporting or handling expectations at GIL " +"acquisition 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:1114 msgid "High-level API" msgstr "" -#: ../../c-api/init.rst:961 +#: ../../c-api/init.rst:1116 msgid "" "These are the most commonly used types and functions when writing C " "extension code, or when embedding the Python interpreter:" @@ -1236,7 +1857,7 @@ msgstr "" "Estes são os tipos e as funções mais comumente usados na escrita de um " "código de extensão em C, ou ao incorporar o interpretador Python:" -#: ../../c-api/init.rst:966 +#: ../../c-api/init.rst:1121 msgid "" "This data structure represents the state shared by a number of cooperating " "threads. Threads belonging to the same interpreter share their module " @@ -1244,7 +1865,7 @@ msgid "" "in this structure." msgstr "" -#: ../../c-api/init.rst:971 +#: ../../c-api/init.rst:1126 msgid "" "Threads belonging to different interpreters initially share nothing, except " "process state like available memory, open file descriptors and such. The " @@ -1252,30 +1873,36 @@ msgid "" "which interpreter they belong." msgstr "" -#: ../../c-api/init.rst:979 +#: ../../c-api/init.rst:1133 +msgid "" +":pep:`684` introduced the possibility of a :ref:`per-interpreter GIL `. See :c:func:`Py_NewInterpreterFromConfig`." +msgstr "" + +#: ../../c-api/init.rst:1140 msgid "" "This data structure represents the state of a single thread. The only " "public data member is:" msgstr "" -#: ../../c-api/init.rst:984 +#: ../../c-api/init.rst:1145 msgid "This thread's interpreter state." msgstr "" -#: ../../c-api/init.rst:995 +#: ../../c-api/init.rst:1156 msgid "Deprecated function which does nothing." msgstr "Função descontinuada que não faz nada." -#: ../../c-api/init.rst:997 +#: ../../c-api/init.rst:1158 msgid "" "In Python 3.6 and older, this function created the GIL if it didn't exist." msgstr "" -#: ../../c-api/init.rst:999 +#: ../../c-api/init.rst:1160 msgid "The function now does nothing." msgstr "" -#: ../../c-api/init.rst:1002 +#: ../../c-api/init.rst:1163 msgid "" "This function is now called by :c:func:`Py_Initialize()`, so you don't have " "to call it yourself anymore." @@ -1283,13 +1910,13 @@ msgstr "" "Esta função agora é chamada por :c:func:`Py_Initialize()`, então não há mais " "necessidade de você chamá-la." -#: ../../c-api/init.rst:1006 +#: ../../c-api/init.rst:1167 msgid "" "This function cannot be called before :c:func:`Py_Initialize()` anymore." msgstr "" "Esta função não pode mais ser chamada antes de :c:func:`Py_Initialize()`." -#: ../../c-api/init.rst:1016 +#: ../../c-api/init.rst:1177 msgid "" "Release the global interpreter lock (if it has been created) and reset the " "thread state to ``NULL``, returning the previous thread state (which is not " @@ -1297,7 +1924,7 @@ msgid "" "acquired it." msgstr "" -#: ../../c-api/init.rst:1024 +#: ../../c-api/init.rst:1185 msgid "" "Acquire the global interpreter lock (if it has been created) and set the " "thread state to *tstate*, which must not be ``NULL``. If the lock has been " @@ -1305,106 +1932,132 @@ msgid "" "ensues." msgstr "" -#: ../../c-api/init.rst:1030 ../../c-api/init.rst:1089 -#: ../../c-api/init.rst:1371 +#: ../../c-api/init.rst:1191 ../../c-api/init.rst:1267 +#: ../../c-api/init.rst:1569 +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." +msgstr "" + +#: ../../c-api/init.rst:1196 ../../c-api/init.rst:1272 +#: ../../c-api/init.rst:1579 msgid "" -"Calling this function from a thread when the runtime is finalizing will " -"terminate the thread, even if the thread was not created by Python. You can " -"use :c:func:`Py_IsFinalizing` or :func:`sys.is_finalizing` to check if the " -"interpreter is in process of being finalized before calling this function to " -"avoid unwanted termination." +"Hangs the current thread, rather than terminating it, if called while the " +"interpreter is finalizing." msgstr "" -#: ../../c-api/init.rst:1038 +#: ../../c-api/init.rst:1202 msgid "" "Return the current thread state. The global interpreter lock must be held. " "When the current thread state is ``NULL``, this issues a fatal error (so " "that the caller needn't check for ``NULL``)." msgstr "" -#: ../../c-api/init.rst:1042 +#: ../../c-api/init.rst:1206 msgid "See also :c:func:`PyThreadState_GetUnchecked`." msgstr "" -#: ../../c-api/init.rst:1047 +#: ../../c-api/init.rst:1211 msgid "" "Similar to :c:func:`PyThreadState_Get`, but don't kill the process with a " "fatal error if it is NULL. The caller is responsible to check if the result " "is NULL." msgstr "" -#: ../../c-api/init.rst:1051 +#: ../../c-api/init.rst:1215 msgid "" "In Python 3.5 to 3.12, the function was private and known as " "``_PyThreadState_UncheckedGet()``." msgstr "" -#: ../../c-api/init.rst:1058 +#: ../../c-api/init.rst:1222 msgid "" "Swap the current thread state with the thread state given by the argument " -"*tstate*, which may be ``NULL``. The global interpreter lock must be held " -"and is not released." +"*tstate*, which may be ``NULL``." msgstr "" -#: ../../c-api/init.rst:1063 +#: ../../c-api/init.rst:1225 +msgid "" +"The :term:`GIL` does not need to be held, but will be held upon returning if " +"*tstate* is non-``NULL``." +msgstr "" + +#: ../../c-api/init.rst:1228 msgid "" "The following functions use thread-local storage, and are not compatible " "with sub-interpreters:" msgstr "" -#: ../../c-api/init.rst:1068 +#: ../../c-api/init.rst:1233 +msgid "" +"The type of the value returned by :c:func:`PyGILState_Ensure` and passed " +"to :c:func:`PyGILState_Release`." +msgstr "" + +#: ../../c-api/init.rst:1238 +msgid "The GIL was already held when :c:func:`PyGILState_Ensure` was called." +msgstr "" + +#: ../../c-api/init.rst:1242 +msgid "The GIL was not held when :c:func:`PyGILState_Ensure` was called." +msgstr "" + +#: ../../c-api/init.rst:1246 msgid "" "Ensure that the current thread is ready to call the Python C API regardless " "of the current state of Python, or of the global interpreter lock. This may " "be called as many times as desired by a thread as long as each call is " "matched with a call to :c:func:`PyGILState_Release`. In general, other " -"thread-related APIs may be used between :c:func:`PyGILState_Ensure` and :c:" -"func:`PyGILState_Release` calls as long as the thread state is restored to " -"its previous state before the Release(). For example, normal usage of the :" -"c:macro:`Py_BEGIN_ALLOW_THREADS` and :c:macro:`Py_END_ALLOW_THREADS` macros " -"is acceptable." +"thread-related APIs may be used between :c:func:`PyGILState_Ensure` " +"and :c:func:`PyGILState_Release` calls as long as the thread state is " +"restored to its previous state before the Release(). For example, normal " +"usage of the :c:macro:`Py_BEGIN_ALLOW_THREADS` " +"and :c:macro:`Py_END_ALLOW_THREADS` macros is acceptable." msgstr "" "Certifique-se de que a thread atual esteja pronta para chamar a API Python " "C, independentemente do estado atual do Python ou da trava global do " "interpretador (GIL). Isso pode ser chamado quantas vezes desejar por uma " -"thread, desde que cada chamada corresponda a uma chamada para :c:func:" -"`PyGILState_Release`. Em geral, outras APIs relacionadas a threads podem ser " -"usadas entre chamadas :c:func:`PyGILState_Ensure` e :c:func:" -"`PyGILState_Release` desde que o estado da thread seja restaurado ao seu " -"estado anterior antes de Release(). Por exemplo, o uso normal das macros :c:" -"macro:`Py_BEGIN_ALLOW_THREADS` e :c:macro:`Py_END_ALLOW_THREADS` é aceitável." +"thread, desde que cada chamada corresponda a uma chamada " +"para :c:func:`PyGILState_Release`. Em geral, outras APIs relacionadas a " +"threads podem ser usadas entre chamadas :c:func:`PyGILState_Ensure` " +"e :c:func:`PyGILState_Release` desde que o estado da thread seja restaurado " +"ao seu estado anterior antes de Release(). Por exemplo, o uso normal das " +"macros :c:macro:`Py_BEGIN_ALLOW_THREADS` e :c:macro:`Py_END_ALLOW_THREADS` é " +"aceitável." -#: ../../c-api/init.rst:1078 +#: ../../c-api/init.rst:1256 msgid "" -"The return value is an opaque \"handle\" to the thread state when :c:func:" -"`PyGILState_Ensure` was called, and must be passed to :c:func:" -"`PyGILState_Release` to ensure Python is left in the same state. Even though " -"recursive calls are allowed, these handles *cannot* be shared - each unique " -"call to :c:func:`PyGILState_Ensure` must save the handle for its call to :c:" -"func:`PyGILState_Release`." +"The return value is an opaque \"handle\" to the thread state " +"when :c:func:`PyGILState_Ensure` was called, and must be passed " +"to :c:func:`PyGILState_Release` to ensure Python is left in the same state. " +"Even though recursive calls are allowed, these handles *cannot* be shared - " +"each unique call to :c:func:`PyGILState_Ensure` must save the handle for its " +"call to :c:func:`PyGILState_Release`." msgstr "" -#: ../../c-api/init.rst:1085 +#: ../../c-api/init.rst:1263 msgid "" "When the function returns, the current thread will hold the GIL and be able " "to call arbitrary Python code. Failure is a fatal error." msgstr "" -#: ../../c-api/init.rst:1097 +#: ../../c-api/init.rst:1278 msgid "" "Release any resources previously acquired. After this call, Python's state " -"will be the same as it was prior to the corresponding :c:func:" -"`PyGILState_Ensure` call (but generally this state will be unknown to the " -"caller, hence the use of the GILState API)." +"will be the same as it was prior to the " +"corresponding :c:func:`PyGILState_Ensure` call (but generally this state " +"will be unknown to the caller, hence the use of the GILState API)." msgstr "" -#: ../../c-api/init.rst:1102 +#: ../../c-api/init.rst:1283 msgid "" -"Every call to :c:func:`PyGILState_Ensure` must be matched by a call to :c:" -"func:`PyGILState_Release` on the same thread." +"Every call to :c:func:`PyGILState_Ensure` must be matched by a call " +"to :c:func:`PyGILState_Release` on the same thread." msgstr "" -#: ../../c-api/init.rst:1108 +#: ../../c-api/init.rst:1289 msgid "" "Get the current thread state for this thread. May return ``NULL`` if no " "GILState API has been used on the current thread. Note that the main thread " @@ -1412,7 +2065,7 @@ msgid "" "made on the main thread. This is mainly a helper/diagnostic function." msgstr "" -#: ../../c-api/init.rst:1116 +#: ../../c-api/init.rst:1297 msgid "" "Return ``1`` if the current thread is holding the GIL and ``0`` otherwise. " "This function can be called from any thread at any time. Only if it has had " @@ -1423,250 +2076,267 @@ msgid "" "otherwise behave differently." msgstr "" -#: ../../c-api/init.rst:1128 +#: ../../c-api/init.rst:1309 msgid "" "The following macros are normally used without a trailing semicolon; look " "for example usage in the Python source distribution." msgstr "" -#: ../../c-api/init.rst:1134 +#: ../../c-api/init.rst:1315 msgid "" -"This macro expands to ``{ PyThreadState *_save; _save = PyEval_SaveThread();" -"``. Note that it contains an opening brace; it must be matched with a " -"following :c:macro:`Py_END_ALLOW_THREADS` macro. See above for further " -"discussion of this macro." +"This macro expands to ``{ PyThreadState *_save; _save = " +"PyEval_SaveThread();``. Note that it contains an opening brace; it must be " +"matched with a following :c:macro:`Py_END_ALLOW_THREADS` macro. See above " +"for further discussion of this macro." msgstr "" "Esta macro se expande para ``{ PyThreadState *_save; _save = " "PyEval_SaveThread();``. Observe que ele contém uma chave de abertura; ele " "deve ser combinado com a seguinte macro :c:macro:`Py_END_ALLOW_THREADS`. " "Veja acima para uma discussão mais aprofundada desta macro." -#: ../../c-api/init.rst:1142 +#: ../../c-api/init.rst:1323 msgid "" "This macro expands to ``PyEval_RestoreThread(_save); }``. Note that it " -"contains a closing brace; it must be matched with an earlier :c:macro:" -"`Py_BEGIN_ALLOW_THREADS` macro. See above for further discussion of this " -"macro." +"contains a closing brace; it must be matched with an " +"earlier :c:macro:`Py_BEGIN_ALLOW_THREADS` macro. See above for further " +"discussion of this macro." msgstr "" "Esta macro se expande para ``PyEval_RestoreThread(_save); }``. Observe que " -"ele contém uma chave de fechamento; ele deve ser combinado com uma macro :c:" -"macro:`Py_BEGIN_ALLOW_THREADS` anterior. Veja acima para uma discussão mais " -"aprofundada desta macro." +"ele contém uma chave de fechamento; ele deve ser combinado com uma " +"macro :c:macro:`Py_BEGIN_ALLOW_THREADS` anterior. Veja acima para uma " +"discussão mais aprofundada desta macro." -#: ../../c-api/init.rst:1150 +#: ../../c-api/init.rst:1331 msgid "" -"This macro expands to ``PyEval_RestoreThread(_save);``: it is equivalent to :" -"c:macro:`Py_END_ALLOW_THREADS` without the closing brace." +"This macro expands to ``PyEval_RestoreThread(_save);``: it is equivalent " +"to :c:macro:`Py_END_ALLOW_THREADS` without the closing brace." msgstr "" "Esta macro se expande para ``PyEval_RestoreThread(_save);``: é equivalente " "a :c:macro:`Py_END_ALLOW_THREADS` sem a chave de fechamento." -#: ../../c-api/init.rst:1156 +#: ../../c-api/init.rst:1337 msgid "" -"This macro expands to ``_save = PyEval_SaveThread();``: it is equivalent to :" -"c:macro:`Py_BEGIN_ALLOW_THREADS` without the opening brace and variable " +"This macro expands to ``_save = PyEval_SaveThread();``: it is equivalent " +"to :c:macro:`Py_BEGIN_ALLOW_THREADS` without the opening brace and variable " "declaration." msgstr "" "Esta macro se expande para ``_save = PyEval_SaveThread();``: é equivalente " "a :c:macro:`Py_BEGIN_ALLOW_THREADS` sem a chave de abertura e declaração de " "variável." -#: ../../c-api/init.rst:1162 +#: ../../c-api/init.rst:1343 msgid "Low-level API" msgstr "" -#: ../../c-api/init.rst:1164 +#: ../../c-api/init.rst:1345 msgid "" "All of the following functions must be called after :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/init.rst:1166 +#: ../../c-api/init.rst:1347 msgid ":c:func:`Py_Initialize()` now initializes the :term:`GIL`." msgstr "" -#: ../../c-api/init.rst:1172 +#: ../../c-api/init.rst:1353 msgid "" "Create a new interpreter state object. The global interpreter lock need not " "be held, but may be held if it is necessary to serialize calls to this " "function." msgstr "" -#: ../../c-api/init.rst:1176 +#: ../../c-api/init.rst:1357 msgid "" -"Raises an :ref:`auditing event ` ``cpython." -"PyInterpreterState_New`` with no arguments." +"Raises an :ref:`auditing event ` " +"``cpython.PyInterpreterState_New`` with no arguments." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``cpython." -"PyInterpreterState_New`` sem argumentos." +"Levanta um :ref:`evento de auditoria ` " +"``cpython.PyInterpreterState_New`` sem argumentos." -#: ../../c-api/init.rst:1181 +#: ../../c-api/init.rst:1362 msgid "" "Reset all information in an interpreter state object. The global " "interpreter lock must be held." msgstr "" -#: ../../c-api/init.rst:1184 +#: ../../c-api/init.rst:1365 msgid "" -"Raises an :ref:`auditing event ` ``cpython." -"PyInterpreterState_Clear`` with no arguments." +"Raises an :ref:`auditing event ` " +"``cpython.PyInterpreterState_Clear`` with no arguments." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``cpython." -"PyInterpreterState_Clear`` sem argumentos." +"Levanta um :ref:`evento de auditoria ` " +"``cpython.PyInterpreterState_Clear`` sem argumentos." -#: ../../c-api/init.rst:1189 +#: ../../c-api/init.rst:1370 msgid "" "Destroy an interpreter state object. The global interpreter lock need not " "be held. The interpreter state must have been reset with a previous call " "to :c:func:`PyInterpreterState_Clear`." msgstr "" -#: ../../c-api/init.rst:1196 +#: ../../c-api/init.rst:1377 msgid "" "Create a new thread state object belonging to the given interpreter object. " "The global interpreter lock need not be held, but may be held if it is " "necessary to serialize calls to this function." msgstr "" -#: ../../c-api/init.rst:1203 +#: ../../c-api/init.rst:1384 msgid "" "Reset all information in a thread state object. The global interpreter lock " "must be held." msgstr "" -#: ../../c-api/init.rst:1206 +#: ../../c-api/init.rst:1387 msgid "" -"This function now calls the :c:member:`PyThreadState.on_delete` callback. " +"This function now calls the :c:member:`!PyThreadState.on_delete` callback. " "Previously, that happened in :c:func:`PyThreadState_Delete`." msgstr "" -#: ../../c-api/init.rst:1213 +#: ../../c-api/init.rst:1391 +msgid "The :c:member:`!PyThreadState.on_delete` callback was removed." +msgstr "" + +#: ../../c-api/init.rst:1397 msgid "" "Destroy a thread state object. The global interpreter lock need not be " -"held. The thread state must have been reset with a previous call to :c:func:" -"`PyThreadState_Clear`." +"held. The thread state must have been reset with a previous call " +"to :c:func:`PyThreadState_Clear`." msgstr "" -#: ../../c-api/init.rst:1220 +#: ../../c-api/init.rst:1404 msgid "" "Destroy the current thread state and release the global interpreter lock. " -"Like :c:func:`PyThreadState_Delete`, the global interpreter lock need not be " -"held. The thread state must have been reset with a previous call to :c:func:" -"`PyThreadState_Clear`." +"Like :c:func:`PyThreadState_Delete`, the global interpreter lock must be " +"held. The thread state must have been reset with a previous call " +"to :c:func:`PyThreadState_Clear`." msgstr "" -#: ../../c-api/init.rst:1228 +#: ../../c-api/init.rst:1412 msgid "Get the current frame of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1230 +#: ../../c-api/init.rst:1414 msgid "" "Return a :term:`strong reference`. Return ``NULL`` if no frame is currently " "executing." msgstr "" -#: ../../c-api/init.rst:1233 +#: ../../c-api/init.rst:1417 msgid "See also :c:func:`PyEval_GetFrame`." msgstr "" -#: ../../c-api/init.rst:1235 ../../c-api/init.rst:1244 -#: ../../c-api/init.rst:1253 +#: ../../c-api/init.rst:1419 ../../c-api/init.rst:1428 +#: ../../c-api/init.rst:1437 msgid "*tstate* must not be ``NULL``." msgstr "" -#: ../../c-api/init.rst:1242 +#: ../../c-api/init.rst:1426 msgid "" "Get the unique thread state identifier of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1251 +#: ../../c-api/init.rst:1435 msgid "Get the interpreter of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1260 +#: ../../c-api/init.rst:1444 msgid "Suspend tracing and profiling in the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1262 +#: ../../c-api/init.rst:1446 msgid "Resume them using the :c:func:`PyThreadState_LeaveTracing` function." msgstr "" -#: ../../c-api/init.rst:1269 +#: ../../c-api/init.rst:1453 msgid "" "Resume tracing and profiling in the Python thread state *tstate* suspended " "by the :c:func:`PyThreadState_EnterTracing` function." msgstr "" -#: ../../c-api/init.rst:1272 +#: ../../c-api/init.rst:1456 msgid "" "See also :c:func:`PyEval_SetTrace` and :c:func:`PyEval_SetProfile` functions." msgstr "" -#: ../../c-api/init.rst:1280 +#: ../../c-api/init.rst:1464 msgid "Get the current interpreter." msgstr "" -#: ../../c-api/init.rst:1282 +#: ../../c-api/init.rst:1466 msgid "" -"Issue a fatal error if there no current Python thread state or no current " +"Issue a fatal error if there is no current Python thread state or no current " "interpreter. It cannot return NULL." msgstr "" -#: ../../c-api/init.rst:1285 ../../c-api/init.rst:1295 +#: ../../c-api/init.rst:1469 ../../c-api/init.rst:1479 +#: ../../c-api/init.rst:1504 msgid "The caller must hold the GIL." -msgstr "" +msgstr "O caller deve possuir o GIL." -#: ../../c-api/init.rst:1292 +#: ../../c-api/init.rst:1476 msgid "" "Return the interpreter's unique ID. If there was any error in doing so then " "``-1`` is returned and an error is set." msgstr "" -#: ../../c-api/init.rst:1302 +#: ../../c-api/init.rst:1486 msgid "" "Return a dictionary in which interpreter-specific data may be stored. If " "this function returns ``NULL`` then no exception has been raised and the " "caller should assume no interpreter-specific dict is available." msgstr "" -#: ../../c-api/init.rst:1306 +#: ../../c-api/init.rst:1490 msgid "" "This is not a replacement for :c:func:`PyModule_GetState()`, which " "extensions should use to store interpreter-specific state information." msgstr "" -#: ../../c-api/init.rst:1313 +#: ../../c-api/init.rst:1493 +msgid "" +"The returned dictionary is borrowed from the interpreter and is valid until " +"interpreter shutdown." +msgstr "" + +#: ../../c-api/init.rst:1501 +msgid "" +"Return a :term:`strong reference` to the ``__main__`` :ref:`module object " +"` for the given interpreter." +msgstr "" + +#: ../../c-api/init.rst:1511 msgid "Type of a frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1315 +#: ../../c-api/init.rst:1513 msgid "" "The *throwflag* parameter is used by the ``throw()`` method of generators: " "if non-zero, handle the current exception." msgstr "" -#: ../../c-api/init.rst:1318 +#: ../../c-api/init.rst:1516 msgid "The function now takes a *tstate* parameter." msgstr "" -#: ../../c-api/init.rst:1321 +#: ../../c-api/init.rst:1519 msgid "" "The *frame* parameter changed from ``PyFrameObject*`` to " "``_PyInterpreterFrame*``." msgstr "" -#: ../../c-api/init.rst:1326 +#: ../../c-api/init.rst:1524 msgid "Get the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1328 ../../c-api/init.rst:1336 +#: ../../c-api/init.rst:1526 ../../c-api/init.rst:1534 msgid "See the :pep:`523` \"Adding a frame evaluation API to CPython\"." msgstr "" -#: ../../c-api/init.rst:1334 +#: ../../c-api/init.rst:1532 msgid "Set the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1343 +#: ../../c-api/init.rst:1541 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 " @@ -1675,7 +2345,7 @@ msgid "" "raised and the caller should assume no current thread state is available." msgstr "" -#: ../../c-api/init.rst:1352 +#: ../../c-api/init.rst:1550 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. " @@ -1687,33 +2357,34 @@ msgid "" "raises no exceptions." msgstr "" -#: ../../c-api/init.rst:1360 +#: ../../c-api/init.rst:1558 msgid "" -"The type of the *id* parameter changed from :c:expr:`long` to :c:expr:" -"`unsigned long`." +"The type of the *id* parameter changed from :c:expr:`long` " +"to :c:expr:`unsigned long`." msgstr "" -#: ../../c-api/init.rst:1366 +#: ../../c-api/init.rst:1564 msgid "" "Acquire the global interpreter lock and set the current thread state to " "*tstate*, which must not be ``NULL``. The lock must have been created " "earlier. If this thread already has the lock, deadlock ensues." msgstr "" -#: ../../c-api/init.rst:1377 +#: ../../c-api/init.rst:1574 msgid "" -"Updated to be consistent with :c:func:`PyEval_RestoreThread`, :c:func:" -"`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`, and terminate the " -"current thread if called while the interpreter is finalizing." +"Updated to be consistent " +"with :c:func:`PyEval_RestoreThread`, :c:func:`Py_END_ALLOW_THREADS`, " +"and :c:func:`PyGILState_Ensure`, and terminate the current thread if called " +"while the interpreter is finalizing." msgstr "" -#: ../../c-api/init.rst:1382 +#: ../../c-api/init.rst:1583 msgid "" ":c:func:`PyEval_RestoreThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1388 +#: ../../c-api/init.rst:1589 msgid "" "Reset the current thread state to ``NULL`` and release the global " "interpreter lock. The lock must have been created earlier and must be held " @@ -1722,17 +2393,17 @@ msgid "" "isn't, a fatal error is reported." msgstr "" -#: ../../c-api/init.rst:1394 +#: ../../c-api/init.rst:1595 msgid "" ":c:func:`PyEval_SaveThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1401 +#: ../../c-api/init.rst:1602 msgid "Sub-interpreter support" msgstr "" -#: ../../c-api/init.rst:1403 +#: ../../c-api/init.rst:1604 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 " @@ -1740,7 +2411,7 @@ msgid "" "to do that." msgstr "" -#: ../../c-api/init.rst:1408 +#: ../../c-api/init.rst:1609 msgid "" "The \"main\" interpreter is the first one created when the runtime " "initializes. It is usually the only Python interpreter in a process. Unlike " @@ -1751,134 +2422,134 @@ msgid "" "returns a pointer to its state." msgstr "" -#: ../../c-api/init.rst:1415 +#: ../../c-api/init.rst:1616 msgid "" -"You can switch between sub-interpreters using the :c:func:" -"`PyThreadState_Swap` function. You can create and destroy them using the " -"following functions:" +"You can switch between sub-interpreters using " +"the :c:func:`PyThreadState_Swap` function. You can create and destroy them " +"using the following functions:" msgstr "" -#: ../../c-api/init.rst:1421 +#: ../../c-api/init.rst:1622 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:1427 +#: ../../c-api/init.rst:1628 msgid "Structure fields:" msgstr "Campos de estrutura:" -#: ../../c-api/init.rst:1431 +#: ../../c-api/init.rst:1632 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:1435 +#: ../../c-api/init.rst:1636 msgid "" -"If this is ``0`` then :c:member:`~PyInterpreterConfig." -"check_multi_interp_extensions` must be ``1`` (non-zero). If this is ``1`` " -"then :c:member:`~PyInterpreterConfig.gil` must not be :c:macro:" -"`PyInterpreterConfig_OWN_GIL`." +"If this is ``0`` " +"then :c:member:`~PyInterpreterConfig.check_multi_interp_extensions` must be " +"``1`` (non-zero). If this is ``1`` then :c:member:`~PyInterpreterConfig.gil` " +"must not be :c:macro:`PyInterpreterConfig_OWN_GIL`." msgstr "" -#: ../../c-api/init.rst:1443 +#: ../../c-api/init.rst:1644 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:1447 +#: ../../c-api/init.rst:1648 msgid "" "Note that the :mod:`subprocess` module still works when fork is disallowed." msgstr "" -#: ../../c-api/init.rst:1452 +#: ../../c-api/init.rst:1653 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:1457 +#: ../../c-api/init.rst:1658 msgid "" "Note that the :mod:`subprocess` module still works when exec is disallowed." msgstr "" -#: ../../c-api/init.rst:1462 +#: ../../c-api/init.rst:1663 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:1468 +#: ../../c-api/init.rst:1669 msgid "" "If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " -"create daemon threads. Otherwise daemon threads are allowed (as long as :c:" -"member:`~PyInterpreterConfig.allow_threads` is non-zero)." +"create daemon threads. Otherwise daemon threads are allowed (as long " +"as :c:member:`~PyInterpreterConfig.allow_threads` is non-zero)." msgstr "" -#: ../../c-api/init.rst:1475 +#: ../../c-api/init.rst:1676 msgid "" "If this is ``0`` then all extension modules may be imported, including " "legacy (single-phase init) modules, in any thread where the sub-interpreter " -"is currently active. Otherwise only multi-phase init extension modules (see :" -"pep:`489`) may be imported. (Also see :c:macro:" -"`Py_mod_multiple_interpreters`.)" +"is currently active. Otherwise only multi-phase init extension modules " +"(see :pep:`489`) may be imported. (Also " +"see :c:macro:`Py_mod_multiple_interpreters`.)" msgstr "" -#: ../../c-api/init.rst:1482 +#: ../../c-api/init.rst:1683 msgid "" -"This must be ``1`` (non-zero) if :c:member:`~PyInterpreterConfig." -"use_main_obmalloc` is ``0``." +"This must be ``1`` (non-zero) " +"if :c:member:`~PyInterpreterConfig.use_main_obmalloc` is ``0``." msgstr "" -#: ../../c-api/init.rst:1487 +#: ../../c-api/init.rst:1688 msgid "" "This determines the operation of the GIL for the sub-interpreter. It may be " "one of the following:" msgstr "" -#: ../../c-api/init.rst:1494 +#: ../../c-api/init.rst:1695 msgid "Use the default selection (:c:macro:`PyInterpreterConfig_SHARED_GIL`)." msgstr "" -#: ../../c-api/init.rst:1498 +#: ../../c-api/init.rst:1699 msgid "Use (share) the main interpreter's GIL." msgstr "" -#: ../../c-api/init.rst:1502 +#: ../../c-api/init.rst:1703 msgid "Use the sub-interpreter's own GIL." msgstr "" -#: ../../c-api/init.rst:1504 +#: ../../c-api/init.rst:1705 msgid "" -"If this is :c:macro:`PyInterpreterConfig_OWN_GIL` then :c:member:" -"`PyInterpreterConfig.use_main_obmalloc` must be ``0``." +"If this is :c:macro:`PyInterpreterConfig_OWN_GIL` " +"then :c:member:`PyInterpreterConfig.use_main_obmalloc` must be ``0``." msgstr "" -#: ../../c-api/init.rst:1518 +#: ../../c-api/init.rst:1719 msgid "" "Create a new sub-interpreter. This is an (almost) totally separate " "environment for the execution of Python code. In particular, the new " "interpreter has separate, independent versions of all imported modules, " -"including the fundamental modules :mod:`builtins`, :mod:`__main__` and :mod:" -"`sys`. The table of loaded modules (``sys.modules``) and the module search " -"path (``sys.path``) are also separate. The new environment has no ``sys." -"argv`` variable. It has new standard I/O stream file objects ``sys.stdin``, " -"``sys.stdout`` and ``sys.stderr`` (however these refer to the same " -"underlying file descriptors)." +"including the fundamental modules :mod:`builtins`, :mod:`__main__` " +"and :mod:`sys`. The table of loaded modules (``sys.modules``) and the " +"module search path (``sys.path``) are also separate. The new environment " +"has no ``sys.argv`` variable. It has new standard I/O stream file objects " +"``sys.stdin``, ``sys.stdout`` and ``sys.stderr`` (however these refer to the " +"same underlying file descriptors)." msgstr "" -#: ../../c-api/init.rst:1528 +#: ../../c-api/init.rst:1729 msgid "" "The given *config* controls the options with which the interpreter is " "initialized." msgstr "" -#: ../../c-api/init.rst:1531 +#: ../../c-api/init.rst:1732 msgid "" "Upon success, *tstate_p* will be set to the first thread state created in " "the new sub-interpreter. This thread state is made in the current thread " @@ -1889,7 +2560,7 @@ msgid "" "state." msgstr "" -#: ../../c-api/init.rst:1540 +#: ../../c-api/init.rst:1741 msgid "" "Like all other Python/C API functions, the global interpreter lock must be " "held before calling this function and is still held when it returns. " @@ -1901,64 +2572,83 @@ msgid "" "released here." msgstr "" -#: ../../c-api/init.rst:1551 +#: ../../c-api/init.rst:1752 msgid "" "Sub-interpreters are most effective when isolated from each other, with " "certain functionality restricted::" msgstr "" -#: ../../c-api/init.rst:1565 +#: ../../c-api/init.rst:1755 +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:1770 msgid "" "Note that the config is used only briefly and does not get modified. During " -"initialization the config's values are converted into various :c:type:" -"`PyInterpreterState` values. A read-only copy of the config may be stored " -"internally on the :c:type:`PyInterpreterState`." +"initialization the config's values are converted into " +"various :c:type:`PyInterpreterState` values. A read-only copy of the config " +"may be stored internally on the :c:type:`PyInterpreterState`." msgstr "" -#: ../../c-api/init.rst:1574 +#: ../../c-api/init.rst:1779 msgid "Extension modules are shared between (sub-)interpreters as follows:" msgstr "" -#: ../../c-api/init.rst:1576 +#: ../../c-api/init.rst:1781 msgid "" -"For modules using multi-phase initialization, e.g. :c:func:" -"`PyModule_FromDefAndSpec`, a separate module object is created and " -"initialized for each interpreter. Only C-level static and global variables " -"are shared between these module objects." +"For modules using multi-phase initialization, " +"e.g. :c:func:`PyModule_FromDefAndSpec`, a separate module object is created " +"and initialized for each interpreter. Only C-level static and global " +"variables are shared between these module objects." msgstr "" -#: ../../c-api/init.rst:1582 +#: ../../c-api/init.rst:1787 msgid "" -"For modules using single-phase initialization, e.g. :c:func:" -"`PyModule_Create`, the first time a particular extension is imported, it is " -"initialized normally, and a (shallow) copy of its module's dictionary is " -"squirreled away. When the same extension is imported by another " -"(sub-)interpreter, a new module is initialized and filled with the contents " -"of this copy; the extension's ``init`` function is not called. Objects in " -"the module's dictionary thus end up shared across (sub-)interpreters, which " -"might cause unwanted behavior (see `Bugs and caveats`_ below)." +"For modules using single-phase initialization, " +"e.g. :c:func:`PyModule_Create`, the first time a particular extension is " +"imported, it is initialized normally, and a (shallow) copy of its module's " +"dictionary is squirreled away. When the same extension is imported by " +"another (sub-)interpreter, a new module is initialized and filled with the " +"contents of this copy; the extension's ``init`` function is not called. " +"Objects in the module's dictionary thus end up shared across " +"(sub-)interpreters, which might cause unwanted behavior (see `Bugs and " +"caveats`_ below)." msgstr "" -#: ../../c-api/init.rst:1593 +#: ../../c-api/init.rst:1798 msgid "" "Note that this is different from what happens when an extension is imported " -"after the interpreter has been completely re-initialized by calling :c:func:" -"`Py_FinalizeEx` and :c:func:`Py_Initialize`; in that case, the extension's " -"``initmodule`` function *is* called again. As with multi-phase " -"initialization, this means that only C-level static and global variables are " -"shared between these modules." +"after the interpreter has been completely re-initialized by " +"calling :c:func:`Py_FinalizeEx` and :c:func:`Py_Initialize`; in that case, " +"the extension's ``initmodule`` function *is* called again. As with multi-" +"phase initialization, this means that only C-level static and global " +"variables are shared between these modules." msgstr "" -#: ../../c-api/init.rst:1613 +#: ../../c-api/init.rst:1818 msgid "" -"Create a new sub-interpreter. This is essentially just a wrapper around :c:" -"func:`Py_NewInterpreterFromConfig` with a config that preserves the existing " -"behavior. The result is an unisolated sub-interpreter that shares the main " -"interpreter's GIL, allows fork/exec, allows daemon threads, and allows " -"single-phase init modules." +"Create a new sub-interpreter. This is essentially just a wrapper " +"around :c:func:`Py_NewInterpreterFromConfig` with a config that preserves " +"the existing behavior. The result is an unisolated sub-interpreter that " +"shares the main interpreter's GIL, allows fork/exec, allows daemon threads, " +"and allows single-phase init modules." msgstr "" -#: ../../c-api/init.rst:1625 +#: ../../c-api/init.rst:1830 msgid "" "Destroy the (sub-)interpreter represented by the given thread state. The " "given thread state must be the current thread state. See the discussion of " @@ -1968,17 +2658,17 @@ msgid "" "be held before calling this function. No GIL is held when it returns." msgstr "" -#: ../../c-api/init.rst:1633 +#: ../../c-api/init.rst:1838 msgid "" ":c:func:`Py_FinalizeEx` will destroy all sub-interpreters that haven't been " "explicitly destroyed at that point." msgstr "" -#: ../../c-api/init.rst:1638 +#: ../../c-api/init.rst:1845 msgid "A Per-Interpreter GIL" msgstr "" -#: ../../c-api/init.rst:1640 +#: ../../c-api/init.rst:1847 msgid "" "Using :c:func:`Py_NewInterpreterFromConfig` you can create a sub-interpreter " "that is completely isolated from other interpreters, including having its " @@ -1987,10 +2677,10 @@ msgid "" "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`.)" +"just using threads. (See :pep:`554` and :pep:`684`.)" msgstr "" -#: ../../c-api/init.rst:1650 +#: ../../c-api/init.rst:1857 msgid "" "Using an isolated interpreter requires vigilance in preserving that " "isolation. That especially means not sharing any objects or mutable state " @@ -2004,7 +2694,7 @@ msgid "" "builtin objects." msgstr "" -#: ../../c-api/init.rst:1661 +#: ../../c-api/init.rst:1868 msgid "" "If you preserve isolation then you will have access to proper multi-core " "computing without the complications that come with free-threading. Failure " @@ -2016,7 +2706,7 @@ msgstr "" "falha em preservar o isolamento traz a exposição a todas as consequências de " "threads livres, incluindo corridas e travamentos difíceis de depurar." -#: ../../c-api/init.rst:1666 +#: ../../c-api/init.rst:1873 msgid "" "Aside from that, one of the main challenges of using multiple isolated " "interpreters is how to communicate between them safely (not break isolation) " @@ -2026,11 +2716,11 @@ msgid "" "sharing) data between interpreters." msgstr "" -#: ../../c-api/init.rst:1677 +#: ../../c-api/init.rst:1884 msgid "Bugs and caveats" msgstr "" -#: ../../c-api/init.rst:1679 +#: ../../c-api/init.rst:1886 msgid "" "Because sub-interpreters (and the main interpreter) are part of the same " "process, the insulation between them isn't perfect --- for example, using " @@ -2043,7 +2733,7 @@ msgid "" "should be avoided if possible." msgstr "" -#: ../../c-api/init.rst:1689 +#: ../../c-api/init.rst:1896 msgid "" "Special care should be taken to avoid sharing user-defined functions, " "methods, instances or classes between sub-interpreters, since import " @@ -2052,37 +2742,37 @@ msgid "" "objects from which the above are reachable." msgstr "" -#: ../../c-api/init.rst:1695 +#: ../../c-api/init.rst:1902 msgid "" "Also note that combining this functionality with ``PyGILState_*`` APIs is " "delicate, because these APIs assume a bijection between Python thread states " "and OS-level threads, an assumption broken by the presence of sub-" "interpreters. It is highly recommended that you don't switch sub-" -"interpreters between a pair of matching :c:func:`PyGILState_Ensure` and :c:" -"func:`PyGILState_Release` calls. Furthermore, extensions (such as :mod:" -"`ctypes`) using these APIs to allow calling of Python code from non-Python " -"created threads will probably be broken when using sub-interpreters." +"interpreters between a pair of matching :c:func:`PyGILState_Ensure` " +"and :c:func:`PyGILState_Release` calls. Furthermore, extensions (such " +"as :mod:`ctypes`) using these APIs to allow calling of Python code from non-" +"Python created threads will probably be broken when using sub-interpreters." msgstr "" -#: ../../c-api/init.rst:1706 +#: ../../c-api/init.rst:1913 msgid "Asynchronous Notifications" msgstr "Notificações assíncronas" -#: ../../c-api/init.rst:1708 +#: ../../c-api/init.rst:1915 msgid "" "A mechanism is provided to make asynchronous notifications to the main " "interpreter thread. These notifications take the form of a function pointer " "and a void pointer argument." msgstr "" -#: ../../c-api/init.rst:1715 +#: ../../c-api/init.rst:1922 msgid "" "Schedule a function to be called from the main interpreter thread. On " "success, ``0`` is returned and *func* is queued for being called in the main " "thread. On failure, ``-1`` is returned without setting any exception." msgstr "" -#: ../../c-api/init.rst:1719 +#: ../../c-api/init.rst:1926 msgid "" "When successfully queued, *func* will be *eventually* called from the main " "interpreter thread with the argument *arg*. It will be called " @@ -2090,17 +2780,17 @@ msgid "" "these conditions met:" msgstr "" -#: ../../c-api/init.rst:1724 +#: ../../c-api/init.rst:1931 msgid "on a :term:`bytecode` boundary;" msgstr "" -#: ../../c-api/init.rst:1725 +#: ../../c-api/init.rst:1932 msgid "" "with the main thread holding the :term:`global interpreter lock` (*func* can " "therefore use the full C API)." msgstr "" -#: ../../c-api/init.rst:1728 +#: ../../c-api/init.rst:1935 msgid "" "*func* must return ``0`` on success, or ``-1`` on failure with an exception " "set. *func* won't be interrupted to perform another asynchronous " @@ -2108,30 +2798,30 @@ msgid "" "if the global interpreter lock is released." msgstr "" -#: ../../c-api/init.rst:1733 +#: ../../c-api/init.rst:1940 msgid "" "This function doesn't need a current thread state to run, and it doesn't " "need the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:1736 +#: ../../c-api/init.rst:1943 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:1741 +#: ../../c-api/init.rst:1948 msgid "" "This is a low-level function, only useful for very special cases. There is " "no guarantee that *func* will be called as quick as possible. If the main " "thread is busy executing a system call, *func* won't be called before the " "system call returns. This function is generally **not** suitable for " -"calling Python code from arbitrary C threads. Instead, use the :ref:" -"`PyGILState API`." +"calling Python code from arbitrary C threads. Instead, use " +"the :ref:`PyGILState API`." msgstr "" -#: ../../c-api/init.rst:1750 +#: ../../c-api/init.rst:1957 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 " @@ -2139,18 +2829,48 @@ msgid "" "scheduled calls." msgstr "" -#: ../../c-api/init.rst:1759 +#: ../../c-api/init.rst:1963 +msgid "" +"This function now always schedules *func* to be run in the main interpreter." +msgstr "" + +#: ../../c-api/init.rst:1970 +msgid "" +"Execute all pending calls. This is usually executed automatically by the " +"interpreter." +msgstr "" + +#: ../../c-api/init.rst:1973 +msgid "" +"This function returns ``0`` on success, and returns ``-1`` with an exception " +"set on failure." +msgstr "" +"Esta função retorna ``0`` em caso de sucesso e retorna ``-1`` com uma " +"exceção definida em caso de falha." + +#: ../../c-api/init.rst:1976 +msgid "" +"If this is not called in the main thread of the main interpreter, this " +"function does nothing and returns ``0``. The caller must hold " +"the :term:`GIL`." +msgstr "" + +#: ../../c-api/init.rst:1982 +msgid "This function only runs pending calls in the main interpreter." +msgstr "" + +#: ../../c-api/init.rst:1989 msgid "Profiling and Tracing" msgstr "" -#: ../../c-api/init.rst:1764 +#: ../../c-api/init.rst:1994 msgid "" "The Python interpreter provides some low-level support for attaching " "profiling and execution tracing facilities. These are used for profiling, " "debugging, and coverage analysis tools." msgstr "" -#: ../../c-api/init.rst:1768 +#: ../../c-api/init.rst:1998 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 " @@ -2160,78 +2880,76 @@ msgid "" "reported to the Python-level trace functions in previous versions." msgstr "" -#: ../../c-api/init.rst:1778 +#: ../../c-api/init.rst:2008 msgid "" "The type of the trace function registered using :c:func:`PyEval_SetProfile` " "and :c:func:`PyEval_SetTrace`. The first parameter is the object passed to " "the registration function as *obj*, *frame* is the frame object to which the " -"event pertains, *what* is one of the constants :c:data:`PyTrace_CALL`, :c:" -"data:`PyTrace_EXCEPTION`, :c:data:`PyTrace_LINE`, :c:data:`PyTrace_RETURN`, :" -"c:data:`PyTrace_C_CALL`, :c:data:`PyTrace_C_EXCEPTION`, :c:data:" -"`PyTrace_C_RETURN`, or :c:data:`PyTrace_OPCODE`, and *arg* depends on the " -"value of *what*:" +"event pertains, *what* is one of the " +"constants :c:data:`PyTrace_CALL`, :c:data:`PyTrace_EXCEPTION`, :c:data:`PyTrace_LINE`, :c:data:`PyTrace_RETURN`, :c:data:`PyTrace_C_CALL`, :c:data:`PyTrace_C_EXCEPTION`, :c:data:`PyTrace_C_RETURN`, " +"or :c:data:`PyTrace_OPCODE`, and *arg* depends on the value of *what*:" msgstr "" -#: ../../c-api/init.rst:1787 +#: ../../c-api/init.rst:2017 msgid "Value of *what*" msgstr "" -#: ../../c-api/init.rst:1787 +#: ../../c-api/init.rst:2017 msgid "Meaning of *arg*" msgstr "" -#: ../../c-api/init.rst:1789 +#: ../../c-api/init.rst:2019 msgid ":c:data:`PyTrace_CALL`" msgstr "" -#: ../../c-api/init.rst:1789 ../../c-api/init.rst:1794 -#: ../../c-api/init.rst:1805 +#: ../../c-api/init.rst:2019 ../../c-api/init.rst:2024 +#: ../../c-api/init.rst:2035 msgid "Always :c:data:`Py_None`." msgstr "" -#: ../../c-api/init.rst:1791 +#: ../../c-api/init.rst:2021 msgid ":c:data:`PyTrace_EXCEPTION`" msgstr "" -#: ../../c-api/init.rst:1791 +#: ../../c-api/init.rst:2021 msgid "Exception information as returned by :func:`sys.exc_info`." msgstr "" -#: ../../c-api/init.rst:1794 +#: ../../c-api/init.rst:2024 msgid ":c:data:`PyTrace_LINE`" msgstr "" -#: ../../c-api/init.rst:1796 +#: ../../c-api/init.rst:2026 msgid ":c:data:`PyTrace_RETURN`" msgstr "" -#: ../../c-api/init.rst:1796 +#: ../../c-api/init.rst:2026 msgid "" "Value being returned to the caller, or ``NULL`` if caused by an exception." msgstr "" -#: ../../c-api/init.rst:1799 +#: ../../c-api/init.rst:2029 msgid ":c:data:`PyTrace_C_CALL`" msgstr "" -#: ../../c-api/init.rst:1799 ../../c-api/init.rst:1801 -#: ../../c-api/init.rst:1803 +#: ../../c-api/init.rst:2029 ../../c-api/init.rst:2031 +#: ../../c-api/init.rst:2033 msgid "Function object being called." msgstr "" -#: ../../c-api/init.rst:1801 +#: ../../c-api/init.rst:2031 msgid ":c:data:`PyTrace_C_EXCEPTION`" msgstr "" -#: ../../c-api/init.rst:1803 +#: ../../c-api/init.rst:2033 msgid ":c:data:`PyTrace_C_RETURN`" msgstr "" -#: ../../c-api/init.rst:1805 +#: ../../c-api/init.rst:2035 msgid ":c:data:`PyTrace_OPCODE`" msgstr "" -#: ../../c-api/init.rst:1810 +#: ../../c-api/init.rst:2040 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 " @@ -2240,7 +2958,7 @@ msgid "" "the corresponding frame." msgstr "" -#: ../../c-api/init.rst:1819 +#: ../../c-api/init.rst:2049 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 " @@ -2248,137 +2966,139 @@ msgid "" "exception becomes set within the frame being executed. The effect of this " "is that as exception propagation causes the Python stack to unwind, the " "callback is called upon return to each frame as the exception propagates. " -"Only trace functions receives these events; they are not needed by the " +"Only trace functions receive these events; they are not needed by the " "profiler." msgstr "" -#: ../../c-api/init.rst:1830 +#: ../../c-api/init.rst:2060 msgid "" "The value passed as the *what* parameter to a :c:type:`Py_tracefunc` " "function (but not a profiling function) when a line-number event is being " -"reported. It may be disabled for a frame by setting :attr:`~frame." -"f_trace_lines` to *0* on that frame." +"reported. It may be disabled for a frame by " +"setting :attr:`~frame.f_trace_lines` to *0* on that frame." msgstr "" -#: ../../c-api/init.rst:1838 +#: ../../c-api/init.rst:2068 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a call is about to return." msgstr "" -#: ../../c-api/init.rst:1844 +#: ../../c-api/init.rst:2074 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function is about to be called." msgstr "" -#: ../../c-api/init.rst:1850 +#: ../../c-api/init.rst:2080 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has raised an exception." msgstr "" -#: ../../c-api/init.rst:1856 +#: ../../c-api/init.rst:2086 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has returned." msgstr "" -#: ../../c-api/init.rst:1862 +#: ../../c-api/init.rst:2092 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions (but " "not profiling functions) when a new opcode is about to be executed. This " -"event is not emitted by default: it must be explicitly requested by setting :" -"attr:`~frame.f_trace_opcodes` to *1* on the frame." +"event is not emitted by default: it must be explicitly requested by " +"setting :attr:`~frame.f_trace_opcodes` to *1* on the frame." msgstr "" -#: ../../c-api/init.rst:1870 +#: ../../c-api/init.rst:2100 msgid "" "Set the profiler function to *func*. The *obj* parameter is passed to the " "function as its first parameter, and may be any Python object, or ``NULL``. " "If the profile function needs to maintain state, using a different value for " "*obj* for each thread provides a convenient and thread-safe place to store " -"it. The profile function is called for all monitored events except :c:data:" -"`PyTrace_LINE` :c:data:`PyTrace_OPCODE` and :c:data:`PyTrace_EXCEPTION`." +"it. The profile function is called for all monitored events " +"except :c:data:`PyTrace_LINE` :c:data:`PyTrace_OPCODE` " +"and :c:data:`PyTrace_EXCEPTION`." msgstr "" -#: ../../c-api/init.rst:1877 +#: ../../c-api/init.rst:2107 msgid "See also the :func:`sys.setprofile` function." msgstr "" -#: ../../c-api/init.rst:1879 ../../c-api/init.rst:1886 -#: ../../c-api/init.rst:1905 ../../c-api/init.rst:1912 +#: ../../c-api/init.rst:2109 ../../c-api/init.rst:2116 +#: ../../c-api/init.rst:2135 ../../c-api/init.rst:2142 +#: ../../c-api/init.rst:2694 msgid "The caller must hold the :term:`GIL`." msgstr "" -#: ../../c-api/init.rst:1883 +#: ../../c-api/init.rst:2113 msgid "" "Like :c:func:`PyEval_SetProfile` but sets the profile function in all " "running threads belonging to the current interpreter instead of the setting " "it only on the current thread." msgstr "" -#: ../../c-api/init.rst:1888 +#: ../../c-api/init.rst:2118 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:1896 +#: ../../c-api/init.rst:2126 msgid "" -"Set the tracing function to *func*. This is similar to :c:func:" -"`PyEval_SetProfile`, except the tracing function does receive line-number " -"events and per-opcode events, but does not receive any event related to C " -"function objects being called. Any trace function registered using :c:func:" -"`PyEval_SetTrace` will not receive :c:data:`PyTrace_C_CALL`, :c:data:" -"`PyTrace_C_EXCEPTION` or :c:data:`PyTrace_C_RETURN` as a value for the " -"*what* parameter." +"Set the tracing function to *func*. This is similar " +"to :c:func:`PyEval_SetProfile`, except the tracing function does receive " +"line-number events and per-opcode events, but does not receive any event " +"related to C function objects being called. Any trace function registered " +"using :c:func:`PyEval_SetTrace` will not " +"receive :c:data:`PyTrace_C_CALL`, :c:data:`PyTrace_C_EXCEPTION` " +"or :c:data:`PyTrace_C_RETURN` as a value for the *what* parameter." msgstr "" -#: ../../c-api/init.rst:1903 +#: ../../c-api/init.rst:2133 msgid "See also the :func:`sys.settrace` function." msgstr "" -#: ../../c-api/init.rst:1909 +#: ../../c-api/init.rst:2139 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:1914 +#: ../../c-api/init.rst:2144 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:1920 +#: ../../c-api/init.rst:2150 msgid "Reference tracing" msgstr "" -#: ../../c-api/init.rst:1926 +#: ../../c-api/init.rst:2156 msgid "" -"The type of the trace function registered using :c:func:" -"`PyRefTracer_SetTracer`. The first parameter is a Python object that has " -"been just created (when **event** is set to :c:data:`PyRefTracer_CREATE`) or " -"about to be destroyed (when **event** is set to :c:data:" -"`PyRefTracer_DESTROY`). The **data** argument is the opaque pointer that was " -"provided when :c:func:`PyRefTracer_SetTracer` was called." +"The type of the trace function registered " +"using :c:func:`PyRefTracer_SetTracer`. The first parameter is a Python " +"object that has been just created (when **event** is set " +"to :c:data:`PyRefTracer_CREATE`) or about to be destroyed (when **event** is " +"set to :c:data:`PyRefTracer_DESTROY`). The **data** argument is the opaque " +"pointer that was provided when :c:func:`PyRefTracer_SetTracer` was called." msgstr "" -#: ../../c-api/init.rst:1936 +#: ../../c-api/init.rst:2166 msgid "" "The value for the *event* parameter to :c:type:`PyRefTracer` functions when " "a Python object has been created." msgstr "" -#: ../../c-api/init.rst:1941 +#: ../../c-api/init.rst:2171 msgid "" "The value for the *event* parameter to :c:type:`PyRefTracer` functions when " "a Python object has been destroyed." msgstr "" -#: ../../c-api/init.rst:1946 +#: ../../c-api/init.rst:2176 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 " @@ -2387,19 +3107,19 @@ msgid "" "return ``-1`` on error." msgstr "" -#: ../../c-api/init.rst:1952 +#: ../../c-api/init.rst:2182 msgid "" -"Not that tracer functions **must not** create Python objects inside or " +"Note that tracer functions **must not** create Python objects inside or " "otherwise the call will be re-entrant. The tracer also **must not** clear " "any existing exception or set an exception. The GIL will be held every time " "the tracer function is called." msgstr "" -#: ../../c-api/init.rst:1957 ../../c-api/init.rst:1968 +#: ../../c-api/init.rst:2187 ../../c-api/init.rst:2198 msgid "The GIL must be held when calling this function." msgstr "" -#: ../../c-api/init.rst:1963 +#: ../../c-api/init.rst:2193 msgid "" "Get the registered reference tracer function and the value of the opaque " "data pointer that was registered when :c:func:`PyRefTracer_SetTracer` was " @@ -2407,48 +3127,48 @@ msgid "" "set the **data** pointer to NULL." msgstr "" -#: ../../c-api/init.rst:1975 +#: ../../c-api/init.rst:2205 msgid "Advanced Debugger Support" msgstr "" -#: ../../c-api/init.rst:1980 +#: ../../c-api/init.rst:2210 msgid "" "These functions are only intended to be used by advanced debugging tools." msgstr "" -#: ../../c-api/init.rst:1985 +#: ../../c-api/init.rst:2215 msgid "" "Return the interpreter state object at the head of the list of all such " "objects." msgstr "" -#: ../../c-api/init.rst:1990 +#: ../../c-api/init.rst:2220 msgid "Return the main interpreter state object." msgstr "" -#: ../../c-api/init.rst:1995 +#: ../../c-api/init.rst:2225 msgid "" "Return the next interpreter state object after *interp* from the list of all " "such objects." msgstr "" -#: ../../c-api/init.rst:2001 +#: ../../c-api/init.rst:2231 msgid "" "Return the pointer to the first :c:type:`PyThreadState` object in the list " "of threads associated with the interpreter *interp*." msgstr "" -#: ../../c-api/init.rst:2007 +#: ../../c-api/init.rst:2237 msgid "" "Return the next thread state object after *tstate* from the list of all such " "objects belonging to the same :c:type:`PyInterpreterState` object." msgstr "" -#: ../../c-api/init.rst:2014 +#: ../../c-api/init.rst:2244 msgid "Thread Local Storage Support" msgstr "" -#: ../../c-api/init.rst:2018 +#: ../../c-api/init.rst:2248 msgid "" "The Python interpreter provides low-level support for thread-local storage " "(TLS) which wraps the underlying native TLS implementation to support the " @@ -2458,42 +3178,42 @@ msgid "" "thread." msgstr "" -#: ../../c-api/init.rst:2025 +#: ../../c-api/init.rst:2255 msgid "" "The GIL does *not* need to be held when calling these functions; they supply " "their own locking." msgstr "" -#: ../../c-api/init.rst:2028 +#: ../../c-api/init.rst:2258 msgid "" "Note that :file:`Python.h` does not include the declaration of the TLS APIs, " "you need to include :file:`pythread.h` to use thread-local storage." msgstr "" -#: ../../c-api/init.rst:2032 +#: ../../c-api/init.rst:2262 msgid "" -"None of these API functions handle memory management on behalf of the :c:" -"expr:`void*` values. You need to allocate and deallocate them yourself. If " -"the :c:expr:`void*` values happen to be :c:expr:`PyObject*`, these functions " -"don't do refcount operations on them either." +"None of these API functions handle memory management on behalf of " +"the :c:expr:`void*` values. You need to allocate and deallocate them " +"yourself. If the :c:expr:`void*` values happen to be :c:expr:`PyObject*`, " +"these functions don't do refcount operations on them either." msgstr "" -#: ../../c-api/init.rst:2040 +#: ../../c-api/init.rst:2270 msgid "Thread Specific Storage (TSS) API" msgstr "" -#: ../../c-api/init.rst:2042 +#: ../../c-api/init.rst:2272 msgid "" "TSS API is introduced to supersede the use of the existing TLS API within " "the CPython interpreter. This API uses a new type :c:type:`Py_tss_t` " "instead of :c:expr:`int` to represent thread keys." msgstr "" -#: ../../c-api/init.rst:2048 +#: ../../c-api/init.rst:2278 msgid "\"A New C-API for Thread-Local Storage in CPython\" (:pep:`539`)" msgstr "" -#: ../../c-api/init.rst:2053 +#: ../../c-api/init.rst:2283 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 " @@ -2501,7 +3221,7 @@ msgid "" "public members in this structure." msgstr "" -#: ../../c-api/init.rst:2058 +#: ../../c-api/init.rst:2288 msgid "" "When :ref:`Py_LIMITED_API ` is not defined, static allocation of " "this type by :c:macro:`Py_tss_NEEDS_INIT` is allowed." @@ -2509,62 +3229,64 @@ msgstr "" "Quando :ref:`Py_LIMITED_API ` não é definido, a alocação estática " "deste tipo por :c:macro:`Py_tss_NEEDS_INIT` é permitida." -#: ../../c-api/init.rst:2064 +#: ../../c-api/init.rst:2294 msgid "" "This macro expands to the initializer for :c:type:`Py_tss_t` variables. Note " "that this macro won't be defined with :ref:`Py_LIMITED_API `." msgstr "" -#: ../../c-api/init.rst:2069 +#: ../../c-api/init.rst:2299 msgid "Dynamic Allocation" msgstr "Alocação dinâmica" -#: ../../c-api/init.rst:2071 +#: ../../c-api/init.rst:2301 msgid "" "Dynamic allocation of the :c:type:`Py_tss_t`, required in extension modules " "built with :ref:`Py_LIMITED_API `, where static allocation of this " "type is not possible due to its implementation being opaque at build time." msgstr "" -#: ../../c-api/init.rst:2078 +#: ../../c-api/init.rst:2308 msgid "" -"Return a value which is the same state as a value initialized with :c:macro:" -"`Py_tss_NEEDS_INIT`, or ``NULL`` in the case of dynamic allocation failure." +"Return a value which is the same state as a value initialized " +"with :c:macro:`Py_tss_NEEDS_INIT`, or ``NULL`` in the case of dynamic " +"allocation failure." msgstr "" -"Retorna um valor que é o mesmo estado de um valor inicializado com :c:macro:" -"`Py_tss_NEEDS_INIT`, ou ``NULL`` no caso de falha de alocação dinâmica." +"Retorna um valor que é o mesmo estado de um valor inicializado " +"com :c:macro:`Py_tss_NEEDS_INIT`, ou ``NULL`` no caso de falha de alocação " +"dinâmica." -#: ../../c-api/init.rst:2085 +#: ../../c-api/init.rst:2315 msgid "" "Free the given *key* allocated by :c:func:`PyThread_tss_alloc`, after first " "calling :c:func:`PyThread_tss_delete` to ensure any associated thread locals " "have been unassigned. This is a no-op if the *key* argument is ``NULL``." msgstr "" -#: ../../c-api/init.rst:2091 +#: ../../c-api/init.rst:2321 msgid "" "A freed key becomes a dangling pointer. You should reset the key to ``NULL``." msgstr "" -#: ../../c-api/init.rst:2096 +#: ../../c-api/init.rst:2326 msgid "Methods" msgstr "Métodos" -#: ../../c-api/init.rst:2098 +#: ../../c-api/init.rst:2328 msgid "" "The parameter *key* of these functions must not be ``NULL``. Moreover, the " "behaviors of :c:func:`PyThread_tss_set` and :c:func:`PyThread_tss_get` are " -"undefined if the given :c:type:`Py_tss_t` has not been initialized by :c:" -"func:`PyThread_tss_create`." +"undefined if the given :c:type:`Py_tss_t` has not been initialized " +"by :c:func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2106 +#: ../../c-api/init.rst:2336 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:2112 +#: ../../c-api/init.rst:2342 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 " @@ -2578,40 +3300,40 @@ msgstr "" "repetidamente na mesma tecla -- chamá-la em uma tecla já inicializada não " "funciona e retorna imediatamente com sucesso." -#: ../../c-api/init.rst:2121 +#: ../../c-api/init.rst:2351 msgid "" "Destroy a TSS key to forget the values associated with the key across all " "threads, and change the key's initialization state to uninitialized. A " -"destroyed key is able to be initialized again by :c:func:" -"`PyThread_tss_create`. This function can be called repeatedly on the same " -"key -- calling it on an already destroyed key is a no-op." +"destroyed key is able to be initialized again " +"by :c:func:`PyThread_tss_create`. This function can be called repeatedly on " +"the same key -- calling it on an already destroyed key is a no-op." msgstr "" -#: ../../c-api/init.rst:2130 +#: ../../c-api/init.rst:2360 msgid "" "Return a zero value to indicate successfully associating a :c:expr:`void*` " "value with a TSS key in the current thread. Each thread has a distinct " "mapping of the key to a :c:expr:`void*` value." msgstr "" -#: ../../c-api/init.rst:2137 +#: ../../c-api/init.rst:2367 msgid "" "Return the :c:expr:`void*` value associated with a TSS key in the current " "thread. This returns ``NULL`` if no value is associated with the key in the " "current thread." msgstr "" -#: ../../c-api/init.rst:2145 +#: ../../c-api/init.rst:2375 msgid "Thread Local Storage (TLS) API" msgstr "" -#: ../../c-api/init.rst:2147 +#: ../../c-api/init.rst:2377 msgid "" "This API is superseded by :ref:`Thread Specific Storage (TSS) API `." msgstr "" -#: ../../c-api/init.rst:2152 +#: ../../c-api/init.rst:2382 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 " @@ -2620,58 +3342,62 @@ msgid "" "platforms." msgstr "" -#: ../../c-api/init.rst:2157 +#: ../../c-api/init.rst:2387 msgid "" "Due to the compatibility problem noted above, this version of the API should " "not be used in new code." msgstr "" -#: ../../c-api/init.rst:2168 +#: ../../c-api/init.rst:2398 msgid "Synchronization Primitives" msgstr "" -#: ../../c-api/init.rst:2170 +#: ../../c-api/init.rst:2400 msgid "The C-API provides a basic mutual exclusion lock." msgstr "" -#: ../../c-api/init.rst:2174 +#: ../../c-api/init.rst:2404 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:2179 +#: ../../c-api/init.rst:2407 +msgid "PyMutex mutex = {0};" +msgstr "" + +#: ../../c-api/init.rst:2409 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:2185 +#: ../../c-api/init.rst:2415 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:2193 +#: ../../c-api/init.rst:2423 msgid "" "Lock mutex *m*. If another thread has already locked it, the calling thread " "will block until the mutex is unlocked. While blocked, the thread will " "temporarily release the :term:`GIL` if it is held." msgstr "" -#: ../../c-api/init.rst:2201 +#: ../../c-api/init.rst:2431 msgid "" "Unlock mutex *m*. The mutex must be locked --- otherwise, the function will " "issue a fatal error." msgstr "" -#: ../../c-api/init.rst:2209 +#: ../../c-api/init.rst:2439 msgid "Python Critical Section API" msgstr "" -#: ../../c-api/init.rst:2211 +#: ../../c-api/init.rst:2441 msgid "" "The critical section API provides a deadlock avoidance layer on top of per-" "object locks for :term:`free-threaded ` CPython. They are " @@ -2679,17 +3405,28 @@ msgid "" "no-ops in versions of Python with the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:2216 +#: ../../c-api/init.rst:2446 +msgid "" +"Critical sections are intended to be used for custom types implemented in C-" +"API extensions. They should generally not be used with built-in types " +"like :class:`list` and :class:`dict` because their public C-APIs already use " +"critical sections internally, with the notable exception " +"of :c:func:`PyDict_Next`, which requires critical section to be acquired " +"externally." +msgstr "" + +#: ../../c-api/init.rst:2453 msgid "" "Critical sections avoid deadlocks by implicitly suspending active critical " -"sections and releasing the locks during calls to :c:func:" -"`PyEval_SaveThread`. When :c:func:`PyEval_RestoreThread` is called, the most " -"recent critical section is resumed, and its locks reacquired. This means " -"the critical section API provides weaker guarantees than traditional locks " -"-- they are useful because their behavior is similar to the :term:`GIL`." +"sections, hence, they do not provide exclusive access such as provided by " +"traditional locks like :c:type:`PyMutex`. When a critical section is " +"started, the per-object lock for the object is acquired. If the code " +"executed inside the critical section calls C-API functions then it can " +"suspend the critical section thereby releasing the per-object lock, so other " +"threads can acquire the per-object lock for the same object." msgstr "" -#: ../../c-api/init.rst:2223 +#: ../../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 " @@ -2697,212 +3434,497 @@ msgid "" "future Python versions." msgstr "" -#: ../../c-api/init.rst:2230 +#: ../../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." +"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:2236 +#: ../../c-api/init.rst:2474 msgid "Example usage::" msgstr "Exemplo de uso::" -#: ../../c-api/init.rst:2247 +#: ../../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 potentital deadlocks due to reentrancy and lock " +"critical section API avoids potential deadlocks due to reentrancy and lock " "ordering by allowing the runtime to temporarily suspend the critical section " -"if the code triggered by the finalizer blocks and calls :c:func:" -"`PyEval_SaveThread`." +"if the code triggered by the finalizer blocks and " +"calls :c:func:`PyEval_SaveThread`." msgstr "" -#: ../../c-api/init.rst:2255 +#: ../../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:2258 ../../c-api/init.rst:2272 -#: ../../c-api/init.rst:2287 ../../c-api/init.rst:2301 +#: ../../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:2264 ../../c-api/init.rst:2293 +#: ../../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:2270 +#: ../../c-api/init.rst:2508 msgid "Ends the critical section and releases the per-object lock." msgstr "" -#: ../../c-api/init.rst:2277 ../../c-api/init.rst:2306 +#: ../../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:2283 +#: ../../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:2299 +#: ../../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:335 +#: ../../c-api/init.rst:2541 +msgid "" +" PyCriticalSection2_End(&_py_cs2);\n" +"}" +msgstr "" + +#: ../../c-api/init.rst:2550 +msgid "Legacy Locking APIs" +msgstr "" + +#: ../../c-api/init.rst:2552 +msgid "" +"These APIs are obsolete since Python 3.13 with the introduction " +"of :c:type:`PyMutex`." +msgstr "" + +#: ../../c-api/init.rst:2555 +msgid "These APIs are now a simple wrapper around ``PyMutex``." +msgstr "" + +#: ../../c-api/init.rst:2561 +msgid "A pointer to a mutual exclusion lock." +msgstr "" + +#: ../../c-api/init.rst:2566 +msgid "The result of acquiring a lock with a timeout." +msgstr "" + +#: ../../c-api/init.rst:2572 +msgid "Failed to acquire the lock." +msgstr "" + +#: ../../c-api/init.rst:2576 +msgid "The lock was successfully acquired." +msgstr "" + +#: ../../c-api/init.rst:2580 +msgid "The lock was interrupted by a signal." +msgstr "" + +#: ../../c-api/init.rst:2585 +msgid "Allocate a new lock." +msgstr "" + +#: ../../c-api/init.rst:2587 +msgid "" +"On success, this function returns a lock; on failure, this function returns " +"``0`` without an exception set." +msgstr "" + +#: ../../c-api/init.rst:2590 ../../c-api/init.rst:2602 +#: ../../c-api/init.rst:2622 ../../c-api/init.rst:2640 +#: ../../c-api/init.rst:2648 ../../c-api/init.rst:2671 +#: ../../c-api/init.rst:2753 ../../c-api/init.rst:2761 +msgid "The caller does not need to hold the :term:`GIL`." +msgstr "" + +#: ../../c-api/init.rst:2592 +msgid "" +"This function now always uses :c:type:`PyMutex`. In prior versions, this " +"would use a lock provided by the operating system." +msgstr "" + +#: ../../c-api/init.rst:2599 +msgid "" +"Destroy *lock*. The lock should not be held by any thread when calling this." +msgstr "" + +#: ../../c-api/init.rst:2607 +msgid "Acquire *lock* with a timeout." +msgstr "" + +#: ../../c-api/init.rst:2609 +msgid "" +"This will wait for *microseconds* microseconds to acquire the lock. If the " +"timeout expires, this function returns :c:enumerator:`PY_LOCK_FAILURE`. If " +"*microseconds* is ``-1``, this will wait indefinitely until the lock has " +"been released." +msgstr "" + +#: ../../c-api/init.rst:2614 +msgid "" +"If *intr_flag* is ``1``, acquiring the lock may be interrupted by a signal, " +"in which case this function returns :c:enumerator:`PY_LOCK_INTR`. Upon " +"interruption, it's generally expected that the caller makes a call " +"to :c:func:`Py_MakePendingCalls` to propagate an exception to Python code." +msgstr "" + +#: ../../c-api/init.rst:2619 +msgid "" +"If the lock is successfully acquired, this function " +"returns :c:enumerator:`PY_LOCK_ACQUIRED`." +msgstr "" + +#: ../../c-api/init.rst:2627 +msgid "Acquire *lock*." +msgstr "" + +#: ../../c-api/init.rst:2629 +msgid "" +"If *waitflag* is ``1`` and another thread currently holds the lock, this " +"function will wait until the lock can be acquired and will always return " +"``1``." +msgstr "" + +#: ../../c-api/init.rst:2633 +msgid "" +"If *waitflag* is ``0`` and another thread holds the lock, this function will " +"not wait and instead return ``0``. If the lock is not held by any other " +"thread, then this function will acquire it and return ``1``." +msgstr "" + +#: ../../c-api/init.rst:2637 +msgid "" +"Unlike :c:func:`PyThread_acquire_lock_timed`, acquiring the lock cannot be " +"interrupted by a signal." +msgstr "" + +#: ../../c-api/init.rst:2645 +msgid "" +"Release *lock*. If *lock* is not held, then this function issues a fatal " +"error." +msgstr "" + +#: ../../c-api/init.rst:2652 +msgid "Operating System Thread APIs" +msgstr "" + +#: ../../c-api/init.rst:2656 +msgid "Sentinel value for an invalid thread ID." +msgstr "" + +#: ../../c-api/init.rst:2658 +msgid "This is currently equivalent to ``(unsigned long)-1``." +msgstr "" + +#: ../../c-api/init.rst:2663 +msgid "" +"Start function *func* in a new thread with argument *arg*. The resulting " +"thread is not intended to be joined." +msgstr "" + +#: ../../c-api/init.rst:2666 +msgid "*func* must not be ``NULL``, but *arg* may be ``NULL``." +msgstr "" + +#: ../../c-api/init.rst:2668 +msgid "" +"On success, this function returns the identifier of the new thread; on " +"failure, this returns :c:macro:`PYTHREAD_INVALID_THREAD_ID`." +msgstr "" + +#: ../../c-api/init.rst:2676 +msgid "Return the identifier of the current thread, which will never be zero." +msgstr "" + +#: ../../c-api/init.rst:2678 ../../c-api/init.rst:2710 +msgid "" +"This function cannot fail, and the caller does not need to hold " +"the :term:`GIL`." +msgstr "" + +#: ../../c-api/init.rst:2682 +msgid ":py:func:`threading.get_ident`" +msgstr "" + +#: ../../c-api/init.rst:2687 +msgid "" +"Get general information about the current thread in the form of " +"a :ref:`struct sequence ` object. This information " +"is accessible as :py:attr:`sys.thread_info` in Python." +msgstr "" + +#: ../../c-api/init.rst:2691 +msgid "" +"On success, this returns a new :term:`strong reference` to the thread " +"information; on failure, this returns ``NULL`` with an exception set." +msgstr "" + +#: ../../c-api/init.rst:2699 +msgid "This macro is defined when the system supports native thread IDs." +msgstr "" + +#: ../../c-api/init.rst:2704 +msgid "" +"Get the native identifier of the current thread as it was assigned by the " +"operating system's kernel, which will never be less than zero." +msgstr "" + +#: ../../c-api/init.rst:2707 +msgid "" +"This function is only available when :c:macro:`PY_HAVE_THREAD_NATIVE_ID` is " +"defined." +msgstr "" + +#: ../../c-api/init.rst:2714 +msgid ":py:func:`threading.get_native_id`" +msgstr "" + +#: ../../c-api/init.rst:2719 +msgid "" +"Terminate the current thread. This function is generally considered unsafe " +"and should be avoided. It is kept solely for backwards compatibility." +msgstr "" + +#: ../../c-api/init.rst:2722 +msgid "" +"This function is only safe to call if all functions in the full call stack " +"are written to safely allow it." +msgstr "" + +#: ../../c-api/init.rst:2727 +msgid "" +"If the current system uses POSIX threads (also known as \"pthreads\"), this " +"calls :manpage:`pthread_exit(3)`, which attempts to unwind the stack and " +"call C++ destructors on some libc implementations. However, if a " +"``noexcept`` function is reached, it may terminate the process. Other " +"systems, such as macOS, do unwinding." +msgstr "" + +#: ../../c-api/init.rst:2733 +msgid "" +"On Windows, this function calls ``_endthreadex()``, which kills the thread " +"without calling C++ destructors." +msgstr "" + +#: ../../c-api/init.rst:2736 +msgid "In any case, there is a risk of corruption on the thread's stack." +msgstr "" + +#: ../../c-api/init.rst:2741 +msgid "" +"Initialize ``PyThread*`` APIs. Python executes this function automatically, " +"so there's little need to call it from an extension module." +msgstr "" + +#: ../../c-api/init.rst:2747 +msgid "Set the stack size of the current thread to *size* bytes." +msgstr "" + +#: ../../c-api/init.rst:2749 +msgid "" +"This function returns ``0`` on success, ``-1`` if *size* is invalid, or " +"``-2`` if the system does not support changing the stack size. This function " +"does not set exceptions." +msgstr "" + +#: ../../c-api/init.rst:2758 +msgid "" +"Return the stack size of the current thread in bytes, or ``0`` if the " +"system's default stack size is in use." +msgstr "" + +#: ../../c-api/init.rst:350 msgid "PyEval_InitThreads()" msgstr "" -#: ../../c-api/init.rst:335 +#: ../../c-api/init.rst:350 msgid "modules (in module sys)" msgstr "" -#: ../../c-api/init.rst:335 ../../c-api/init.rst:576 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:700 msgid "path (in module sys)" -msgstr "" +msgstr "path (no módulo sys)" -#: ../../c-api/init.rst:335 ../../c-api/init.rst:576 ../../c-api/init.rst:1011 -#: ../../c-api/init.rst:1510 ../../c-api/init.rst:1605 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:700 ../../c-api/init.rst:1172 +#: ../../c-api/init.rst:1711 ../../c-api/init.rst:1810 msgid "module" msgstr "módulo" -#: ../../c-api/init.rst:335 ../../c-api/init.rst:1510 ../../c-api/init.rst:1605 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1711 ../../c-api/init.rst:1810 msgid "builtins" msgstr "builtins" -#: ../../c-api/init.rst:335 ../../c-api/init.rst:1510 ../../c-api/init.rst:1605 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1711 ../../c-api/init.rst:1810 msgid "__main__" msgstr "__main__" -#: ../../c-api/init.rst:335 ../../c-api/init.rst:1510 ../../c-api/init.rst:1605 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1711 ../../c-api/init.rst:1810 msgid "sys" msgstr "sys" -#: ../../c-api/init.rst:335 ../../c-api/init.rst:576 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:700 msgid "search" msgstr "pesquisa" -#: ../../c-api/init.rst:335 ../../c-api/init.rst:576 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:700 msgid "path" msgstr "caminho" -#: ../../c-api/init.rst:335 ../../c-api/init.rst:1570 ../../c-api/init.rst:1623 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1775 ../../c-api/init.rst:1828 msgid "Py_FinalizeEx (C function)" -msgstr "" +msgstr "Py_FinalizeEx (função C)" -#: ../../c-api/init.rst:445 +#: ../../c-api/init.rst:566 msgid "Py_Initialize()" msgstr "" -#: ../../c-api/init.rst:445 ../../c-api/init.rst:674 +#: ../../c-api/init.rst:566 ../../c-api/init.rst:798 msgid "main()" msgstr "" -#: ../../c-api/init.rst:445 +#: ../../c-api/init.rst:566 msgid "Py_GetPath()" msgstr "" -#: ../../c-api/init.rst:555 +#: ../../c-api/init.rst:679 msgid "executable (in module sys)" msgstr "" -#: ../../c-api/init.rst:609 ../../c-api/init.rst:651 ../../c-api/init.rst:665 +#: ../../c-api/init.rst:733 ../../c-api/init.rst:775 ../../c-api/init.rst:789 msgid "version (in module sys)" msgstr "" -#: ../../c-api/init.rst:621 +#: ../../c-api/init.rst:745 msgid "platform (in module sys)" msgstr "" -#: ../../c-api/init.rst:638 +#: ../../c-api/init.rst:762 msgid "copyright (in module sys)" msgstr "" -#: ../../c-api/init.rst:674 +#: ../../c-api/init.rst:798 msgid "Py_FatalError()" msgstr "" -#: ../../c-api/init.rst:674 +#: ../../c-api/init.rst:798 msgid "argv (in module sys)" msgstr "" -#: ../../c-api/init.rst:794 +#: ../../c-api/init.rst:918 msgid "global interpreter lock" msgstr "trava global do interpretador" -#: ../../c-api/init.rst:794 +#: ../../c-api/init.rst:918 msgid "interpreter lock" msgstr "" -#: ../../c-api/init.rst:794 +#: ../../c-api/init.rst:918 msgid "lock, interpreter" msgstr "" -#: ../../c-api/init.rst:807 +#: ../../c-api/init.rst:931 msgid "setswitchinterval (in module sys)" msgstr "" -#: ../../c-api/init.rst:816 +#: ../../c-api/init.rst:940 msgid "PyThreadState (C type)" msgstr "" -#: ../../c-api/init.rst:842 +#: ../../c-api/init.rst:966 msgid "Py_BEGIN_ALLOW_THREADS (C macro)" msgstr "" -#: ../../c-api/init.rst:842 +#: ../../c-api/init.rst:966 msgid "Py_END_ALLOW_THREADS (C macro)" msgstr "" -#: ../../c-api/init.rst:858 +#: ../../c-api/init.rst:982 msgid "PyEval_RestoreThread (C function)" msgstr "" -#: ../../c-api/init.rst:858 +#: ../../c-api/init.rst:982 msgid "PyEval_SaveThread (C function)" msgstr "" -#: ../../c-api/init.rst:989 +#: ../../c-api/init.rst:1150 msgid "PyEval_AcquireThread()" msgstr "" -#: ../../c-api/init.rst:989 +#: ../../c-api/init.rst:1150 msgid "PyEval_ReleaseThread()" msgstr "" -#: ../../c-api/init.rst:989 +#: ../../c-api/init.rst:1150 msgid "PyEval_SaveThread()" msgstr "" -#: ../../c-api/init.rst:989 +#: ../../c-api/init.rst:1150 msgid "PyEval_RestoreThread()" msgstr "" -#: ../../c-api/init.rst:1011 +#: ../../c-api/init.rst:1172 msgid "_thread" msgstr "_thread" -#: ../../c-api/init.rst:1510 ../../c-api/init.rst:1605 +#: ../../c-api/init.rst:1711 ../../c-api/init.rst:1810 msgid "stdout (in module sys)" -msgstr "" +msgstr "stdout (no módulo sys)" -#: ../../c-api/init.rst:1510 ../../c-api/init.rst:1605 +#: ../../c-api/init.rst:1711 ../../c-api/init.rst:1810 msgid "stderr (in module sys)" -msgstr "" +msgstr "stderr (no módulo sys)" -#: ../../c-api/init.rst:1510 ../../c-api/init.rst:1605 +#: ../../c-api/init.rst:1711 ../../c-api/init.rst:1810 msgid "stdin (in module sys)" -msgstr "" +msgstr "stdin (no módulo sys)" -#: ../../c-api/init.rst:1570 +#: ../../c-api/init.rst:1775 msgid "Py_Initialize (C function)" -msgstr "" +msgstr "Py_Initialize (função C)" -#: ../../c-api/init.rst:1600 +#: ../../c-api/init.rst:1805 msgid "close (in module os)" msgstr "" diff --git a/c-api/init_config.po b/c-api/init_config.po index da7753bd2..b93b4a48a 100644 --- a/c-api/init_config.po +++ b/c-api/init_config.po @@ -1,48 +1,42 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Marco Rougeth , 2021 -# Italo Penaforte , 2021 -# And Past , 2021 -# Hélio Júnior , 2021 -# Rodrigo Cândido, 2022 -# Lívia Pavini Zeviani, 2022 -# Vitor Buxbaum Orlandi, 2023 -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 +# Gustavo Reis, 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-26 14:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-21 20:14+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Gustavo Reis, 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../c-api/init_config.rst:7 msgid "Python Initialization Configuration" -msgstr "Configuração de Inicialização do Python" +msgstr "Configuração de inicialização do Python" #: ../../c-api/init_config.rst:11 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." +"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 pode ser inicializado com :c:func:`Py_InitializeFromConfig` e a " -"estrutura :c:type:`PyConfig`. Pode ser pré-inicializado com :c:func:" -"`Py_PreInitialize` e a estrutura :c:type:`PyPreConfig`." +"estrutura :c:type:`PyConfig`. Pode ser pré-inicializado " +"com :c:func:`Py_PreInitialize` e a estrutura :c:type:`PyPreConfig`." #: ../../c-api/init_config.rst:15 msgid "There are two kinds of configuration:" @@ -99,6 +93,42 @@ msgid "Example of customized Python always running in isolated mode::" msgstr "" "Exemplo de Python personalizado sendo executado sempre em um modo isolado:" +#: ../../c-api/init_config.rst:41 +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:76 msgid "PyWideStringList" msgstr "PyWideStringList" @@ -249,6 +279,29 @@ msgstr "" msgid "Example::" msgstr "Exemplo::" +#: ../../c-api/init_config.rst:191 +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:213 msgid "PyPreConfig" msgstr "PyPreConfig" @@ -312,11 +365,11 @@ msgstr "``PYMEM_ALLOCATOR_MALLOC`` (``3``): usa ``malloc()`` da biblioteca C." #: ../../c-api/init_config.rst:249 msgid "" -"``PYMEM_ALLOCATOR_MALLOC_DEBUG`` (``4``): force usage of ``malloc()`` with :" -"ref:`debug hooks `." +"``PYMEM_ALLOCATOR_MALLOC_DEBUG`` (``4``): force usage of ``malloc()`` " +"with :ref:`debug hooks `." msgstr "" -"``PYMEM_ALLOCATOR_MALLOC_DEBUG`` (``4``): força uso de ``malloc()`` com :ref:" -"`ganchos de depuração `." +"``PYMEM_ALLOCATOR_MALLOC_DEBUG`` (``4``): força uso de ``malloc()`` " +"com :ref:`ganchos de depuração `." #: ../../c-api/init_config.rst:251 msgid "" @@ -386,8 +439,8 @@ msgstr "Define a localidade LC_CTYPE para a localidade preferida do usuário." #: ../../c-api/init_config.rst:279 msgid "" -"If equals to ``0``, set :c:member:`~PyPreConfig.coerce_c_locale` and :c:" -"member:`~PyPreConfig.coerce_c_locale_warn` members to ``0``." +"If equals to ``0``, set :c:member:`~PyPreConfig.coerce_c_locale` " +"and :c:member:`~PyPreConfig.coerce_c_locale_warn` members to ``0``." msgstr "" "Se igual a ``0``, define os membros :c:member:`~PyPreConfig.coerce_c_locale` " "e :c:member:`~PyPreConfig.coerce_c_locale_warn` para ``0``." @@ -427,8 +480,8 @@ msgstr "Se diferente de zero, emite um aviso se a localidade C for forçada." msgid "" ":ref:`Python Development Mode `: see :c:member:`PyConfig.dev_mode`." msgstr "" -":ref:`Modo de desenvolvimento do Python `: veja :c:member:`PyConfig." -"dev_mode`." +":ref:`Modo de desenvolvimento do Python `: " +"veja :c:member:`PyConfig.dev_mode`." #: ../../c-api/init_config.rst:308 ../../c-api/init_config.rst:719 #: ../../c-api/init_config.rst:765 ../../c-api/init_config.rst:1244 @@ -461,11 +514,9 @@ msgstr "Define :c:member:`PyConfig.filesystem_errors` para ``\"replace\"``." #: ../../c-api/init_config.rst:324 msgid "" -"Initialized the from :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment " +"Initialized from the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment " "variable value." msgstr "" -"Inicializado a partir do valor da variável de ambiente :envvar:" -"`PYTHONLEGACYWINDOWSFSENCODING`." #: ../../c-api/init_config.rst:327 ../../c-api/init_config.rst:935 msgid "" @@ -488,23 +539,23 @@ msgstr "Padrão: ``0``." #: ../../c-api/init_config.rst:334 msgid "" -"If non-zero, :c:func:`Py_PreInitializeFromArgs` and :c:func:" -"`Py_PreInitializeFromBytesArgs` parse their ``argv`` argument the same way " -"the regular Python parses command line arguments: see :ref:`Command Line " -"Arguments `." +"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 "" -"Se diferente de zero, :c:func:`Py_PreInitializeFromArgs` e :c:func:" -"`Py_PreInitializeFromBytesArgs` analisam seu argumento ``argv`` da mesma " -"forma que o Python regular analisa argumentos de linha de comando: veja :ref:" -"`Argumentos de linha de comando `." +"Se diferente de zero, :c:func:`Py_PreInitializeFromArgs` " +"e :c:func:`Py_PreInitializeFromBytesArgs` analisam seu argumento ``argv`` da " +"mesma forma que o Python regular analisa argumentos de linha de comando: " +"veja :ref:`Argumentos de linha de comando `." #: ../../c-api/init_config.rst:343 msgid "" -"Use :ref:`environment variables `? See :c:member:`PyConfig." -"use_environment`." +"Use :ref:`environment variables `? " +"See :c:member:`PyConfig.use_environment`." msgstr "" -"Usar :ref:`variáveis de ambiente `? Veja :c:member:" -"`PyConfig.use_environment`." +"Usar :ref:`variáveis de ambiente `? " +"Veja :c:member:`PyConfig.use_environment`." #: ../../c-api/init_config.rst:346 ../../c-api/init_config.rst:1272 msgid "Default: ``1`` in Python config and ``0`` in isolated config." @@ -552,19 +603,19 @@ msgstr "Configura a localidade LC_CTYPE (:term:`codificação da localidade`)" #: ../../c-api/init_config.rst:369 msgid "" -"Set the :ref:`Python UTF-8 Mode ` (:c:member:`PyPreConfig." -"utf8_mode`)" +"Set the :ref:`Python UTF-8 Mode ` " +"(:c:member:`PyPreConfig.utf8_mode`)" msgstr "" -"Define o :ref:`Modo UTF-8 do Python ` (:c:member:`PyPreConfig." -"utf8_mode`)" +"Define o :ref:`Modo UTF-8 do Python ` " +"(:c:member:`PyPreConfig.utf8_mode`)" #: ../../c-api/init_config.rst:372 msgid "" "The current preconfiguration (``PyPreConfig`` type) is stored in " "``_PyRuntime.preconfig``." msgstr "" -"A pré-configuração atual (tipo ``PyPreConfig``) é armazenada em ``_PyRuntime." -"preconfig``." +"A pré-configuração atual (tipo ``PyPreConfig``) é armazenada em " +"``_PyRuntime.preconfig``." #: ../../c-api/init_config.rst:375 msgid "Functions to preinitialize Python:" @@ -582,56 +633,57 @@ msgstr "*preconfig* não pode ser ``NULL``.." #: ../../c-api/init_config.rst:387 msgid "" -"Parse *argv* command line arguments (bytes strings) if :c:member:" -"`~PyPreConfig.parse_argv` of *preconfig* is non-zero." +"Parse *argv* command line arguments (bytes strings) " +"if :c:member:`~PyPreConfig.parse_argv` of *preconfig* is non-zero." msgstr "" -"Analisa argumentos de linha de comando *argv* (strings de bytes) se :c:" -"member:`~PyPreConfig.parse_argv` de *preconfig* for diferente de zero." +"Analisa argumentos de linha de comando *argv* (strings de bytes) " +"se :c:member:`~PyPreConfig.parse_argv` de *preconfig* for diferente de zero." #: ../../c-api/init_config.rst:396 msgid "" -"Parse *argv* command line arguments (wide strings) if :c:member:" -"`~PyPreConfig.parse_argv` of *preconfig* is non-zero." +"Parse *argv* command line arguments (wide strings) " +"if :c:member:`~PyPreConfig.parse_argv` of *preconfig* is non-zero." msgstr "" -"Analisa argumentos de linha de comando *argv* (strings largas) se :c:member:" -"`~PyPreConfig.parse_argv` de *preconfig* for diferente de zero." +"Analisa argumentos de linha de comando *argv* (strings largas) " +"se :c:member:`~PyPreConfig.parse_argv` de *preconfig* for diferente de zero." -#: ../../c-api/init_config.rst:401 ../../c-api/init_config.rst:1360 +#: ../../c-api/init_config.rst:401 ../../c-api/init_config.rst:1358 msgid "" -"The caller is responsible to handle exceptions (error or exit) using :c:func:" -"`PyStatus_Exception` and :c:func:`Py_ExitStatusException`." +"The caller is responsible to handle exceptions (error or exit) " +"using :c:func:`PyStatus_Exception` and :c:func:`Py_ExitStatusException`." msgstr "" -"O chamador é responsável por manipular exceções (erro ou saída) usando :c:" -"func:`PyStatus_Exception` e :c:func:`Py_ExitStatusException`." +"O chamador é responsável por manipular exceções (erro ou saída) " +"usando :c:func:`PyStatus_Exception` e :c:func:`Py_ExitStatusException`." #: ../../c-api/init_config.rst:404 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 "" -"Para :ref:`configuração do Python ` (:c:func:" -"`PyPreConfig_InitPythonConfig`), se o Python for inicializado com argumentos " -"de linha de comando, os argumentos de linha de comando também devem ser " -"passados ​​para pré-inicializar o Python, pois eles têm um efeito na pré-" -"configuração como codificações. Por exemplo, a opção de linha de comando :" -"option:`-X utf8 <-X>` habilita o :ref:`Modo UTF-8 do Python `." +"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 "" +"Para :ref:`configuração do Python ` " +"(:c:func:`PyPreConfig_InitPythonConfig`), se o Python for inicializado com " +"argumentos de linha de comando, os argumentos de linha de comando também " +"devem ser passados para pré-inicializar o Python, pois eles têm um efeito na " +"pré-configuração como codificações. Por exemplo, a opção de linha de " +"comando :option:`-X utf8 <-X>` habilita o :ref:`Modo UTF-8 do Python `." #: ../../c-api/init_config.rst:411 msgid "" "``PyMem_SetAllocator()`` can be called after :c:func:`Py_PreInitialize` and " "before :c:func:`Py_InitializeFromConfig` to install a custom memory " -"allocator. It can be called before :c:func:`Py_PreInitialize` if :c:member:" -"`PyPreConfig.allocator` is set to ``PYMEM_ALLOCATOR_NOT_SET``." +"allocator. It can be called before :c:func:`Py_PreInitialize` " +"if :c:member:`PyPreConfig.allocator` is set to ``PYMEM_ALLOCATOR_NOT_SET``." msgstr "" -"``PyMem_SetAllocator()`` pode ser chamado depois de :c:func:" -"`Py_PreInitialize` e antes de :c:func:`Py_InitializeFromConfig` para " -"instalar um alocador de memória personalizado. Ele pode ser chamado antes " -"de :c:func:`Py_PreInitialize` se :c:member:`PyPreConfig.allocator` estiver " -"definido como ``PYMEM_ALLOCATOR_NOT_SET``." +"``PyMem_SetAllocator()`` pode ser chamado depois " +"de :c:func:`Py_PreInitialize` e antes de :c:func:`Py_InitializeFromConfig` " +"para instalar um alocador de memória personalizado. Ele pode ser chamado " +"antes de :c:func:`Py_PreInitialize` se :c:member:`PyPreConfig.allocator` " +"estiver definido como ``PYMEM_ALLOCATOR_NOT_SET``." #: ../../c-api/init_config.rst:416 msgid "" @@ -642,8 +694,9 @@ msgid "" msgstr "" "Funções de alocação de memória do Python como :c:func:`PyMem_RawMalloc` não " "devem ser usadas antes da pré-inicialização do Python, enquanto chamar " -"diretamente ``malloc()`` e ``free()`` é sempre seguro. :c:func:" -"`Py_DecodeLocale` não deve ser chamado antes da pré-inicialização do Python." +"diretamente ``malloc()`` e ``free()`` é sempre " +"seguro. :c:func:`Py_DecodeLocale` não deve ser chamado antes da pré-" +"inicialização do Python." #: ../../c-api/init_config.rst:421 msgid "" @@ -653,6 +706,26 @@ msgstr "" "Exemplo usando a pré-inicialização para habilitar o :ref:`modo UTF-8 do " "Python `." +#: ../../c-api/init_config.rst:424 +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:443 msgid "PyConfig" msgstr "PyConfig" @@ -710,8 +783,8 @@ msgstr "" #: ../../c-api/init_config.rst:488 msgid "" "Set command line arguments (:c:member:`~PyConfig.argv` member of *config*) " -"from the *argv* list of bytes strings. Decode bytes using :c:func:" -"`Py_DecodeLocale`." +"from the *argv* list of bytes strings. Decode bytes " +"using :c:func:`Py_DecodeLocale`." msgstr "" #: ../../c-api/init_config.rst:496 @@ -720,11 +793,11 @@ msgstr "" #: ../../c-api/init_config.rst:502 msgid "Read all Python configuration." -msgstr "" +msgstr "Lê toda a configuração do Python." #: ../../c-api/init_config.rst:504 msgid "Fields which are already initialized are left unchanged." -msgstr "" +msgstr "Campos que já estão inicializados permanecem inalterados." #: ../../c-api/init_config.rst:506 msgid "" @@ -736,16 +809,17 @@ msgstr "" 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." +"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:517 msgid "" -"The :c:member:`PyConfig.argv` arguments are now only parsed once, :c:member:" -"`PyConfig.parse_argv` is set to ``2`` after arguments are parsed, and " -"arguments are only parsed if :c:member:`PyConfig.parse_argv` equals ``1``." +"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:523 @@ -757,15 +831,15 @@ msgstr "" #: ../../c-api/init_config.rst:531 msgid "Release configuration memory." -msgstr "" +msgstr "Libera memória de configuração." #: ../../c-api/init_config.rst:533 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:" +"In that case, the Python preinitialization configuration " +"(:c:type:`PyPreConfig`) is 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:539 @@ -788,8 +862,8 @@ msgstr ":c:member:`PyConfig.use_environment`" 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)." +"preinitialization configuration depends on command line arguments " +"(if :c:member:`~PyConfig.parse_argv` is non-zero)." msgstr "" #: ../../c-api/init_config.rst:549 @@ -800,19 +874,21 @@ msgstr "" #: ../../c-api/init_config.rst:562 msgid "" -"Set :data:`sys.argv` command line arguments based on :c:member:`~PyConfig." -"argv`. These parameters are similar to those passed to the program's :c:" -"func:`main` function with the difference that the first entry should refer " -"to the script file to be executed rather than the executable hosting the " -"Python interpreter. If there isn't a script that will be run, the first " -"entry in :c:member:`~PyConfig.argv` can be an empty string." +"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:570 msgid "" -"Set :c:member:`~PyConfig.parse_argv` to ``1`` to parse :c:member:`~PyConfig." -"argv` the same way the regular Python parses Python command line arguments " -"and then to strip Python arguments from :c:member:`~PyConfig.argv`." +"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:575 @@ -838,8 +914,8 @@ msgstr "" #: ../../c-api/init_config.rst:584 msgid "" -"If equals to zero, ``Py_RunMain()`` prepends a potentially unsafe path to :" -"data:`sys.path` at startup:" +"If equals to zero, ``Py_RunMain()`` prepends a potentially unsafe path " +"to :data:`sys.path` at startup:" msgstr "" #: ../../c-api/init_config.rst:587 @@ -862,8 +938,8 @@ msgstr "" #: ../../c-api/init_config.rst:594 msgid "" -"Set to ``1`` by the :option:`-P` command line option and the :envvar:" -"`PYTHONSAFEPATH` environment variable." +"Set to ``1`` by the :option:`-P` command line option and " +"the :envvar:`PYTHONSAFEPATH` environment variable." msgstr "" #: ../../c-api/init_config.rst:597 @@ -883,14 +959,14 @@ msgstr "" #: ../../c-api/init_config.rst:609 msgid "See also :c:member:`PyConfig.exec_prefix`." -msgstr "" +msgstr "Veja também :c:member:`PyConfig.exec_prefix`." #: ../../c-api/init_config.rst:613 -msgid "Python base executable: :data:`sys._base_executable`." +msgid "Python base executable: ``sys._base_executable``." msgstr "" #: ../../c-api/init_config.rst:615 -msgid "Set by the :envvar:`__PYVENV_LAUNCHER__` environment variable." +msgid "Set by the ``__PYVENV_LAUNCHER__`` environment variable." msgstr "" #: ../../c-api/init_config.rst:617 @@ -917,8 +993,8 @@ msgstr "" #: ../../c-api/init_config.rst:640 msgid "" -"Set to ``0`` by the :option:`-u` command line option and the :envvar:" -"`PYTHONUNBUFFERED` environment variable." +"Set to ``0`` by the :option:`-u` command line option and " +"the :envvar:`PYTHONUNBUFFERED` environment variable." msgstr "" #: ../../c-api/init_config.rst:643 @@ -926,14 +1002,15 @@ msgid "stdin is always opened in buffered mode." msgstr "" #: ../../c-api/init_config.rst:645 ../../c-api/init_config.rst:678 -#: ../../c-api/init_config.rst:1197 ../../c-api/init_config.rst:1330 +#: ../../c-api/init_config.rst:1197 ../../c-api/init_config.rst:1329 msgid "Default: ``1``." msgstr "Padrão: ``1``." #: ../../c-api/init_config.rst:649 msgid "" -"If equals to ``1``, issue a warning when comparing :class:`bytes` or :class:" -"`bytearray` with :class:`str`, or comparing :class:`bytes` with :class:`int`." +"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:653 @@ -948,9 +1025,9 @@ msgstr "" #: ../../c-api/init_config.rst:662 msgid "" -"If non-zero, emit a :exc:`EncodingWarning` warning when :class:`io." -"TextIOWrapper` uses its default encoding. See :ref:`io-encoding-warning` for " -"details." +"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:671 @@ -968,8 +1045,8 @@ msgstr "" #: ../../c-api/init_config.rst:684 msgid "" -"Control the validation behavior of hash-based ``.pyc`` files: value of the :" -"option:`--check-hash-based-pycs` command line option." +"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:687 @@ -1027,8 +1104,8 @@ msgstr "" #: ../../c-api/init_config.rst:716 msgid "" -"Set to ``1`` by the :option:`-X dev <-X>` option and the :envvar:" -"`PYTHONDEVMODE` environment variable." +"Set to ``1`` by the :option:`-X dev <-X>` option and " +"the :envvar:`PYTHONDEVMODE` environment variable." msgstr "" #: ../../c-api/init_config.rst:723 @@ -1061,8 +1138,8 @@ msgstr "" #: ../../c-api/init_config.rst:747 msgid "" -"The absolute path of the executable binary for the Python interpreter: :data:" -"`sys.executable`." +"The absolute path of the executable binary for the Python " +"interpreter: :data:`sys.executable`." msgstr "" #: ../../c-api/init_config.rst:754 @@ -1079,14 +1156,14 @@ msgstr "" #: ../../c-api/init_config.rst:762 msgid "" -"Set to ``1`` by :option:`-X faulthandler <-X>` and the :envvar:" -"`PYTHONFAULTHANDLER` environment variable." +"Set to ``1`` by :option:`-X faulthandler <-X>` and " +"the :envvar:`PYTHONFAULTHANDLER` environment variable." msgstr "" #: ../../c-api/init_config.rst:769 msgid "" -":term:`Filesystem encoding `: :func:" -"`sys.getfilesystemencoding`." +":term:`Filesystem encoding `: :func:`sys.getfilesystemencoding`." msgstr "" #: ../../c-api/init_config.rst:772 @@ -1095,9 +1172,9 @@ msgstr "" #: ../../c-api/init_config.rst:774 msgid "" -"On Windows: use ``\"utf-8\"`` by default, or ``\"mbcs\"`` if :c:member:" -"`~PyPreConfig.legacy_windows_fs_encoding` of :c:type:`PyPreConfig` is non-" -"zero." +"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:778 @@ -1136,15 +1213,15 @@ msgstr "" #: ../../c-api/init_config.rst:795 msgid "" -":term:`Filesystem error handler `: :" -"func:`sys.getfilesystemencodeerrors`." +":term:`Filesystem error handler `: :func:`sys.getfilesystemencodeerrors`." msgstr "" #: ../../c-api/init_config.rst:798 msgid "" -"On Windows: use ``\"surrogatepass\"`` by default, or ``\"replace\"`` if :c:" -"member:`~PyPreConfig.legacy_windows_fs_encoding` of :c:type:`PyPreConfig` is " -"non-zero." +"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:802 @@ -1212,8 +1289,8 @@ msgstr "" #: ../../c-api/init_config.rst:840 msgid "" -"Set the ``1`` by the :option:`-X importtime <-X>` option and the :envvar:" -"`PYTHONPROFILEIMPORTTIME` environment variable." +"Set the ``1`` by the :option:`-X importtime <-X>` option and " +"the :envvar:`PYTHONPROFILEIMPORTTIME` environment variable." msgstr "" #: ../../c-api/init_config.rst:847 @@ -1230,8 +1307,8 @@ msgstr "" #: ../../c-api/init_config.rst:854 msgid "" -"Incremented by the :option:`-i` command line option. Set to ``1`` if the :" -"envvar:`PYTHONINSPECT` environment variable is non-empty." +"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:861 @@ -1255,10 +1332,11 @@ msgstr "" 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." +"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." msgstr "" #: ../../c-api/init_config.rst:883 @@ -1269,21 +1347,22 @@ msgstr "" #: ../../c-api/init_config.rst:886 msgid "" -"Default: ``-1`` in Python mode. 4300 (:data:`sys.int_info." -"default_max_str_digits`) in isolated mode." +"Default: ``-1`` in Python mode. 4300 " +"(:data:`sys.int_info.default_max_str_digits`) in isolated mode." msgstr "" #: ../../c-api/init_config.rst:893 msgid "" "If the value of :c:member:`~PyConfig.cpu_count` is not ``-1`` then it will " -"override the return values of :func:`os.cpu_count`, :func:`os." -"process_cpu_count`, and :func:`multiprocessing.cpu_count`." +"override the return values " +"of :func:`os.cpu_count`, :func:`os.process_cpu_count`, " +"and :func:`multiprocessing.cpu_count`." msgstr "" #: ../../c-api/init_config.rst:897 msgid "" -"Configured by the :samp:`-X cpu_count={n|default}` command line flag or the :" -"envvar:`PYTHON_CPU_COUNT` environment variable." +"Configured by the :samp:`-X cpu_count={n|default}` command line flag or " +"the :envvar:`PYTHON_CPU_COUNT` environment variable." msgstr "" #: ../../c-api/init_config.rst:900 ../../c-api/init_config.rst:1259 @@ -1325,15 +1404,15 @@ msgstr "" #: ../../c-api/init_config.rst:923 msgid "" -"See also the :ref:`Isolated Configuration ` and :c:" -"member:`PyPreConfig.isolated`." +"See also the :ref:`Isolated Configuration ` " +"and :c:member:`PyPreConfig.isolated`." msgstr "" #: ../../c-api/init_config.rst:928 msgid "" -"If non-zero, use :class:`io.FileIO` instead of :class:`!io." -"_WindowsConsoleIO` for :data:`sys.stdin`, :data:`sys.stdout` and :data:`sys." -"stderr`." +"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:932 @@ -1341,8 +1420,9 @@ msgid "" "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment variable " "is set to a non-empty string." msgstr "" -"Definida como ``1`` se a variável de ambiente :envvar:" -"`PYTHONLEGACYWINDOWSSTDIO` estiver definida como uma string não vazia." +"Definida como ``1`` se a variável de " +"ambiente :envvar:`PYTHONLEGACYWINDOWSSTDIO` estiver definida como uma string " +"não vazia." #: ../../c-api/init_config.rst:940 msgid "See also the :pep:`528` (Change Windows console encoding to UTF-8)." @@ -1374,9 +1454,9 @@ msgstr "" #: ../../c-api/init_config.rst:960 msgid "" -"Default: value of the ``PLATLIBDIR`` macro which is set by the :option:" -"`configure --with-platlibdir option <--with-platlibdir>` (default: " -"``\"lib\"``, or ``\"DLLs\"`` on Windows)." +"Default: value of the ``PLATLIBDIR`` macro which is set by " +"the :option:`configure --with-platlibdir option <--with-platlibdir>` " +"(default: ``\"lib\"``, or ``\"DLLs\"`` on Windows)." msgstr "" #: ../../c-api/init_config.rst:968 @@ -1389,8 +1469,8 @@ msgstr "" #: ../../c-api/init_config.rst:977 msgid "" -"Module search paths (:data:`sys.path`) as a string separated by ``DELIM`` (:" -"data:`os.pathsep`)." +"Module search paths (:data:`sys.path`) as a string separated by ``DELIM`` " +"(:data:`os.pathsep`)." msgstr "" #: ../../c-api/init_config.rst:980 @@ -1403,10 +1483,10 @@ msgstr "" #: ../../c-api/init_config.rst:991 msgid "" -"If :c:member:`~PyConfig.module_search_paths_set` is equal to ``0``, :c:func:" -"`Py_InitializeFromConfig` will replace :c:member:`~PyConfig." -"module_search_paths` and sets :c:member:`~PyConfig.module_search_paths_set` " -"to ``1``." +"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``." msgstr "" #: ../../c-api/init_config.rst:996 @@ -1433,8 +1513,8 @@ msgstr "" #: ../../c-api/init_config.rst:1009 msgid "" -"Incremented by the :option:`-O` command line option. Set to the :envvar:" -"`PYTHONOPTIMIZE` environment variable value." +"Incremented by the :option:`-O` command line option. Set to " +"the :envvar:`PYTHONOPTIMIZE` environment variable value." msgstr "" #: ../../c-api/init_config.rst:1016 @@ -1445,21 +1525,22 @@ msgstr "" #: ../../c-api/init_config.rst:1019 msgid "" -"If :c:member:`~PyConfig.orig_argv` list is empty and :c:member:`~PyConfig." -"argv` is not a list only containing an empty string, :c:func:`PyConfig_Read` " -"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)." +"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)." msgstr "" #: ../../c-api/init_config.rst:1026 msgid "" -"See also the :c:member:`~PyConfig.argv` member and the :c:func:" -"`Py_GetArgcArgv` function." +"See also the :c:member:`~PyConfig.argv` member and " +"the :c:func:`Py_GetArgcArgv` function." msgstr "" -#: ../../c-api/init_config.rst:1029 ../../c-api/init_config.rst:1317 -#: ../../c-api/init_config.rst:1336 +#: ../../c-api/init_config.rst:1029 ../../c-api/init_config.rst:1316 +#: ../../c-api/init_config.rst:1335 msgid "Default: empty list." msgstr "Padrão: lista vazia." @@ -1476,8 +1557,8 @@ msgstr "" #: ../../c-api/init_config.rst:1049 msgid "" -"The :c:member:`PyConfig.argv` arguments are now only parsed if :c:member:" -"`PyConfig.parse_argv` equals to ``1``." +"The :c:member:`PyConfig.argv` arguments are now only parsed " +"if :c:member:`PyConfig.parse_argv` equals to ``1``." msgstr "" #: ../../c-api/init_config.rst:1055 @@ -1488,8 +1569,8 @@ msgstr "" #: ../../c-api/init_config.rst:1058 msgid "" -"Incremented by the :option:`-d` command line option. Set to the :envvar:" -"`PYTHONDEBUG` environment variable value." +"Incremented by the :option:`-d` command line option. Set to " +"the :envvar:`PYTHONDEBUG` environment variable value." msgstr "" #: ../../c-api/init_config.rst:1061 ../../c-api/init_config.rst:1166 @@ -1530,8 +1611,8 @@ msgstr "" #: ../../c-api/init_config.rst:1095 msgid "" -"If the ``WITH_NEXT_FRAMEWORK`` macro is defined, use :envvar:" -"`__PYVENV_LAUNCHER__` environment variable if set." +"If the ``WITH_NEXT_FRAMEWORK`` macro is defined, use ``__PYVENV_LAUNCHER__`` " +"environment variable if set." msgstr "" #: ../../c-api/init_config.rst:1097 @@ -1547,8 +1628,8 @@ msgstr "" #: ../../c-api/init_config.rst:1108 msgid "" -"Directory where cached ``.pyc`` files are written: :data:`sys." -"pycache_prefix`." +"Directory where cached ``.pyc`` files are " +"written: :data:`sys.pycache_prefix`." msgstr "" #: ../../c-api/init_config.rst:1111 @@ -1582,8 +1663,9 @@ msgstr "" #: ../../c-api/init_config.rst:1138 msgid "" -"Filename passed on the command line: trailing command line argument without :" -"option:`-c` or :option:`-m`. It is used by the :c:func:`Py_RunMain` function." +"Filename passed on the command line: trailing command line argument " +"without :option:`-c` or :option:`-m`. It is used by the :c:func:`Py_RunMain` " +"function." msgstr "" #: ../../c-api/init_config.rst:1142 @@ -1650,8 +1732,8 @@ msgstr "" #: ../../c-api/init_config.rst:1194 msgid "" -":data:`sys.flags.no_site ` is set to the inverted value of :c:" -"member:`~PyConfig.site_import`." +":data:`sys.flags.no_site ` is set to the inverted value " +"of :c:member:`~PyConfig.site_import`." msgstr "" #: ../../c-api/init_config.rst:1201 @@ -1672,8 +1754,8 @@ msgstr "" #: ../../c-api/init_config.rst:1214 msgid "" -"Encoding and encoding errors of :data:`sys.stdin`, :data:`sys.stdout` and :" -"data:`sys.stderr` (but :data:`sys.stderr` always uses " +"Encoding and encoding errors of :data:`sys.stdin`, :data:`sys.stdout` " +"and :data:`sys.stderr` (but :data:`sys.stderr` always uses " "``\"backslashreplace\"`` error handler)." msgstr "" @@ -1726,8 +1808,8 @@ msgstr "" #: ../../c-api/init_config.rst:1241 msgid "" -"Set by :option:`-X tracemalloc=N <-X>` command line option and by the :" -"envvar:`PYTHONTRACEMALLOC` environment variable." +"Set by :option:`-X tracemalloc=N <-X>` command line option and by " +"the :envvar:`PYTHONTRACEMALLOC` environment variable." msgstr "" #: ../../c-api/init_config.rst:1248 @@ -1742,11 +1824,11 @@ msgstr "" #: ../../c-api/init_config.rst:1253 msgid "" -"Set by :option:`-X perf <-X>` command-line option and by the :envvar:" -"`PYTHON_PERF_JIT_SUPPORT` environment variable for perf support with stack " -"pointers and :option:`-X perf_jit <-X>` command-line option and by the :" -"envvar:`PYTHON_PERF_JIT_SUPPORT` environment variable for perf support with " -"DWARF JIT information." +"Set by :option:`-X perf <-X>` command-line option and by " +"the :envvar:`PYTHON_PERF_JIT_SUPPORT` environment variable for perf support " +"with stack pointers and :option:`-X perf_jit <-X>` command-line option and " +"by the :envvar:`PYTHON_PERF_JIT_SUPPORT` environment variable for perf " +"support with DWARF JIT information." msgstr "" #: ../../c-api/init_config.rst:1265 @@ -1807,94 +1889,122 @@ msgstr "" 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)." +"of ``warnings.filters`` which is checked first (highest priority)." msgstr "" -#: ../../c-api/init_config.rst:1310 +#: ../../c-api/init_config.rst:1309 msgid "" -"The :option:`-W` command line options adds its value to :c:member:`~PyConfig." -"warnoptions`, it can be used multiple times." +"The :option:`-W` command line options adds its value " +"to :c:member:`~PyConfig.warnoptions`, it can be used multiple times." msgstr "" -#: ../../c-api/init_config.rst:1313 +#: ../../c-api/init_config.rst:1312 msgid "" "The :envvar:`PYTHONWARNINGS` environment variable can also be used to add " -"warning options. Multiple options can be specified, separated by commas (``," -"``)." +"warning options. Multiple options can be specified, separated by commas " +"(``,``)." msgstr "" -#: ../../c-api/init_config.rst:1321 +#: ../../c-api/init_config.rst:1320 msgid "" "If equal to ``0``, Python won't try to write ``.pyc`` files on the import of " "source modules." msgstr "" -#: ../../c-api/init_config.rst:1324 +#: ../../c-api/init_config.rst:1323 msgid "" -"Set to ``0`` by the :option:`-B` command line option and the :envvar:" -"`PYTHONDONTWRITEBYTECODE` environment variable." +"Set to ``0`` by the :option:`-B` command line option and " +"the :envvar:`PYTHONDONTWRITEBYTECODE` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1327 +#: ../../c-api/init_config.rst:1326 msgid "" -":data:`sys.dont_write_bytecode` is initialized to the inverted value of :c:" -"member:`~PyConfig.write_bytecode`." +":data:`sys.dont_write_bytecode` is initialized to the inverted value " +"of :c:member:`~PyConfig.write_bytecode`." msgstr "" -#: ../../c-api/init_config.rst:1334 +#: ../../c-api/init_config.rst:1333 msgid "Values of the :option:`-X` command line options: :data:`sys._xoptions`." msgstr "" -#: ../../c-api/init_config.rst:1338 +#: ../../c-api/init_config.rst:1337 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`." +"line arguments `, and Python arguments are stripped " +"from :c:member:`~PyConfig.argv`." msgstr "" -#: ../../c-api/init_config.rst:1343 +#: ../../c-api/init_config.rst:1342 msgid "" "The :c:member:`~PyConfig.xoptions` options are parsed to set other options: " "see the :option:`-X` command line option." msgstr "" -#: ../../c-api/init_config.rst:1348 +#: ../../c-api/init_config.rst:1347 msgid "The ``show_alloc_count`` field has been removed." msgstr "" -#: ../../c-api/init_config.rst:1352 +#: ../../c-api/init_config.rst:1353 msgid "Initialization with PyConfig" msgstr "" -#: ../../c-api/init_config.rst:1354 -msgid "Function to initialize Python:" -msgstr "" - -#: ../../c-api/init_config.rst:1358 -msgid "Initialize Python from *config* configuration." +#: ../../c-api/init_config.rst:1355 +msgid "" +"Initializing the interpreter from a populated configuration struct is " +"handled by calling :c:func:`Py_InitializeFromConfig`." msgstr "" -#: ../../c-api/init_config.rst:1363 +#: ../../c-api/init_config.rst:1361 msgid "" -"If :c:func:`PyImport_FrozenModules`, :c:func:`PyImport_AppendInittab` or :c:" -"func:`PyImport_ExtendInittab` are used, they must be set or called after " -"Python preinitialization and before the Python initialization. If Python is " -"initialized multiple times, :c:func:`PyImport_AppendInittab` or :c:func:" -"`PyImport_ExtendInittab` must be called before each Python initialization." +"If :c:func:`PyImport_FrozenModules`, :c:func:`PyImport_AppendInittab` " +"or :c:func:`PyImport_ExtendInittab` are used, they must be set or called " +"after Python preinitialization and before the Python initialization. If " +"Python is initialized multiple times, :c:func:`PyImport_AppendInittab` " +"or :c:func:`PyImport_ExtendInittab` must be called before each Python " +"initialization." msgstr "" -#: ../../c-api/init_config.rst:1370 +#: ../../c-api/init_config.rst:1368 msgid "" "The current configuration (``PyConfig`` type) is stored in " "``PyInterpreterState.config``." msgstr "" -#: ../../c-api/init_config.rst:1373 +#: ../../c-api/init_config.rst:1371 msgid "Example setting the program name::" msgstr "" -#: ../../c-api/init_config.rst:1401 +#: ../../c-api/init_config.rst:1373 +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:1399 msgid "" "More complete example modifying the default configuration, read the " "configuration, and then override some parameters. Note that since 3.11, many " @@ -1903,18 +2013,74 @@ msgid "" "called will be left unchanged by initialization::" msgstr "" -#: ../../c-api/init_config.rst:1464 +#: ../../c-api/init_config.rst:1406 +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:1462 msgid "Isolated Configuration" msgstr "" -#: ../../c-api/init_config.rst:1466 +#: ../../c-api/init_config.rst:1464 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." +":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:1471 +#: ../../c-api/init_config.rst:1469 msgid "" "This configuration ignores global configuration variables, environment " "variables, command line arguments (:c:member:`PyConfig.argv` is not parsed) " @@ -1922,136 +2088,133 @@ msgid "" "LC_CTYPE locale are left unchanged. Signal handlers are not installed." msgstr "" -#: ../../c-api/init_config.rst:1476 +#: ../../c-api/init_config.rst:1474 msgid "" "Configuration files are still used with this configuration to determine " "paths that are unspecified. Ensure :c:member:`PyConfig.home` is specified to " "avoid computing the default path configuration." msgstr "" -#: ../../c-api/init_config.rst:1484 +#: ../../c-api/init_config.rst:1482 msgid "Python Configuration" msgstr "Configuração do Python" -#: ../../c-api/init_config.rst:1486 +#: ../../c-api/init_config.rst:1484 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." +":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:1490 +#: ../../c-api/init_config.rst:1488 msgid "" "Environments variables and command line arguments are used to configure " "Python, whereas global configuration variables are ignored." msgstr "" -#: ../../c-api/init_config.rst:1493 +#: ../../c-api/init_config.rst:1491 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." +"Mode ` (:pep:`540`) depending on the LC_CTYPE " +"locale, :envvar:`PYTHONUTF8` and :envvar:`PYTHONCOERCECLOCALE` environment " +"variables." msgstr "" -#: ../../c-api/init_config.rst:1502 +#: ../../c-api/init_config.rst:1500 msgid "Python Path Configuration" msgstr "" -#: ../../c-api/init_config.rst:1504 +#: ../../c-api/init_config.rst:1502 msgid ":c:type:`PyConfig` contains multiple fields for the path configuration:" msgstr "" -#: ../../c-api/init_config.rst:1506 +#: ../../c-api/init_config.rst:1504 msgid "Path configuration inputs:" msgstr "" -#: ../../c-api/init_config.rst:1508 +#: ../../c-api/init_config.rst:1506 msgid ":c:member:`PyConfig.home`" msgstr ":c:member:`PyConfig.home`" -#: ../../c-api/init_config.rst:1509 +#: ../../c-api/init_config.rst:1507 msgid ":c:member:`PyConfig.platlibdir`" msgstr ":c:member:`PyConfig.platlibdir`" -#: ../../c-api/init_config.rst:1510 +#: ../../c-api/init_config.rst:1508 msgid ":c:member:`PyConfig.pathconfig_warnings`" msgstr ":c:member:`PyConfig.pathconfig_warnings`" -#: ../../c-api/init_config.rst:1511 +#: ../../c-api/init_config.rst:1509 msgid ":c:member:`PyConfig.program_name`" msgstr ":c:member:`PyConfig.program_name`" -#: ../../c-api/init_config.rst:1512 +#: ../../c-api/init_config.rst:1510 msgid ":c:member:`PyConfig.pythonpath_env`" msgstr ":c:member:`PyConfig.pythonpath_env`" -#: ../../c-api/init_config.rst:1513 +#: ../../c-api/init_config.rst:1511 msgid "current working directory: to get absolute paths" msgstr "" -#: ../../c-api/init_config.rst:1514 +#: ../../c-api/init_config.rst:1512 msgid "" -"``PATH`` environment variable to get the program full path (from :c:member:" -"`PyConfig.program_name`)" +"``PATH`` environment variable to get the program full path " +"(from :c:member:`PyConfig.program_name`)" msgstr "" -#: ../../c-api/init_config.rst:1516 +#: ../../c-api/init_config.rst:1514 msgid "``__PYVENV_LAUNCHER__`` environment variable" msgstr "" -#: ../../c-api/init_config.rst:1517 +#: ../../c-api/init_config.rst:1515 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:1521 +#: ../../c-api/init_config.rst:1519 msgid "Path configuration output fields:" msgstr "" -#: ../../c-api/init_config.rst:1523 +#: ../../c-api/init_config.rst:1521 msgid ":c:member:`PyConfig.base_exec_prefix`" msgstr ":c:member:`PyConfig.base_exec_prefix`" -#: ../../c-api/init_config.rst:1524 +#: ../../c-api/init_config.rst:1522 msgid ":c:member:`PyConfig.base_executable`" msgstr ":c:member:`PyConfig.base_executable`" -#: ../../c-api/init_config.rst:1525 +#: ../../c-api/init_config.rst:1523 msgid ":c:member:`PyConfig.base_prefix`" msgstr ":c:member:`PyConfig.base_prefix`" -#: ../../c-api/init_config.rst:1526 +#: ../../c-api/init_config.rst:1524 msgid ":c:member:`PyConfig.exec_prefix`" msgstr ":c:member:`PyConfig.exec_prefix`" -#: ../../c-api/init_config.rst:1527 +#: ../../c-api/init_config.rst:1525 msgid ":c:member:`PyConfig.executable`" msgstr ":c:member:`PyConfig.executable`" -#: ../../c-api/init_config.rst:1528 -msgid "" -":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." -"module_search_paths`" -msgstr "" -":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." -"module_search_paths`" +#: ../../c-api/init_config.rst:1526 +msgid ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig.module_search_paths`" +msgstr ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig.module_search_paths`" -#: ../../c-api/init_config.rst:1530 +#: ../../c-api/init_config.rst:1528 msgid ":c:member:`PyConfig.prefix`" msgstr ":c:member:`PyConfig.prefix`" -#: ../../c-api/init_config.rst:1532 +#: ../../c-api/init_config.rst:1530 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` is overridden and :c:member:`~PyConfig." -"module_search_paths_set` is set to ``1``." +"configuration to fill unset fields. " +"If :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``." msgstr "" -#: ../../c-api/init_config.rst:1538 +#: ../../c-api/init_config.rst:1536 msgid "" "It is possible to completely ignore the function calculating the default " "path configuration by setting explicitly all path configuration output " @@ -2061,224 +2224,198 @@ msgid "" "modification." msgstr "" -#: ../../c-api/init_config.rst:1545 +#: ../../c-api/init_config.rst:1543 msgid "" "Set :c:member:`~PyConfig.pathconfig_warnings` to ``0`` to suppress warnings " "when calculating the path configuration (Unix only, Windows does not log any " "warning)." msgstr "" -#: ../../c-api/init_config.rst:1548 +#: ../../c-api/init_config.rst:1546 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." +"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:1552 +#: ../../c-api/init_config.rst:1550 msgid ":c:func:`Py_RunMain` and :c:func:`Py_Main` modify :data:`sys.path`:" msgstr "" -#: ../../c-api/init_config.rst:1554 +#: ../../c-api/init_config.rst:1552 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`." +"contains a ``__main__.py`` script, " +"prepend :c:member:`~PyConfig.run_filename` to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1557 +#: ../../c-api/init_config.rst:1555 msgid "If :c:member:`~PyConfig.isolated` is zero:" msgstr "" -#: ../../c-api/init_config.rst:1559 +#: ../../c-api/init_config.rst:1557 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:1561 +#: ../../c-api/init_config.rst:1559 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:1563 +#: ../../c-api/init_config.rst:1561 msgid "Otherwise, prepend an empty string to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1565 +#: ../../c-api/init_config.rst:1563 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." -"user_site_directory` is non-zero and the user's site-package directory " -"exists, the :mod:`site` module appends the user's site-package directory to :" -"data:`sys.path`." +"modified by the :mod:`site` module. " +"If :c:member:`~PyConfig.user_site_directory` is non-zero and the user's site-" +"package directory exists, the :mod:`site` module appends the user's site-" +"package directory to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1571 +#: ../../c-api/init_config.rst:1569 msgid "The following configuration files are used by the path configuration:" msgstr "" -#: ../../c-api/init_config.rst:1573 +#: ../../c-api/init_config.rst:1571 msgid "``pyvenv.cfg``" msgstr "``pyvenv.cfg``" -#: ../../c-api/init_config.rst:1574 +#: ../../c-api/init_config.rst:1572 msgid "``._pth`` file (ex: ``python._pth``)" msgstr "" -#: ../../c-api/init_config.rst:1575 +#: ../../c-api/init_config.rst:1573 msgid "``pybuilddir.txt`` (Unix only)" msgstr "" -#: ../../c-api/init_config.rst:1577 +#: ../../c-api/init_config.rst:1575 msgid "If a ``._pth`` file is present:" msgstr "" -#: ../../c-api/init_config.rst:1579 +#: ../../c-api/init_config.rst:1577 msgid "Set :c:member:`~PyConfig.isolated` to ``1``." msgstr "" -#: ../../c-api/init_config.rst:1580 +#: ../../c-api/init_config.rst:1578 msgid "Set :c:member:`~PyConfig.use_environment` to ``0``." msgstr "" -#: ../../c-api/init_config.rst:1581 +#: ../../c-api/init_config.rst:1579 msgid "Set :c:member:`~PyConfig.site_import` to ``0``." msgstr "" -#: ../../c-api/init_config.rst:1582 +#: ../../c-api/init_config.rst:1580 msgid "Set :c:member:`~PyConfig.safe_path` to ``1``." msgstr "" -#: ../../c-api/init_config.rst:1584 -msgid "" -"The ``__PYVENV_LAUNCHER__`` environment variable is used to set :c:member:" -"`PyConfig.base_executable`." -msgstr "" - -#: ../../c-api/init_config.rst:1589 -msgid "Py_RunMain()" -msgstr "Py_RunMain()" - -#: ../../c-api/init_config.rst:1593 -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:1598 -msgid "By default and when if :option:`-i` option is used, run the REPL." -msgstr "" - -#: ../../c-api/init_config.rst:1600 -msgid "" -"Finally, finalizes Python and returns an exit status that can be passed to " -"the ``exit()`` function." -msgstr "" - -#: ../../c-api/init_config.rst:1603 +#: ../../c-api/init_config.rst:1582 msgid "" -"See :ref:`Python Configuration ` for an example of " -"customized Python always running in isolated mode using :c:func:`Py_RunMain`." +"The ``__PYVENV_LAUNCHER__`` environment variable is used to " +"set :c:member:`PyConfig.base_executable`." msgstr "" -#: ../../c-api/init_config.rst:1609 +#: ../../c-api/init_config.rst:1587 msgid "Py_GetArgcArgv()" msgstr "Py_GetArgcArgv()" -#: ../../c-api/init_config.rst:1613 +#: ../../c-api/init_config.rst:1591 msgid "Get the original command line arguments, before Python modified them." msgstr "" -#: ../../c-api/init_config.rst:1615 +#: ../../c-api/init_config.rst:1593 msgid "See also :c:member:`PyConfig.orig_argv` member." msgstr "" -#: ../../c-api/init_config.rst:1619 +#: ../../c-api/init_config.rst:1597 msgid "Multi-Phase Initialization Private Provisional API" msgstr "" -#: ../../c-api/init_config.rst:1621 +#: ../../c-api/init_config.rst:1599 msgid "" "This section is a private provisional API introducing multi-phase " "initialization, the core feature of :pep:`432`:" msgstr "" -#: ../../c-api/init_config.rst:1624 +#: ../../c-api/init_config.rst:1602 msgid "\"Core\" initialization phase, \"bare minimum Python\":" msgstr "" -#: ../../c-api/init_config.rst:1626 +#: ../../c-api/init_config.rst:1604 msgid "Builtin types;" msgstr "" -#: ../../c-api/init_config.rst:1627 +#: ../../c-api/init_config.rst:1605 msgid "Builtin exceptions;" msgstr "" -#: ../../c-api/init_config.rst:1628 +#: ../../c-api/init_config.rst:1606 msgid "Builtin and frozen modules;" msgstr "" -#: ../../c-api/init_config.rst:1629 +#: ../../c-api/init_config.rst:1607 msgid "" "The :mod:`sys` module is only partially initialized (ex: :data:`sys.path` " "doesn't exist yet)." msgstr "" -#: ../../c-api/init_config.rst:1632 +#: ../../c-api/init_config.rst:1610 msgid "\"Main\" initialization phase, Python is fully initialized:" msgstr "" -#: ../../c-api/init_config.rst:1634 +#: ../../c-api/init_config.rst:1612 msgid "Install and configure :mod:`importlib`;" msgstr "" -#: ../../c-api/init_config.rst:1635 +#: ../../c-api/init_config.rst:1613 msgid "Apply the :ref:`Path Configuration `;" msgstr "" -#: ../../c-api/init_config.rst:1636 +#: ../../c-api/init_config.rst:1614 msgid "Install signal handlers;" msgstr "" -#: ../../c-api/init_config.rst:1637 +#: ../../c-api/init_config.rst:1615 msgid "" -"Finish :mod:`sys` module initialization (ex: create :data:`sys.stdout` and :" -"data:`sys.path`);" +"Finish :mod:`sys` module initialization (ex: create :data:`sys.stdout` " +"and :data:`sys.path`);" msgstr "" -#: ../../c-api/init_config.rst:1639 +#: ../../c-api/init_config.rst:1617 msgid "" "Enable optional features like :mod:`faulthandler` and :mod:`tracemalloc`;" msgstr "" -#: ../../c-api/init_config.rst:1640 +#: ../../c-api/init_config.rst:1618 msgid "Import the :mod:`site` module;" msgstr "" -#: ../../c-api/init_config.rst:1641 +#: ../../c-api/init_config.rst:1619 msgid "etc." msgstr "etc." -#: ../../c-api/init_config.rst:1643 +#: ../../c-api/init_config.rst:1621 msgid "Private provisional API:" msgstr "" -#: ../../c-api/init_config.rst:1645 +#: ../../c-api/init_config.rst:1623 msgid "" -":c:member:`PyConfig._init_main`: if set to ``0``, :c:func:" -"`Py_InitializeFromConfig` stops at the \"Core\" initialization phase." +"``PyConfig._init_main``: if set to ``0``, :c:func:`Py_InitializeFromConfig` " +"stops at the \"Core\" initialization phase." msgstr "" -#: ../../c-api/init_config.rst:1650 +#: ../../c-api/init_config.rst:1628 msgid "" "Move to the \"Main\" initialization phase, finish the Python initialization." msgstr "" -#: ../../c-api/init_config.rst:1652 +#: ../../c-api/init_config.rst:1630 msgid "" "No module is imported during the \"Core\" phase and the ``importlib`` module " "is not configured: the :ref:`Path Configuration ` is only " @@ -2287,14 +2424,14 @@ msgid "" "maybe install a custom :data:`sys.meta_path` importer or an import hook, etc." msgstr "" -#: ../../c-api/init_config.rst:1658 +#: ../../c-api/init_config.rst:1636 msgid "" "It may become possible to calculate the :ref:`Path Configuration ` in Python, after the Core phase and before the Main phase, which is " "one of the :pep:`432` motivation." msgstr "" -#: ../../c-api/init_config.rst:1662 +#: ../../c-api/init_config.rst:1640 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 " @@ -2302,12 +2439,49 @@ msgid "" "until a proper public API is designed." msgstr "" -#: ../../c-api/init_config.rst:1667 +#: ../../c-api/init_config.rst:1645 msgid "" "Example running Python code between \"Core\" and \"Main\" initialization " "phases::" msgstr "" +#: ../../c-api/init_config.rst:1648 +msgid "" +"void init_python(void)\n" +"{\n" +" PyStatus status;\n" +"\n" +" PyConfig config;\n" +" PyConfig_InitPythonConfig(&config);\n" +" config._init_main = 0;\n" +"\n" +" /* ... customize 'config' configuration ... */\n" +"\n" +" status = Py_InitializeFromConfig(&config);\n" +" PyConfig_Clear(&config);\n" +" if (PyStatus_Exception(status)) {\n" +" Py_ExitStatusException(status);\n" +" }\n" +"\n" +" /* Use sys.stderr because sys.stdout is only created\n" +" by _Py_InitializeMain() */\n" +" int res = PyRun_SimpleString(\n" +" \"import sys; \"\n" +" \"print('Run Python code before _Py_InitializeMain', \"\n" +" \"file=sys.stderr)\");\n" +" if (res < 0) {\n" +" exit(1);\n" +" }\n" +"\n" +" /* ... put more configuration code here ... */\n" +"\n" +" status = _Py_InitializeMain();\n" +" if (PyStatus_Exception(status)) {\n" +" Py_ExitStatusException(status);\n" +" }\n" +"}" +msgstr "" + #: ../../c-api/init_config.rst:558 msgid "main()" msgstr "" diff --git a/c-api/intro.po b/c-api/intro.po index 4d743a8f7..f5e7cbf7f 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -1,31 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Ruan Aragão , 2021 -# Leticia Portella , 2021 -# Italo Penaforte , 2021 -# felipe caridade fernandes , 2021 -# Marco Rougeth , 2023 -# Claudio Rogerio Carvalho Filho , 2023 -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 +# Rafael Fontenelle , 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-05 14:16+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-21 20:14+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -42,8 +37,8 @@ msgid "" "API. The first reason is to write *extension modules* for specific purposes; " "these are C modules that extend the Python interpreter. This is probably " "the most common use. The second reason is to use Python as a component in a " -"larger application; this technique is generally referred to as :dfn:" -"`embedding` Python in an application." +"larger application; this technique is generally referred to " +"as :dfn:`embedding` Python in an application." msgstr "" "A Interface de Programação de Aplicações (API) para Python fornece aos " "programadores C e C++ acesso ao interpretador Python em uma variedade de " @@ -115,15 +110,23 @@ msgstr "" "Todas as definições de função, tipo e macro necessárias para usar a API " "Python/C estão incluídas em seu código pela seguinte linha::" +#: ../../c-api/intro.rst:51 +msgid "" +"#define PY_SSIZE_T_CLEAN\n" +"#include " +msgstr "" +"#define PY_SSIZE_T_CLEAN\n" +"#include " + #: ../../c-api/intro.rst:54 msgid "" "This implies inclusion of the following standard headers: ````, " -"````, ````, ````, ```` and ```` (if available)." +"````, ````, ````, ```` and " +"```` (if available)." msgstr "" "Isso implica a inclusão dos seguintes cabeçalhos padrão: ````, " -"````, ````, ````, ```` e ```` (se disponível)." +"````, ````, ````, ```` e " +"```` (se disponível)." #: ../../c-api/intro.rst:60 msgid "" @@ -132,16 +135,17 @@ msgid "" "any standard headers are included." msgstr "" "Uma vez que Python pode definir algumas definições de pré-processador que " -"afetam os cabeçalhos padrão em alguns sistemas, você *deve* incluir :file:" -"`Python.h` antes de quaisquer cabeçalhos padrão serem incluídos." +"afetam os cabeçalhos padrão em alguns sistemas, você *deve* " +"incluir :file:`Python.h` antes de quaisquer cabeçalhos padrão serem " +"incluídos." #: ../../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." msgstr "" -"É recomendável sempre definir ``PY_SSIZE_T_CLEAN`` antes de incluir ``Python." -"h``. Veja :ref:`arg-parsing` para uma descrição desta macro." +"É recomendável sempre definir ``PY_SSIZE_T_CLEAN`` antes de incluir " +"``Python.h``. Veja :ref:`arg-parsing` para uma descrição desta macro." #: ../../c-api/intro.rst:67 msgid "" @@ -172,13 +176,13 @@ msgstr "" #: ../../c-api/intro.rst:79 msgid "" "The header files are typically installed with Python. On Unix, these are " -"located in the directories :file:`{prefix}/include/pythonversion/` and :file:" -"`{exec_prefix}/include/pythonversion/`, where :option:`prefix <--prefix>` " -"and :option:`exec_prefix <--exec-prefix>` are defined by the corresponding " -"parameters to Python's :program:`configure` script and *version* is ``'%d." -"%d' % sys.version_info[:2]``. On Windows, the headers are installed in :" -"file:`{prefix}/include`, where ``prefix`` is the installation directory " -"specified to the installer." +"located in the directories :file:`{prefix}/include/pythonversion/` " +"and :file:`{exec_prefix}/include/pythonversion/`, where :option:`prefix <--" +"prefix>` and :option:`exec_prefix <--exec-prefix>` are defined by the " +"corresponding parameters to Python's :program:`configure` script and " +"*version* is ``'%d.%d' % sys.version_info[:2]``. On Windows, the headers " +"are installed in :file:`{prefix}/include`, where ``prefix`` is the " +"installation directory specified to the installer." msgstr "" "Os arquivos de cabeçalho são normalmente instalados com Python. No Unix, " "eles estão localizados nos diretórios :file:`{prefix}/include/pythonversion/" @@ -194,14 +198,14 @@ msgid "" "To include the headers, place both directories (if different) on your " "compiler's search path for includes. Do *not* place the parent directories " "on the search path and then use ``#include ``; this will " -"break on multi-platform builds since the platform independent headers under :" -"option:`prefix <--prefix>` include the platform specific headers from :" -"option:`exec_prefix <--exec-prefix>`." +"break on multi-platform builds since the platform independent headers " +"under :option:`prefix <--prefix>` include the platform specific headers " +"from :option:`exec_prefix <--exec-prefix>`." msgstr "" "Para incluir os cabeçalhos, coloque os dois diretórios (se diferentes) no " "caminho de pesquisa do compilador para as inclusões. *Não* coloque os " -"diretórios pais no caminho de busca e então use ``#include ``; isto irá quebrar em compilações multiplataforma, uma vez que os " +"diretórios pais no caminho de busca e então use ``#include ``; isto irá quebrar em compilações multiplataforma, uma vez que os " "cabeçalhos independentes da plataforma em :option:`prefix <--prefix>` " "incluem os cabeçalhos específicos da plataforma de :option:`exec_prefix <--" "exec-prefix>`." @@ -229,9 +233,9 @@ msgid "" "a complete listing." msgstr "" "Diversas macros úteis são definidas nos arquivos de cabeçalho do Python. " -"Muitas são definidas mais próximas de onde são úteis (por exemplo, :c:macro:" -"`Py_RETURN_NONE`). Outras de utilidade mais geral são definidas aqui. Esta " -"não é necessariamente uma lista completa." +"Muitas são definidas mais próximas de onde são úteis (por " +"exemplo, :c:macro:`Py_RETURN_NONE`). Outras de utilidade mais geral são " +"definidas aqui. Esta não é necessariamente uma lista completa." #: ../../c-api/intro.rst:110 msgid "" @@ -255,19 +259,95 @@ msgstr "" "*name* é o nome do módulo, e deve ser o único item não-\\ ``static`` " "definido no arquivo do módulo. Exemplo::" +#: ../../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" +"}" +msgstr "" +"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" +"}" + #: ../../c-api/intro.rst:134 msgid "Return the absolute value of ``x``." msgstr "Retorna o valor absoluto de ``x``." -#: ../../c-api/intro.rst:140 +#: ../../c-api/intro.rst:136 +msgid "" +"If the result cannot be represented (for example, if ``x`` has :c:macro:`!" +"INT_MIN` value for :c:expr:`int` type), the behavior is undefined." +msgstr "" +"Se o resultado não puder ser representado (por exemplo, se ``x`` tiver o " +"valor :c:macro:`!INT_MIN` para o tipo :c:expr:`int`), o comportamento é " +"indefinido." + +#: ../../c-api/intro.rst:144 +msgid "Specify alignment to *num* bytes on compilers that support it." +msgstr "" + +#: ../../c-api/intro.rst:146 +msgid "Consider using the C11 standard ``_Alignas`` specifier over this macro." +msgstr "" + +#: ../../c-api/intro.rst:150 +msgid "" +"Similar to ``integer >> positions``, but forces sign extension, as the C " +"standard does not define whether a right-shift of a signed integer will " +"perform sign extension or a zero-fill." +msgstr "" + +#: ../../c-api/intro.rst:154 +msgid "" +"*integer* should be any signed integer type. *positions* is the number of " +"positions to shift to the right." +msgstr "" + +#: ../../c-api/intro.rst:157 +msgid "" +"Both *integer* and *positions* can be evaluated more than once; " +"consequently, avoid directly passing a function call or some other operation " +"with side-effects to this macro. Instead, store the result as a variable and " +"then pass it." +msgstr "" + +#: ../../c-api/intro.rst:162 +msgid "" +"*type* is unused and only kept for backwards compatibility. Historically, " +"*type* was used to cast *integer*." +msgstr "" + +#: ../../c-api/intro.rst:167 +msgid "" +"This macro is now valid for all signed integer types, not just those for " +"which ``unsigned type`` is legal. As a result, *type* is no longer used." +msgstr "" + +#: ../../c-api/intro.rst:173 msgid "" "Ask the compiler to always inline a static inline function. The compiler can " -"ignore it and decides to not inline the function." +"ignore it and decide to not inline the function." msgstr "" "Pede ao compilador para sempre embutir uma função em linha estática. O " "compilador pode ignorá-lo e decide não inserir a função." -#: ../../c-api/intro.rst:143 +#: ../../c-api/intro.rst:176 msgid "" "It can be used to inline performance critical static inline functions when " "building Python in debug mode with function inlining disabled. For example, " @@ -278,7 +358,7 @@ msgstr "" "linha desabilitada. Por exemplo, o MSC desabilita a função de inserir em " "linha ao compilar no modo de depuração." -#: ../../c-api/intro.rst:147 +#: ../../c-api/intro.rst:180 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 " @@ -289,21 +369,36 @@ msgstr "" "exemplo). O compilador geralmente é mais inteligente que o desenvolvedor " "para a análise de custo/benefício." -#: ../../c-api/intro.rst:151 +#: ../../c-api/intro.rst:184 msgid "" -"If Python is :ref:`built in debug mode ` (if the :c:macro:" -"`Py_DEBUG` macro is defined), the :c:macro:`Py_ALWAYS_INLINE` macro does " -"nothing." +"If Python is :ref:`built in debug mode ` (if " +"the :c:macro:`Py_DEBUG` macro is defined), the :c:macro:`Py_ALWAYS_INLINE` " +"macro does nothing." msgstr "" "Se o Python tiver sido :ref:`compilado em modo de depuração ` " -"(se a macro :c:macro:`Py_DEBUG` estiver definida), a macro :c:macro:" -"`Py_ALWAYS_INLINE` não fará nada." +"(se a macro :c:macro:`Py_DEBUG` estiver definida), a " +"macro :c:macro:`Py_ALWAYS_INLINE` não fará nada." -#: ../../c-api/intro.rst:154 +#: ../../c-api/intro.rst:187 msgid "It must be specified before the function return type. Usage::" msgstr "Deve ser especificado antes do tipo de retorno da função. Uso::" -#: ../../c-api/intro.rst:162 +#: ../../c-api/intro.rst:189 +msgid "static inline Py_ALWAYS_INLINE int random(void) { return 4; }" +msgstr "static inline Py_ALWAYS_INLINE int random(void) { return 4; }" + +#: ../../c-api/intro.rst:195 +msgid "" +"If this macro is defined, then the current system is able to start threads." +msgstr "" + +#: ../../c-api/intro.rst:197 +msgid "" +"Currently, all systems supported by CPython (per :pep:`11`), with the " +"exception of some WebAssembly platforms, support starting threads." +msgstr "" + +#: ../../c-api/intro.rst:204 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``." @@ -312,7 +407,7 @@ msgstr "" "127] ou [0, 255]. Esta macro retorna ``c`` convertido em um ``unsigned " "char``." -#: ../../c-api/intro.rst:167 +#: ../../c-api/intro.rst:209 msgid "" "Use this for deprecated declarations. The macro must be placed before the " "symbol name." @@ -320,16 +415,38 @@ msgstr "" "Use isso para declarações descontinuadas. A macro deve ser colocada antes do " "nome do símbolo." -#: ../../c-api/intro.rst:170 ../../c-api/intro.rst:256 -#: ../../c-api/intro.rst:274 +#: ../../c-api/intro.rst:212 ../../c-api/intro.rst:388 +#: ../../c-api/intro.rst:406 msgid "Example::" msgstr "Exemplo::" -#: ../../c-api/intro.rst:174 +#: ../../c-api/intro.rst:214 +msgid "Py_DEPRECATED(3.8) PyAPI_FUNC(int) Py_OldFunction(void);" +msgstr "Py_DEPRECATED(3.8) PyAPI_FUNC(int) Py_OldFunction(void);" + +#: ../../c-api/intro.rst:216 msgid "MSVC support was added." msgstr "Suporte a MSVC foi adicionado." -#: ../../c-api/intro.rst:179 +#: ../../c-api/intro.rst:221 +msgid "" +"This is equivalent to ``X``, which is useful for token-pasting in macros, as " +"macro expansions in *X* are forcefully evaluated by the preprocessor." +msgstr "" + +#: ../../c-api/intro.rst:227 +msgid "" +"Use a GCC attribute *name*, hiding it from compilers that don't support GCC " +"attributes (such as MSVC)." +msgstr "" + +#: ../../c-api/intro.rst:230 +msgid "" +"This expands to ``__attribute__((name))`` on a GCC compiler, and expands to " +"nothing on compilers that don't support GCC attributes." +msgstr "" + +#: ../../c-api/intro.rst:235 msgid "" "Like ``getenv(s)``, but returns ``NULL`` if :option:`-E` was passed on the " "command line (see :c:member:`PyConfig.use_environment`)." @@ -337,40 +454,127 @@ msgstr "" "Como ``getenv(s)``, mas retorna ``NULL`` se a opção :option:`-E` foi passada " "na linha de comando (veja :c:member:`PyConfig.use_environment`)." -#: ../../c-api/intro.rst:184 +#: ../../c-api/intro.rst:240 +msgid "Use *number* as a ``long long`` integer literal." +msgstr "" + +#: ../../c-api/intro.rst:242 +msgid "" +"This usally expands to *number* followed by ``LL``, but will expand to some " +"compiler-specific suffixes (such as ``I64``) on older compilers." +msgstr "" + +#: ../../c-api/intro.rst:245 +msgid "" +"In modern versions of Python, this macro is not very useful, as C99 and " +"later require the ``LL`` suffix to be valid for an integer." +msgstr "" + +#: ../../c-api/intro.rst:250 +msgid "" +"Declare a function returning the specified *type* using a fast-calling " +"qualifier for functions that are local to the current file. Semantically, " +"this is equivalent to ``static type``." +msgstr "" +"Declara uma função que retorne o *type* especificado usando um qualificador " +"de chamada rápida para funções locais ao arquivo atual. Semanticamente, isso " +"equivale a ``static type``." + +#: ../../c-api/intro.rst:256 +msgid "" +"Equivalent to :c:macro:`Py_LOCAL` but additionally requests the function be " +"inlined." +msgstr "" +"Equivalente a :c:macro:`Py_LOCAL`, mas que também exige que a função seja " +"inserida localmente." + +#: ../../c-api/intro.rst:261 +msgid "" +"Macro used to declare a symbol as local to the shared library (hidden). On " +"supported platforms, it ensures the symbol is not exported." +msgstr "" + +#: ../../c-api/intro.rst:264 +msgid "" +"On compatible versions of GCC/Clang, it expands to " +"``__attribute__((visibility(\"hidden\")))``." +msgstr "" + +#: ../../c-api/intro.rst:269 msgid "Return the maximum value between ``x`` and ``y``." msgstr "Retorna o valor máximo entre ``x`` e ``y``." -#: ../../c-api/intro.rst:190 +#: ../../c-api/intro.rst:275 msgid "Return the size of a structure (``type``) ``member`` in bytes." msgstr "Retorna o tamanho do ``member`` de uma estrutura (``type``) em bytes." -#: ../../c-api/intro.rst:196 +#: ../../c-api/intro.rst:281 msgid "Return the minimum value between ``x`` and ``y``." msgstr "Retorna o valor mínimo entre ``x`` e ``y``." -#: ../../c-api/intro.rst:202 +#: ../../c-api/intro.rst:287 msgid "" "Disable inlining on a function. For example, it reduces the C stack " -"consumption: useful on LTO+PGO builds which heavily inline code (see :issue:" -"`33720`)." +"consumption: useful on LTO+PGO builds which heavily inline code " +"(see :issue:`33720`)." msgstr "" "Desabilita a inserção em linha em uma função. Por exemplo, isso reduz o " "consumo da pilha C: útil em compilações LTO+PGO que faz uso intenso de " "inserção em linha de código (veja :issue:`33720`)." -#: ../../c-api/intro.rst:206 +#: ../../c-api/intro.rst:291 msgid "Usage::" msgstr "Uso::" -#: ../../c-api/intro.rst:214 +#: ../../c-api/intro.rst:293 +msgid "Py_NO_INLINE static int random(void) { return 4; }" +msgstr "Py_NO_INLINE static int random(void) { return 4; }" + +#: ../../c-api/intro.rst:299 +msgid "" +"Cast *value* to type *smaller* from type *larger*, validating that no " +"information was lost." +msgstr "" + +#: ../../c-api/intro.rst:302 +msgid "" +"On release builds of Python, this is roughly equivalent to ``(smaller) " +"value`` (in C++, ``static_cast(value)`` will be used instead)." +msgstr "" + +#: ../../c-api/intro.rst:306 +msgid "" +"On debug builds (implying that :c:macro:`Py_DEBUG` is defined), this asserts " +"that no information was lost with the cast from *larger* to *smaller*." +msgstr "" + +#: ../../c-api/intro.rst:309 +msgid "" +"*value*, *larger*, and *smaller* may all be evaluated more than once in the " +"expression; consequently, do not pass an expression with side-effects " +"directly to this macro." +msgstr "" + +#: ../../c-api/intro.rst:315 msgid "" "Convert ``x`` to a C string. E.g. ``Py_STRINGIFY(123)`` returns ``\"123\"``." msgstr "" "Converte ``x`` para uma string C. Por exemplo, ``Py_STRINGIFY(123)`` retorna " "``\"123\"``." -#: ../../c-api/intro.rst:221 +#: ../../c-api/intro.rst:322 +msgid "" +"Similar to :c:macro:`Py_LL`, but *number* will be an ``unsigned long long`` " +"literal instead. This is done by appending ``U`` to the result of ``Py_LL``." +msgstr "" + +#: ../../c-api/intro.rst:325 +msgid "" +"In modern versions of Python, this macro is not very useful, as C99 and " +"later require the ``ULL``/``LLU`` suffixes to be valid for an integer." +msgstr "" + +#: ../../c-api/intro.rst:330 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 " @@ -383,7 +587,7 @@ msgstr "" "instruções ``case``. Use isto em lugares onde você pode ficar tentado a " "colocar uma chamada ``assert(0)`` ou ``abort()``." -#: ../../c-api/intro.rst:226 +#: ../../c-api/intro.rst:335 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 " @@ -393,15 +597,13 @@ msgstr "" "evita um aviso sobre código inacessível. Por exemplo, a macro é implementada " "com ``__builtin_unreachable()`` no GCC em modo de lançamento." -#: ../../c-api/intro.rst:230 +#: ../../c-api/intro.rst:339 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`." +"A use for ``Py_UNREACHABLE()`` is following a call to a function that never " +"returns but that is not declared ``_Py_NO_RETURN``." msgstr "" -"Um uso para ``Py_UNREACHABLE()`` é seguir uma chamada de uma função que " -"nunca retorna, mas que não é declarada com :c:macro:`_Py_NO_RETURN`." -#: ../../c-api/intro.rst:233 +#: ../../c-api/intro.rst:342 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 " @@ -416,7 +618,7 @@ msgstr "" "Se o erro não puder ser reportado ao chamador, :c:func:`Py_FatalError` pode " "ser usada." -#: ../../c-api/intro.rst:243 +#: ../../c-api/intro.rst:352 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; }``." @@ -425,15 +627,51 @@ msgstr "" "silenciar avisos do compilador. Exemplo: ``int func(int a, int Py_UNUSED(b)) " "{ return a; }``." -#: ../../c-api/intro.rst:250 +#: ../../c-api/intro.rst:359 +msgid "" +"Asserts a compile-time condition *cond*, as a statement. The build will fail " +"if the condition is false or cannot be evaluated at compile time." +msgstr "" +"Realiza asserção de uma condição de tempo de compilação *cond*, como uma " +"instrução. A construção falhará se a condição for falsa ou não puder ser " +"avaliada em tempo de compilação." + +#: ../../c-api/intro.rst:362 ../../c-api/intro.rst:373 +#: ../../c-api/intro.rst:418 +msgid "For example::" +msgstr "Por exemplo::" + +#: ../../c-api/intro.rst:364 +msgid "Py_BUILD_ASSERT(sizeof(PyTime_t) == sizeof(int64_t));" +msgstr "Py_BUILD_ASSERT(sizeof(PyTime_t) == sizeof(int64_t));" + +#: ../../c-api/intro.rst:370 msgid "" -"Creates a variable with name ``name`` that can be used in docstrings. If " +"Asserts a compile-time condition *cond*, as an expression that evaluates to " +"``0``. The build will fail if the condition is false or cannot be evaluated " +"at compile time." +msgstr "" +"Realiza asserção de uma condição de tempo de compilação *cond*, como uma " +"expressão que é avaliada com ``0``. A construção falhará se a condição for " +"falsa ou não puder ser avaliada em tempo de compilação." + +#: ../../c-api/intro.rst:375 +msgid "" +"#define foo_to_char(foo) \\\n" +" ((char *)(foo) + Py_BUILD_ASSERT_EXPR(offsetof(struct foo, string) == 0))" +msgstr "" +"#define foo_to_char(foo) \\\n" +" ((char *)(foo) + Py_BUILD_ASSERT_EXPR(offsetof(struct foo, string) == 0))" + +#: ../../c-api/intro.rst:382 +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 "" -"Cria uma variável com o nome ``name`` que pode ser usada em docstrings. Se o " +"Cria uma variável com o nome *name* que pode ser usada em docstrings. Se o " "Python for compilado sem docstrings, o valor estará vazio." -#: ../../c-api/intro.rst:253 +#: ../../c-api/intro.rst:385 msgid "" "Use :c:macro:`PyDoc_STRVAR` for docstrings to support building Python " "without docstrings, as specified in :pep:`7`." @@ -441,7 +679,25 @@ msgstr "" "Use :c:macro:`PyDoc_STRVAR` para docstrings para ter suporte à compilação do " "Python sem docstrings, conforme especificado em :pep:`7`." -#: ../../c-api/intro.rst:268 +#: ../../c-api/intro.rst:390 +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 "" +"PyDoc_STRVAR(pop_doc, \"Remove e retorna o elemento mais à direita.\");\n" +"\n" +"static PyMethodDef deque_methods[] = {\n" +" // ...\n" +" {\"pop\", (PyCFunction)deque_pop, METH_NOARGS, pop_doc},\n" +" // ...\n" +"}" + +#: ../../c-api/intro.rst:400 msgid "" "Creates a docstring for the given input string or an empty string if " "docstrings are disabled." @@ -449,7 +705,7 @@ msgstr "" "Cria uma docstring para a string de entrada fornecida ou uma string vazia se " "docstrings estiverem desabilitadas." -#: ../../c-api/intro.rst:271 +#: ../../c-api/intro.rst:403 msgid "" "Use :c:macro:`PyDoc_STR` in specifying docstrings to support building Python " "without docstrings, as specified in :pep:`7`." @@ -457,11 +713,116 @@ msgstr "" "Use :c:macro:`PyDoc_STR` ao especificar docstrings para ter suporte à " "compilação do Python sem docstrings, conforme especificado em :pep:`7`." -#: ../../c-api/intro.rst:286 +#: ../../c-api/intro.rst:408 +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 "" +"static PyMethodDef pysqlite_row_methods[] = {\n" +" {\"keys\", (PyCFunction)pysqlite_row_keys, METH_NOARGS,\n" +" PyDoc_STR(\"Retorna as chaves da linha.\")},\n" +" {NULL, NULL}\n" +"};" + +#: ../../c-api/intro.rst:416 +msgid "Declares a static character array variable with the given name *name*." +msgstr "" +"Declara uma variável estática de vetor de caracteres com o nome fornecido " +"*name*." + +#: ../../c-api/intro.rst:420 +msgid "" +"PyDoc_VAR(python_doc) = PyDoc_STR(\"A genus of constricting snakes in the " +"Pythonidae family native \"\n" +" \"to the tropics and subtropics of the " +"Eastern Hemisphere.\");" +msgstr "" +"PyDoc_VAR(python_doc) = PyDoc_STR(\"A genus of constricting snakes in the " +"Pythonidae family native \"\n" +" \"to the tropics and subtropics of the " +"Eastern Hemisphere.\");" + +#: ../../c-api/intro.rst:425 +msgid "Compute the length of a statically allocated C array at compile time." +msgstr "" +"Calcula o comprimento de um vetor C alocado estaticamente em tempo de " +"compilação." + +#: ../../c-api/intro.rst:427 +msgid "" +"The *array* argument must be a C array with a size known at compile time. " +"Passing an array with an unknown size, such as a heap-allocated array, will " +"result in a compilation error on some compilers, or otherwise produce " +"incorrect results." +msgstr "" +"O argumento *array* deve ser um vetor C com tamanho conhecido em tempo de " +"compilação. Passar um vetor com tamanho desconhecido, como um vetor alocado " +"na heap, resultará em um erro de compilação em alguns compiladores ou " +"produzirá resultados incorretos." + +#: ../../c-api/intro.rst:432 +msgid "This is roughly equivalent to::" +msgstr "Isso é aproximadamente equivalente a::" + +#: ../../c-api/intro.rst:434 +msgid "sizeof(array) / sizeof((array)[0])" +msgstr "sizeof(array) / sizeof((array)[0])" + +#: ../../c-api/intro.rst:439 +msgid "" +"Macro used to declare a symbol (function or data) as exported. On Windows, " +"this expands to ``__declspec(dllexport)``. On compatible versions of GCC/" +"Clang, it expands to ``__attribute__((visibility(\"default\")))``. This " +"macro is for defining the C API itself; extension modules should not use it." +msgstr "" + +#: ../../c-api/intro.rst:448 +msgid "" +"Macro used to declare a symbol as imported. On Windows, this expands to " +"``__declspec(dllimport)``. This macro is for defining the C API itself; " +"extension modules should not use it." +msgstr "" + +#: ../../c-api/intro.rst:455 +msgid "" +"Macro used by CPython to declare a function as part of the C API. Its " +"expansion depends on the platform and build configuration. This macro is " +"intended for defining CPython's C API itself; extension modules should not " +"use it for their own symbols." +msgstr "" + +#: ../../c-api/intro.rst:463 +msgid "" +"Macro used by CPython to declare a public global variable as part of the C " +"API. Its expansion depends on the platform and build configuration. This " +"macro is intended for defining CPython's C API itself; extension modules " +"should not use it for their own symbols." +msgstr "" + +#: ../../c-api/intro.rst:470 +msgid "" +"This is a :term:`soft deprecated` alias to the C99-standard ``va_copy`` " +"function." +msgstr "" + +#: ../../c-api/intro.rst:473 +msgid "" +"Historically, this would use a compiler-specific method to copy a " +"``va_list``." +msgstr "" + +#: ../../c-api/intro.rst:475 +msgid "This is now an alias to ``va_copy``." +msgstr "" + +#: ../../c-api/intro.rst:482 msgid "Objects, Types and Reference Counts" msgstr "Objetos, tipos e contagens de referências" -#: ../../c-api/intro.rst:290 +#: ../../c-api/intro.rst:486 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 " @@ -469,9 +830,9 @@ msgid "" "are treated the same way by the Python language in most situations (e.g., " "assignments, scope rules, and argument passing), it is only fitting that " "they should be represented by a single C type. Almost all Python objects " -"live on the heap: you never declare an automatic or static variable of type :" -"c:type:`PyObject`, only pointer variables of type :c:expr:`PyObject*` can " -"be declared. The sole exception are the type objects; since these must " +"live on the heap: you never declare an automatic or static variable of " +"type :c:type:`PyObject`, only pointer variables of type :c:expr:`PyObject*` " +"can be declared. The sole exception are the type objects; since these must " "never be deallocated, they are typically static :c:type:`PyTypeObject` " "objects." msgstr "" @@ -485,32 +846,32 @@ msgstr "" "declara uma variável automática ou estática do tipo :c:type:`PyObject`, " "variáveis de apenas ponteiro do tipo :c:expr:`PyObject*` podem ser " "declaradas. A única exceção são os objetos de tipo; uma vez que estes nunca " -"devem ser desalocados, eles são normalmente objetos estáticos :c:type:" -"`PyTypeObject`." +"devem ser desalocados, eles são normalmente objetos " +"estáticos :c:type:`PyTypeObject`." -#: ../../c-api/intro.rst:301 +#: ../../c-api/intro.rst:497 msgid "" -"All Python objects (even Python integers) have a :dfn:`type` and a :dfn:" -"`reference count`. An object's type determines what kind of object it is (e." -"g., an integer, a list, or a user-defined function; there are many more as " -"explained in :ref:`types`). For each of the well-known types there is a " -"macro to check whether an object is of that type; for instance, " +"All Python objects (even Python integers) have a :dfn:`type` and " +"a :dfn:`reference count`. An object's type determines what kind of object " +"it is (e.g., an integer, a list, or a user-defined function; there are many " +"more as explained in :ref:`types`). For each of the well-known types there " +"is a macro to check whether an object is of that type; for instance, " "``PyList_Check(a)`` is true if (and only if) the object pointed to by *a* is " "a Python list." msgstr "" -"Todos os objetos Python (mesmo inteiros Python) têm um :dfn:`tipo` e uma :" -"dfn:`contagem de referências`. O tipo de um objeto determina que tipo de " -"objeto ele é (por exemplo, um número inteiro, uma lista ou uma função " -"definida pelo usuário; existem muitos mais, conforme explicado em :ref:" -"`types`). Para cada um dos tipos conhecidos, há uma macro para verificar se " -"um objeto é desse tipo; por exemplo, ``PyList_Check(a)`` é verdadeiro se (e " -"somente se) o objeto apontado por *a* for uma lista Python." +"Todos os objetos Python (mesmo inteiros Python) têm um :dfn:`tipo` e " +"uma :dfn:`contagem de referências`. O tipo de um objeto determina que tipo " +"de objeto ele é (por exemplo, um número inteiro, uma lista ou uma função " +"definida pelo usuário; existem muitos mais, conforme explicado " +"em :ref:`types`). Para cada um dos tipos conhecidos, há uma macro para " +"verificar se um objeto é desse tipo; por exemplo, ``PyList_Check(a)`` é " +"verdadeiro se (e somente se) o objeto apontado por *a* for uma lista Python." -#: ../../c-api/intro.rst:312 +#: ../../c-api/intro.rst:508 msgid "Reference Counts" msgstr "Contagens de referências" -#: ../../c-api/intro.rst:314 +#: ../../c-api/intro.rst:510 msgid "" "The reference count is important because today's computers have a finite " "(and often severely limited) memory size; it counts how many different " @@ -524,27 +885,55 @@ msgid "" "objects that reference each other here; for now, the solution is \"don't do " "that.\")" msgstr "" - -#: ../../c-api/intro.rst:331 +"A contagem de referências é importante porque os computadores atuais têm um " +"tamanho de memória finito (e frequentemente severamente limitado); ela conta " +"quantos lugares diferentes existem que possuem uma :term:`referência forte` " +"a um objeto. Tal lugar pode ser outro objeto, ou uma variável C global (ou " +"estática), ou uma variável local em alguma função C. Quando a " +"última :term:`referência forte` a um objeto é liberada (ou seja, sua " +"contagem de referências se torna zero), o objeto é desalocado. Se ele " +"contiver referências a outros objetos, essas referências são liberadas. " +"Esses outros objetos podem ser desalocados por sua vez, se não houver mais " +"referências a eles, e assim por diante. (Há um problema óbvio com objetos " +"que referenciam uns aos outros aqui; por enquanto, a solução é \"não faça " +"isso\".)" + +#: ../../c-api/intro.rst:527 msgid "" "Reference counts are always manipulated explicitly. The normal way is to " "use the macro :c:func:`Py_INCREF` to take a new reference to an object (i.e. " "increment its reference count by one), and :c:func:`Py_DECREF` to release " -"that reference (i.e. decrement the reference count by one). The :c:func:" -"`Py_DECREF` macro is considerably more complex than the incref one, since it " -"must check whether the reference count becomes zero and then cause the " -"object's deallocator to be called. The deallocator is a function pointer " -"contained in the object's type structure. The type-specific deallocator " -"takes care of releasing references for other objects contained in the object " -"if this is a compound object type, such as a list, as well as performing any " -"additional finalization that's needed. There's no chance that the reference " -"count can overflow; at least as many bits are used to hold the reference " -"count as there are distinct memory locations in virtual memory (assuming " -"``sizeof(Py_ssize_t) >= sizeof(void*)``). Thus, the reference count " -"increment is a simple operation." -msgstr "" - -#: ../../c-api/intro.rst:347 +"that reference (i.e. decrement the reference count by one). " +"The :c:func:`Py_DECREF` macro is considerably more complex than the incref " +"one, since it must check whether the reference count becomes zero and then " +"cause the object's deallocator to be called. The deallocator is a function " +"pointer contained in the object's type structure. The type-specific " +"deallocator takes care of releasing references for other objects contained " +"in the object if this is a compound object type, such as a list, as well as " +"performing any additional finalization that's needed. There's no chance " +"that the reference count can overflow; at least as many bits are used to " +"hold the reference count as there are distinct memory locations in virtual " +"memory (assuming ``sizeof(Py_ssize_t) >= sizeof(void*)``). Thus, the " +"reference count increment is a simple operation." +msgstr "" +"Contagens de referências são sempre manipuladas explicitamente. A maneira " +"normal é usar a macro :c:func:`Py_INCREF` para obter uma nova referência a " +"um objeto (ou seja, incrementar sua contagem de referências em um), " +"e :c:func:`Py_DECREF` para liberar essa referência (ou seja, decrementar a " +"contagem de referências em um). A macro :c:func:`Py_DECREF` é " +"consideravelmente mais complexa do que a incref, pois deve verificar se a " +"contagem de referências se torna zero e, em seguida, fazer com que o " +"desalocador do objeto seja chamado. O desalocador é um ponteiro para função " +"contido na estrutura de tipo do objeto. O desalocador específico do tipo " +"cuida da liberação de referências para outros objetos contidos no objeto se " +"este for um tipo de objeto composto, como uma lista, bem como de executar " +"qualquer finalização adicional necessária. Não há chance de a contagem de " +"referências transbordar; pelo menos tantos bits são usados para armazenar a " +"contagem de referência quantos forem os locais de memória distintos na " +"memória virtual (presumindo ``sizeof(Py_ssize_t) >= sizeof(void*)``). " +"Portanto, o incremento da contagem de referências é uma operação simples." + +#: ../../c-api/intro.rst:543 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 " @@ -561,19 +950,42 @@ msgid "" "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:363 +"Não é necessário manter uma :term:`referência forte` (ou seja, incrementar a " +"contagem de referências) para cada variável local que contém um ponteiro " +"para um objeto. Em teoria, a contagem de referências do objeto aumenta em um " +"quando a variável é feita para apontar para ele e diminui em um quando a " +"variável sai do escopo. No entanto, esses dois se cancelam, portanto, no " +"final, a contagem de referências não mudou. A única razão real para usar a " +"contagem de referências é evitar que o objeto seja desalocado enquanto nossa " +"variável estiver apontando para ele. Se sabemos que existe pelo menos uma " +"outra referência ao objeto que vive pelo menos tanto quanto nossa variável, " +"não há necessidade de tomar uma nova :term:`referência forte` (ou seja, " +"incrementar a contagem de referências) temporariamente. Uma situação " +"importante em que isso ocorre é em objetos que são passados como argumentos " +"para funções C em um módulo de extensão que são chamados de Python; o " +"mecanismo de chamada garante manter uma referência a todos os argumentos " +"durante a chamada." + +#: ../../c-api/intro.rst:559 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." +"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 "" +"No entanto, uma armadilha comum é extrair um objeto de uma lista e mantê-lo " +"por um tempo, sem tomar uma nova referência. Alguma outra operação poderia " +"remover o objeto da lista, liberando essa referência e possivelmente " +"desalocando-o. O perigo real é que operações aparentemente inocentes podem " +"invocar código Python arbitrário que poderia fazer isso; existe um caminho " +"de código que permite que o controle flua de volta para o usuário a partir " +"de um :c:func:`Py_DECREF`, então quase qualquer operação é potencialmente " +"perigosa." -#: ../../c-api/intro.rst:371 +#: ../../c-api/intro.rst:567 msgid "" "A safe approach is to always use the generic operations (functions whose " "name begins with ``PyObject_``, ``PyNumber_``, ``PySequence_`` or " @@ -582,12 +994,18 @@ msgid "" "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 "" +"Uma abordagem segura é sempre usar as operações genéricas (funções cujo nome " +"começa com ``PyObject_``, ``PyNumber_``, ``PySequence_`` ou ``PyMapping_``). " +"Essas operações sempre criam uma nova :term:`referência forte` (ou seja, " +"incrementam a contagem de referências) do objeto que retornam. Isso deixa o " +"chamador com a responsabilidade de chamar :c:func:`Py_DECREF` quando " +"terminar com o resultado; isso logo se torna uma segunda natureza." -#: ../../c-api/intro.rst:382 +#: ../../c-api/intro.rst:578 msgid "Reference Count Details" msgstr "Detalhes da contagem de referências" -#: ../../c-api/intro.rst:384 +#: ../../c-api/intro.rst:580 msgid "" "The reference count behavior of functions in the Python/C API is best " "explained in terms of *ownership of references*. Ownership pertains to " @@ -595,50 +1013,81 @@ msgid "" "shared). \"Owning a reference\" means being responsible for calling " "Py_DECREF on it when the reference is no longer needed. Ownership can also " "be transferred, meaning that the code that receives ownership of the " -"reference then becomes responsible for eventually releasing it by calling :c:" -"func:`Py_DECREF` or :c:func:`Py_XDECREF` when it's no longer needed---or " -"passing on this responsibility (usually to its caller). When a function " -"passes ownership of a reference on to its caller, the caller is said to " -"receive a *new* reference. When no ownership is transferred, the caller is " -"said to *borrow* the reference. Nothing needs to be done for a :term:" -"`borrowed reference`." -msgstr "" - -#: ../../c-api/intro.rst:397 +"reference then becomes responsible for eventually releasing it by " +"calling :c:func:`Py_DECREF` or :c:func:`Py_XDECREF` when it's no longer " +"needed---or passing on this responsibility (usually to its caller). When a " +"function passes ownership of a reference on to its caller, the caller is " +"said to receive a *new* reference. When no ownership is transferred, the " +"caller is said to *borrow* the reference. Nothing needs to be done for " +"a :term:`borrowed reference`." +msgstr "" +"O comportamento da contagem de referências de funções na API C/Python é " +"melhor explicado em termos de *propriedade de referências*. A propriedade " +"pertence às referências, nunca aos objetos (os objetos não são possuídos: " +"eles são sempre compartilhados). \"Possuir uma referência\" significa ser " +"responsável por chamar Py_DECREF nela quando a referência não for mais " +"necessária. A propriedade também pode ser transferida, o que significa que o " +"código que recebe a propriedade da referência torna-se responsável por " +"eventualmente efetuar um liberando ela chamando :c:func:`Py_DECREF` " +"ou :c:func:`Py_XDECREF` quando não é mais necessário -- ou passando essa " +"responsabilidade (geralmente para o responsável pela chamada). Quando uma " +"função passa a propriedade de uma referência para seu chamador, diz-se que o " +"chamador recebe uma *nova* referência. Quando nenhuma propriedade é " +"transferida, diz-se que o chamador *toma emprestado* a referência. Nada " +"precisa ser feito para uma :term:`referência emprestada`." + +#: ../../c-api/intro.rst:593 msgid "" "Conversely, when a calling function passes in a reference to an object, " "there are two possibilities: the function *steals* a reference to the " -"object, or it does not. *Stealing a reference* means that when you pass a " -"reference to a function, that function assumes that it now owns that " -"reference, and you are not responsible for it any longer." -msgstr "" -"Por outro lado, quando uma função de chamada passa uma referência a um " -"objeto, há duas possibilidades: a função *rouba* uma referência ao objeto, " -"ou não. *Roubar uma referência* significa que quando você passa uma " -"referência para uma função, essa função presume que agora ela possui essa " -"referência e você não é mais responsável por ela." - -#: ../../c-api/intro.rst:407 -msgid "" -"Few functions steal references; the two notable exceptions are :c:func:" -"`PyList_SetItem` and :c:func:`PyTuple_SetItem`, which steal a reference to " -"the item (but not to the tuple or list into which the item is put!). These " -"functions were designed to steal a reference because of a common idiom for " -"populating a tuple or list with newly created objects; for example, the code " -"to create the tuple ``(1, 2, \"three\")`` could look like this (forgetting " -"about error handling for the moment; a better way to code this is shown " -"below)::" -msgstr "" -"Poucas funções roubam referências; as duas exceções notáveis são :c:func:" -"`PyList_SetItem` e :c:func:`PyTuple_SetItem`, que roubam uma referência para " -"o item (mas não para a tupla ou lista na qual o item é colocado!). Essas " -"funções foram projetadas para roubar uma referência devido a um idioma comum " -"para preencher uma tupla ou lista com objetos recém-criados; por exemplo, o " -"código para criar a tupla ``(1, 2, \"three\")`` pode ser parecido com isto " -"(esquecendo o tratamento de erros por enquanto; uma maneira melhor de " -"codificar isso é mostrada abaixo)::" - -#: ../../c-api/intro.rst:422 +"object, or it does not." +msgstr "" + +#: ../../c-api/intro.rst:597 +msgid "" +"*Stealing a reference* means that when you pass a reference to a function, " +"that function assumes that it now owns that reference. Since the new owner " +"can use :c:func:`!Py_DECREF` at its discretion, you (the caller) must not " +"use that reference after the call." +msgstr "" + +#: ../../c-api/intro.rst:606 +msgid "" +"Few functions steal references; the two notable exceptions " +"are :c:func:`PyList_SetItem` and :c:func:`PyTuple_SetItem`, which steal a " +"reference to the item (but not to the tuple or list into which the item is " +"put!). These functions were designed to steal a reference because of a " +"common idiom for populating a tuple or list with newly created objects; for " +"example, the code to create the tuple ``(1, 2, \"three\")`` could look like " +"this (forgetting about error handling for the moment; a better way to code " +"this is shown below)::" +msgstr "" +"Poucas funções roubam referências; as duas exceções notáveis " +"são :c:func:`PyList_SetItem` e :c:func:`PyTuple_SetItem`, que roubam uma " +"referência para o item (mas não para a tupla ou lista na qual o item é " +"colocado!). Essas funções foram projetadas para roubar uma referência devido " +"a um idioma comum para preencher uma tupla ou lista com objetos recém-" +"criados; por exemplo, o código para criar a tupla ``(1, 2, \"three\")`` pode " +"ser parecido com isto (esquecendo o tratamento de erros por enquanto; uma " +"maneira melhor de codificar isso é mostrada abaixo)::" + +#: ../../c-api/intro.rst:614 +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 "" +"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(\"três\"));" + +#: ../../c-api/intro.rst:621 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 " @@ -647,46 +1096,59 @@ msgid "" msgstr "" "Aqui, :c:func:`PyLong_FromLong` retorna uma nova referência que é " "imediatamente roubada por :c:func:`PyTuple_SetItem`. Quando você quiser " -"continuar usando um objeto, embora a referência a ele seja roubada, use :c:" -"func:`Py_INCREF` para obter outra referência antes de chamar a função de " -"roubo de referência." +"continuar usando um objeto, embora a referência a ele seja roubada, " +"use :c:func:`Py_INCREF` para obter outra referência antes de chamar a função " +"de roubo de referência." -#: ../../c-api/intro.rst:427 +#: ../../c-api/intro.rst:626 msgid "" "Incidentally, :c:func:`PyTuple_SetItem` is the *only* way to set tuple " "items; :c:func:`PySequence_SetItem` and :c:func:`PyObject_SetItem` refuse to " -"do this since tuples are an immutable data type. You should only use :c:" -"func:`PyTuple_SetItem` for tuples that you are creating yourself." +"do this since tuples are an immutable data type. You should only " +"use :c:func:`PyTuple_SetItem` for tuples that you are creating yourself." msgstr "" "A propósito, :c:func:`PyTuple_SetItem` é a *única* maneira de definir itens " "de tupla; :c:func:`PySequence_SetItem` e :c:func:`PyObject_SetItem` se " "recusam a fazer isso, pois tuplas são um tipo de dados imutável. Você só " "deve usar :c:func:`PyTuple_SetItem` para tuplas que você mesmo está criando." -#: ../../c-api/intro.rst:432 +#: ../../c-api/intro.rst:631 msgid "" -"Equivalent code for populating a list can be written using :c:func:" -"`PyList_New` and :c:func:`PyList_SetItem`." +"Equivalent code for populating a list can be written " +"using :c:func:`PyList_New` and :c:func:`PyList_SetItem`." msgstr "" -"O código equivalente para preencher uma lista pode ser escrita usando :c:" -"func:`PyList_New` e :c:func:`PyList_SetItem`." +"O código equivalente para preencher uma lista pode ser escrita " +"usando :c:func:`PyList_New` e :c:func:`PyList_SetItem`." -#: ../../c-api/intro.rst:435 +#: ../../c-api/intro.rst:634 msgid "" "However, in practice, you will rarely use these ways of creating and " -"populating a tuple or list. There's a generic function, :c:func:" -"`Py_BuildValue`, that can create most common objects from C values, directed " -"by a :dfn:`format string`. For example, the above two blocks of code could " -"be replaced by the following (which also takes care of the error checking)::" +"populating a tuple or list. There's a generic " +"function, :c:func:`Py_BuildValue`, that can create most common objects from " +"C values, directed by a :dfn:`format string`. For example, the above two " +"blocks of code could be replaced by the following (which also takes care of " +"the error checking)::" msgstr "" "No entanto, na prática, você raramente usará essas maneiras de criar e " -"preencher uma tupla ou lista. Existe uma função genérica, :c:func:" -"`Py_BuildValue`, que pode criar objetos mais comuns a partir de valores C, " -"dirigidos por uma :dfn:`string de formato`. Por exemplo, os dois blocos de " -"código acima podem ser substituídos pelos seguintes (que também cuidam da " -"verificação de erros)::" +"preencher uma tupla ou lista. Existe uma função " +"genérica, :c:func:`Py_BuildValue`, que pode criar objetos mais comuns a " +"partir de valores C, dirigidos por uma :dfn:`string de formato`. Por " +"exemplo, os dois blocos de código acima podem ser substituídos pelos " +"seguintes (que também cuidam da verificação de erros)::" + +#: ../../c-api/intro.rst:640 +msgid "" +"PyObject *tuple, *list;\n" +"\n" +"tuple = Py_BuildValue(\"(iis)\", 1, 2, \"three\");\n" +"list = Py_BuildValue(\"[iis]\", 1, 2, \"three\");" +msgstr "" +"PyObject *tuple, *list;\n" +"\n" +"tuple = Py_BuildValue(\"(iis)\", 1, 2, \"três\");\n" +"list = Py_BuildValue(\"[iis]\", 1, 2, \"três\");" -#: ../../c-api/intro.rst:446 +#: ../../c-api/intro.rst:645 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 " @@ -696,8 +1158,59 @@ msgid "" "For example, this function sets all items of a list (actually, any mutable " "sequence) to a given item::" msgstr "" - -#: ../../c-api/intro.rst:476 +"É muito mais comum usar :c:func:`PyObject_SetItem` e amigos com itens cujas " +"referências você está apenas pegando emprestado, como argumentos que foram " +"passados para a função que você está escrevendo. Nesse caso, o comportamento " +"deles em relação às referências é muito mais são, já que você não precisa " +"tomar uma nova referência só para poder doá-la (\"mande-a ser roubada\"). " +"Por exemplo, esta função define todos os itens de uma lista (na verdade, " +"qualquer sequência mutável) para um determinado item::" + +#: ../../c-api/intro.rst:652 +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 "" +"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" +"}" + +#: ../../c-api/intro.rst:675 msgid "" "The situation is slightly different for function return values. While " "passing a reference to most functions does not change your ownership " @@ -719,7 +1232,7 @@ msgstr "" "como :c:func:`PyObject_GetItem` e :c:func:`PySequence_GetItem`, sempre " "retornam uma nova referência (o chamador torna-se o dono da referência)." -#: ../../c-api/intro.rst:485 +#: ../../c-api/intro.rst:684 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 " @@ -733,43 +1246,148 @@ msgstr "" "função depende de qual função você chama apenas --- *a plumagem* (o tipo do " "objeto passado como um argumento para a função) *não entra nela!* Assim, se " "você extrair um item de uma lista usando :c:func:`PyList_GetItem`, você não " -"possui a referência --- mas se obtiver o mesmo item da mesma lista usando :c:" -"func:`PySequence_GetItem` (que leva exatamente os mesmos argumentos), você " -"possui uma referência ao objeto retornado." +"possui a referência --- mas se obtiver o mesmo item da mesma lista " +"usando :c:func:`PySequence_GetItem` (que leva exatamente os mesmos " +"argumentos), você possui uma referência ao objeto retornado." -#: ../../c-api/intro.rst:497 +#: ../../c-api/intro.rst:696 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`, " "and once using :c:func:`PySequence_GetItem`. ::" msgstr "" "Aqui está um exemplo de como você poderia escrever uma função que calcula a " -"soma dos itens em uma lista de inteiros; uma vez usando :c:func:" -"`PyList_GetItem`, e uma vez usando :c:func:`PySequence_GetItem`. ::" - -#: ../../c-api/intro.rst:561 +"soma dos itens em uma lista de inteiros; uma vez " +"usando :c:func:`PyList_GetItem`, e uma vez " +"usando :c:func:`PySequence_GetItem`. ::" + +#: ../../c-api/intro.rst:700 +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 "" +"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; /* Não é uma lista */\n" +" for (i = 0; i < n; i++) {\n" +" item = PyList_GetItem(list, i); /* Não pode falhar */\n" +" if (!PyLong_Check(item)) continue; /* Ignora não-inteiros */\n" +" value = PyLong_AsLong(item);\n" +" if (value == -1 && PyErr_Occurred())\n" +" /* Inteiro muito grande para caber em um C longo, sai */\n" +" return -1;\n" +" total += value;\n" +" }\n" +" return total;\n" +"}" + +#: ../../c-api/intro.rst:726 +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 "" +"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; /* Não tem comprimento */\n" +" for (i = 0; i < n; i++) {\n" +" item = PySequence_GetItem(sequence, i);\n" +" if (item == NULL)\n" +" return -1; /* Não é uma sequência ou outra falha */\n" +" if (PyLong_Check(item)) {\n" +" value = PyLong_AsLong(item);\n" +" Py_DECREF(item);\n" +" if (value == -1 && PyErr_Occurred())\n" +" /* Inteiro muito grande para caber em um C longo, sai */\n" +" return -1;\n" +" total += value;\n" +" }\n" +" else {\n" +" Py_DECREF(item); /* Descartar propriedade de referência */\n" +" }\n" +" }\n" +" return total;\n" +"}" + +#: ../../c-api/intro.rst:760 msgid "Types" msgstr "Tipos" -#: ../../c-api/intro.rst:563 +#: ../../c-api/intro.rst:762 msgid "" "There are few other data types that play a significant role in the Python/C " -"API; most are simple C types such as :c:expr:`int`, :c:expr:`long`, :c:expr:" -"`double` and :c:expr:`char*`. A few structure types are used to describe " -"static tables used to list the functions exported by a module or the data " -"attributes of a new object type, and another is used to describe the value " -"of a complex number. These will be discussed together with the functions " -"that use them." +"API; most are simple C types such " +"as :c:expr:`int`, :c:expr:`long`, :c:expr:`double` and :c:expr:`char*`. A " +"few structure types are used to describe static tables used to list the " +"functions exported by a module or the data attributes of a new object type, " +"and another is used to describe the value of a complex number. These will " +"be discussed together with the functions that use them." msgstr "" "Existem alguns outros tipos de dados que desempenham um papel significativo " -"na API Python/C; a maioria são tipos C simples, como :c:expr:`int`, :c:expr:" -"`long`, :c:expr:`double` e :c:expr:`char*`. Alguns tipos de estrutura são " -"usados para descrever tabelas estáticas usadas para listar as funções " -"exportadas por um módulo ou os atributos de dados de um novo tipo de objeto, " -"e outro é usado para descrever o valor de um número complexo. Eles serão " -"discutidos junto com as funções que os utilizam." +"na API Python/C; a maioria são tipos C simples, " +"como :c:expr:`int`, :c:expr:`long`, :c:expr:`double` e :c:expr:`char*`. " +"Alguns tipos de estrutura são usados para descrever tabelas estáticas usadas " +"para listar as funções exportadas por um módulo ou os atributos de dados de " +"um novo tipo de objeto, e outro é usado para descrever o valor de um número " +"complexo. Eles serão discutidos junto com as funções que os utilizam." -#: ../../c-api/intro.rst:573 +#: ../../c-api/intro.rst:772 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 " @@ -781,11 +1399,11 @@ msgstr "" "assinado). Veja :pep:`353` para mais detalhes. ``PY_SSIZE_T_MAX`` é o maior " "valor positivo do tipo :c:type:`Py_ssize_t`." -#: ../../c-api/intro.rst:582 +#: ../../c-api/intro.rst:781 msgid "Exceptions" msgstr "Exceções" -#: ../../c-api/intro.rst:584 +#: ../../c-api/intro.rst:783 msgid "" "The Python programmer only needs to deal with exceptions if specific error " "handling is required; unhandled exceptions are automatically propagated to " @@ -799,7 +1417,7 @@ msgstr "" "até chegarem ao interpretador de nível superior, onde são relatadas ao " "usuário acompanhadas por um traceback (situação da pilha de execução)." -#: ../../c-api/intro.rst:592 +#: ../../c-api/intro.rst:791 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 " @@ -826,17 +1444,17 @@ msgstr "" "para erros com :c:func:`PyErr_Occurred`. Essas exceções são sempre " "documentadas explicitamente." -#: ../../c-api/intro.rst:607 +#: ../../c-api/intro.rst:806 msgid "" "Exception state is maintained in per-thread storage (this is equivalent to " "using global storage in an unthreaded application). A thread can be in one " -"of two states: an exception has occurred, or not. The function :c:func:" -"`PyErr_Occurred` can be used to check for this: it returns a borrowed " -"reference to the exception type object when an exception has occurred, and " -"``NULL`` otherwise. There are a number of functions to set the exception " -"state: :c:func:`PyErr_SetString` is the most common (though not the most " -"general) function to set the exception state, and :c:func:`PyErr_Clear` " -"clears the exception state." +"of two states: an exception has occurred, or not. The " +"function :c:func:`PyErr_Occurred` can be used to check for this: it returns " +"a borrowed reference to the exception type object when an exception has " +"occurred, and ``NULL`` otherwise. There are a number of functions to set " +"the exception state: :c:func:`PyErr_SetString` is the most common (though " +"not the most general) function to set the exception state, " +"and :c:func:`PyErr_Clear` clears the exception state." msgstr "" "O estado de exceção é mantido no armazenamento por thread (isso é " "equivalente a usar o armazenamento global em uma aplicação sem thread). Uma " @@ -845,57 +1463,57 @@ msgstr "" "retorna uma referência emprestada ao objeto do tipo de exceção quando uma " "exceção ocorreu, e ``NULL`` caso contrário. Existem várias funções para " "definir o estado de exceção: :c:func:`PyErr_SetString` é a função mais comum " -"(embora não a mais geral) para definir o estado de exceção, e :c:func:" -"`PyErr_Clear` limpa o estado da exceção." +"(embora não a mais geral) para definir o estado de exceção, " +"e :c:func:`PyErr_Clear` limpa o estado da exceção." -#: ../../c-api/intro.rst:617 +#: ../../c-api/intro.rst:816 msgid "" "The full exception state consists of three objects (all of which can be " "``NULL``): the exception type, the corresponding exception value, and the " -"traceback. These have the same meanings as the Python result of ``sys." -"exc_info()``; however, they are not the same: the Python objects represent " -"the last exception being handled by a Python :keyword:`try` ... :keyword:" -"`except` statement, while the C level exception state only exists while an " -"exception is being passed on between C functions until it reaches the Python " -"bytecode interpreter's main loop, which takes care of transferring it to " -"``sys.exc_info()`` and friends." +"traceback. These have the same meanings as the Python result of " +"``sys.exc_info()``; however, they are not the same: the Python objects " +"represent the last exception being handled by a " +"Python :keyword:`try` ... :keyword:`except` statement, while the C level " +"exception state only exists while an exception is being passed on between C " +"functions until it reaches the Python bytecode interpreter's main loop, " +"which takes care of transferring it to ``sys.exc_info()`` and friends." msgstr "" "O estado de exceção completo consiste em três objetos (todos os quais podem " "ser ``NULL``): o tipo de exceção, o valor de exceção correspondente e o " -"traceback. Eles têm os mesmos significados que o resultado do Python de " +"traceback. Eles têm os mesmos significados que o resultado no Python de " "``sys.exc_info()``; no entanto, eles não são os mesmos: os objetos Python " -"representam a última exceção sendo tratada por uma instrução Python :keyword:" -"`try` ... :keyword:`except`, enquanto o estado de exceção de nível C só " -"existe enquanto uma exceção está sendo transmitido entre funções C até " -"atingir o loop principal do interpretador de bytecode Python, que se " -"encarrega de transferi-lo para ``sys.exc_info()`` e amigos." +"representam a última exceção sendo tratada por uma instrução " +"Python :keyword:`try` ... :keyword:`except`, enquanto o estado de exceção de " +"nível C só existe enquanto uma exceção está sendo transmitido entre funções " +"C até atingir o laço de repetição principal do interpretador de bytecode " +"Python, que se encarrega de transferi-lo para ``sys.exc_info()`` e amigos." -#: ../../c-api/intro.rst:629 +#: ../../c-api/intro.rst:828 msgid "" "Note that starting with Python 1.5, the preferred, thread-safe way to access " -"the exception state from Python code is to call the function :func:`sys." -"exc_info`, which returns the per-thread exception state for Python code. " -"Also, the semantics of both ways to access the exception state have changed " -"so that a function which catches an exception will save and restore its " -"thread's exception state so as to preserve the exception state of its " -"caller. This prevents common bugs in exception handling code caused by an " -"innocent-looking function overwriting the exception being handled; it also " -"reduces the often unwanted lifetime extension for objects that are " -"referenced by the stack frames in the traceback." +"the exception state from Python code is to call the " +"function :func:`sys.exc_info`, which returns the per-thread exception state " +"for Python code. Also, the semantics of both ways to access the exception " +"state have changed so that a function which catches an exception will save " +"and restore its thread's exception state so as to preserve the exception " +"state of its caller. This prevents common bugs in exception handling code " +"caused by an innocent-looking function overwriting the exception being " +"handled; it also reduces the often unwanted lifetime extension for objects " +"that are referenced by the stack frames in the traceback." msgstr "" "Observe que a partir do Python 1.5, a maneira preferida e segura para thread " -"para acessar o estado de exceção do código Python é chamar a função :func:" -"`sys.exc_info`, que retorna o estado de exceção por thread para o código " -"Python. Além disso, a semântica de ambas as maneiras de acessar o estado de " -"exceção mudou, de modo que uma função que captura uma exceção salvará e " -"restaurará o estado de exceção de seu segmento de modo a preservar o estado " -"de exceção de seu chamador. Isso evita bugs comuns no código de tratamento " -"de exceções causados por uma função aparentemente inocente sobrescrevendo a " -"exceção sendo tratada; também reduz a extensão da vida útil frequentemente " -"indesejada para objetos que são referenciados pelos quadros de pilha no " -"traceback." - -#: ../../c-api/intro.rst:640 +"para acessar o estado de exceção do código Python é chamar a " +"função :func:`sys.exc_info`, que retorna o estado de exceção por thread para " +"o código Python. Além disso, a semântica de ambas as maneiras de acessar o " +"estado de exceção mudou, de modo que uma função que captura uma exceção " +"salvará e restaurará o estado de exceção de seu segmento de modo a preservar " +"o estado de exceção de seu chamador. Isso evita bugs comuns no código de " +"tratamento de exceções causados por uma função aparentemente inocente " +"sobrescrevendo a exceção sendo tratada; também reduz a extensão da vida útil " +"frequentemente indesejada para objetos que são referenciados pelos quadros " +"de pilha no traceback." + +#: ../../c-api/intro.rst:839 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 " @@ -913,7 +1531,7 @@ msgstr "" "acabou de ser gerada e perderia informações importantes sobre a causa exata " "do erro." -#: ../../c-api/intro.rst:649 +#: ../../c-api/intro.rst:848 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 " @@ -921,22 +1539,131 @@ msgid "" "following example function shows some error cleanup. First, to remind you " "why you like Python, we show the equivalent Python code::" msgstr "" - -#: ../../c-api/intro.rst:664 +"Um exemplo simples de detecção de exceções e transmiti-las é mostrado no " +"exemplo :c:func:`!sum_sequence` acima. Acontece que este exemplo não precisa " +"limpar nenhuma referência de propriedade quando detecta um erro. A função de " +"exemplo a seguir mostra alguma limpeza de erro. Primeiro, para lembrar por " +"que você gosta de Python, mostramos o código Python equivalente::" + +#: ../../c-api/intro.rst:854 +msgid "" +"def incr_item(dict, key):\n" +" try:\n" +" item = dict[key]\n" +" except KeyError:\n" +" item = 0\n" +" dict[key] = item + 1" +msgstr "" +"def incr_item(dict, key):\n" +" try:\n" +" item = dict[key]\n" +" except KeyError:\n" +" item = 0\n" +" dict[key] = item + 1" + +#: ../../c-api/intro.rst:863 msgid "Here is the corresponding C code, in all its glory::" msgstr "Aqui está o código C correspondente, em toda sua glória::" -#: ../../c-api/intro.rst:716 +#: ../../c-api/intro.rst:865 +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 "" +"int\n" +"incr_item(PyObject *dict, PyObject *key)\n" +"{\n" +" /* Objetos todos inicializados para NULL para Py_XDECREF */\n" +" PyObject *item = NULL, *const_one = NULL, *incremented_item = NULL;\n" +" int rv = -1; /* Retorna valor inicializado para -1 (falha) */\n" +"\n" +" item = PyObject_GetItem(dict, key);\n" +" if (item == NULL) {\n" +" /* Trata de KeyError apenas: */\n" +" if (!PyErr_ExceptionMatches(PyExc_KeyError))\n" +" goto error;\n" +"\n" +" /* Limpa o erro e usa 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" +" /* Continua com o código de limpeza */\n" +"\n" +" error:\n" +" /* Código de limpeza, compartilhado pelo caminho sucesso e falha */\n" +"\n" +" /* Usa Py_XDECREF() para ignorar referências NULL */\n" +" Py_XDECREF(item);\n" +" Py_XDECREF(const_one);\n" +" Py_XDECREF(incremented_item);\n" +"\n" +" return rv; /* -1 para erro, 0 para sucesso */\n" +"}" + +#: ../../c-api/intro.rst:915 msgid "" "This example represents an endorsed use of the ``goto`` statement in C! It " -"illustrates the use of :c:func:`PyErr_ExceptionMatches` and :c:func:" -"`PyErr_Clear` to handle specific exceptions, and the use of :c:func:" -"`Py_XDECREF` to dispose of owned references that may be ``NULL`` (note the " -"``'X'`` in the name; :c:func:`Py_DECREF` would crash when confronted with a " -"``NULL`` reference). It is important that the variables used to hold owned " -"references are initialized to ``NULL`` for this to work; likewise, the " -"proposed return value is initialized to ``-1`` (failure) and only set to " -"success after the final call made is successful." +"illustrates the use of :c:func:`PyErr_ExceptionMatches` " +"and :c:func:`PyErr_Clear` to handle specific exceptions, and the use " +"of :c:func:`Py_XDECREF` to dispose of owned references that may be ``NULL`` " +"(note the ``'X'`` in the name; :c:func:`Py_DECREF` would crash when " +"confronted with a ``NULL`` reference). It is important that the variables " +"used to hold owned references are initialized to ``NULL`` for this to work; " +"likewise, the proposed return value is initialized to ``-1`` (failure) and " +"only set to success after the final call made is successful." msgstr "" "Este exemplo representa um uso endossado da instrução ``goto`` em C! Ele " "ilustra o uso de :c:func:`PyErr_ExceptionMatches` e :c:func:`PyErr_Clear` " @@ -949,11 +1676,11 @@ msgstr "" "``-1`` (falha) e apenas definido para sucesso após a chamada final feita ser " "bem sucedida." -#: ../../c-api/intro.rst:730 +#: ../../c-api/intro.rst:929 msgid "Embedding Python" msgstr "Incorporando Python" -#: ../../c-api/intro.rst:732 +#: ../../c-api/intro.rst:931 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 " @@ -966,7 +1693,7 @@ msgstr "" "maior parte da funcionalidade do interpretador só pode ser usada após a " "inicialização do interpretador." -#: ../../c-api/intro.rst:745 +#: ../../c-api/intro.rst:944 msgid "" "The basic initialization function is :c:func:`Py_Initialize`. This " "initializes the table of loaded modules, and creates the fundamental " @@ -974,24 +1701,25 @@ msgid "" "initializes the module search path (``sys.path``)." msgstr "" "A função de inicialização básica é :c:func:`Py_Initialize`. Isso inicializa " -"a tabela de módulos carregados e cria os módulos fundamentais :mod:" -"`builtins`, :mod:`__main__` e :mod:`sys`. Ela também inicializa o caminho de " -"pesquisa de módulos (``sys.path``)." +"a tabela de módulos carregados e cria os módulos " +"fundamentais :mod:`builtins`, :mod:`__main__` e :mod:`sys`. Ela também " +"inicializa o caminho de pesquisa de módulos (``sys.path``)." -#: ../../c-api/intro.rst:750 +#: ../../c-api/intro.rst:949 msgid "" -":c:func:`Py_Initialize` does not set the \"script argument list\" (``sys." -"argv``). If this variable is needed by Python code that will be executed " -"later, setting :c:member:`PyConfig.argv` and :c:member:`PyConfig.parse_argv` " -"must be set: see :ref:`Python Initialization Configuration `." +":c:func:`Py_Initialize` does not set the \"script argument list\" " +"(``sys.argv``). If this variable is needed by Python code that will be " +"executed later, setting :c:member:`PyConfig.argv` " +"and :c:member:`PyConfig.parse_argv` must be set: see :ref:`Python " +"Initialization Configuration `." msgstr "" -":c:func:`Py_Initialize` não define a \"lista de argumentos de " -"script\" (``sys.argv``). Se esta variável for necessária para o código " -"Python que será executado posteriormente, :c:member:`PyConfig.argv` e :c:" -"member:`PyConfig.parse_argv` devem estar definidas; veja :ref:`Configuração " -"de inicialização do Python `." +":c:func:`Py_Initialize` não define a \"lista de argumentos de script\" " +"(``sys.argv``). Se esta variável for necessária para o código Python que " +"será executado posteriormente, :c:member:`PyConfig.argv` " +"e :c:member:`PyConfig.parse_argv` devem estar definidas; " +"veja :ref:`Configuração de inicialização do Python `." -#: ../../c-api/intro.rst:755 +#: ../../c-api/intro.rst:954 msgid "" "On most systems (in particular, on Unix and Windows, although the details " "are slightly different), :c:func:`Py_Initialize` calculates the module " @@ -1007,18 +1735,18 @@ msgstr "" "caminho de pesquisa de módulos com base em sua melhor estimativa para a " "localização do executável do interpretador Python padrão, presumindo que a " "biblioteca Python é encontrada em um local fixo em relação ao executável do " -"interpretador Python. Em particular, ele procura por um diretório chamado :" -"file:`lib/python{X.Y}` relativo ao diretório pai onde o executável chamado :" -"file:`python` é encontrado no caminho de pesquisa de comandos do shell (a " -"variável de ambiente :envvar:`PATH`)." +"interpretador Python. Em particular, ele procura por um diretório " +"chamado :file:`lib/python{X.Y}` relativo ao diretório pai onde o executável " +"chamado :file:`python` é encontrado no caminho de pesquisa de comandos do " +"shell (a variável de ambiente :envvar:`PATH`)." -#: ../../c-api/intro.rst:764 +#: ../../c-api/intro.rst:963 msgid "" "For instance, if the Python executable is found in :file:`/usr/local/bin/" "python`, it will assume that the libraries are in :file:`/usr/local/lib/" "python{X.Y}`. (In fact, this particular path is also the \"fallback\" " -"location, used when no executable file named :file:`python` is found along :" -"envvar:`PATH`.) The user can override this behavior by setting the " +"location, used when no executable file named :file:`python` is found " +"along :envvar:`PATH`.) The user can override this behavior by setting the " "environment variable :envvar:`PYTHONHOME`, or insert additional directories " "in front of the standard path by setting :envvar:`PYTHONPATH`." msgstr "" @@ -1030,46 +1758,57 @@ msgstr "" "definindo a variável de ambiente :envvar:`PYTHONHOME`, ou insira diretórios " "adicionais na frente do caminho padrão definindo :envvar:`PYTHONPATH`." -#: ../../c-api/intro.rst:778 -msgid "" -"The embedding application can steer the search by setting :c:member:" -"`PyConfig.program_name` *before* calling :c:func:`Py_InitializeFromConfig`. " -"Note that :envvar:`PYTHONHOME` still overrides this and :envvar:`PYTHONPATH` " -"is still inserted in front of the standard path. An application that " -"requires total control has to provide its own implementation of :c:func:" -"`Py_GetPath`, :c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, and :c:" -"func:`Py_GetProgramFullPath` (all defined in :file:`Modules/getpath.c`)." -msgstr "" - -#: ../../c-api/intro.rst:789 +#: ../../c-api/intro.rst:977 +msgid "" +"The embedding application can steer the search by " +"setting :c:member:`PyConfig.program_name` *before* " +"calling :c:func:`Py_InitializeFromConfig`. Note that :envvar:`PYTHONHOME` " +"still overrides this and :envvar:`PYTHONPATH` is still inserted in front of " +"the standard path. An application that requires total control has to " +"provide its own implementation " +"of :c:func:`Py_GetPath`, :c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, " +"and :c:func:`Py_GetProgramFullPath` (all defined in :file:`Modules/" +"getpath.c`)." +msgstr "" +"A aplicação de incorporação pode orientar a pesquisa " +"definindo :c:member:`PyConfig.program_name` *antes* de " +"chamar :c:func:`Py_InitializeFromConfig`. Observe que :envvar:`PYTHONHOME` " +"ainda substitui isso e :envvar:`PYTHONPATH` ainda é inserido na frente do " +"caminho padrão. Uma aplicação que requer controle total deve fornecer sua " +"própria implementação " +"de :c:func:`Py_GetPath`, :c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix` " +"e :c:func:`Py_GetProgramFullPath` (todas definidas em :file:`Modules/" +"getpath.c`)." + +#: ../../c-api/intro.rst:988 msgid "" "Sometimes, it is desirable to \"uninitialize\" Python. For instance, the " -"application may want to start over (make another call to :c:func:" -"`Py_Initialize`) or the application is simply done with its use of Python " -"and wants to free memory allocated by Python. This can be accomplished by " -"calling :c:func:`Py_FinalizeEx`. The function :c:func:`Py_IsInitialized` " -"returns true if Python is currently in the initialized state. More " -"information about these functions is given in a later chapter. Notice that :" -"c:func:`Py_FinalizeEx` does *not* free all memory allocated by the Python " -"interpreter, e.g. memory allocated by extension modules currently cannot be " -"released." +"application may want to start over (make another call " +"to :c:func:`Py_Initialize`) or the application is simply done with its use " +"of Python and wants to free memory allocated by Python. This can be " +"accomplished by calling :c:func:`Py_FinalizeEx`. The " +"function :c:func:`Py_IsInitialized` returns true if Python is currently in " +"the initialized state. More information about these functions is given in a " +"later chapter. Notice that :c:func:`Py_FinalizeEx` does *not* free all " +"memory allocated by the Python interpreter, e.g. memory allocated by " +"extension modules currently cannot be released." msgstr "" "Às vezes, é desejável \"desinicializar\" o Python. Por exemplo, a aplicação " -"pode querer iniciar novamente (fazer outra chamada para :c:func:" -"`Py_Initialize`) ou a aplicação simplesmente termina com o uso de Python e " -"deseja liberar memória alocada pelo Python. Isso pode ser feito chamando :c:" -"func:`Py_FinalizeEx`. A função :c:func:`Py_IsInitialized` retorna verdadeiro " -"se o Python está atualmente no estado inicializado. Mais informações sobre " -"essas funções são fornecidas em um capítulo posterior. Observe que :c:func:" -"`Py_FinalizeEx` *não* libera toda a memória alocada pelo interpretador " -"Python, por exemplo, a memória alocada por módulos de extensão atualmente " -"não pode ser liberada." - -#: ../../c-api/intro.rst:803 +"pode querer iniciar novamente (fazer outra chamada " +"para :c:func:`Py_Initialize`) ou a aplicação simplesmente termina com o uso " +"de Python e deseja liberar memória alocada pelo Python. Isso pode ser feito " +"chamando :c:func:`Py_FinalizeEx`. A função :c:func:`Py_IsInitialized` " +"retorna verdadeiro se o Python está atualmente no estado inicializado. Mais " +"informações sobre essas funções são fornecidas em um capítulo posterior. " +"Observe que :c:func:`Py_FinalizeEx` *não* libera toda a memória alocada pelo " +"interpretador Python, por exemplo, a memória alocada por módulos de extensão " +"atualmente não pode ser liberada." + +#: ../../c-api/intro.rst:1002 msgid "Debugging Builds" msgstr "Compilações de depuração" -#: ../../c-api/intro.rst:805 +#: ../../c-api/intro.rst:1004 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 " @@ -1080,13 +1819,13 @@ msgstr "" "adicionar uma grande quantidade de sobrecarga ao tempo de execução, " "portanto, não são habilitadas por padrão." -#: ../../c-api/intro.rst:809 +#: ../../c-api/intro.rst:1008 msgid "" -"A full list of the various types of debugging builds is in the file :file:" -"`Misc/SpecialBuilds.txt` in the Python source distribution. Builds are " -"available that support tracing of reference counts, debugging the memory " -"allocator, or low-level profiling of the main interpreter loop. Only the " -"most frequently used builds will be described in the remainder of this " +"A full list of the various types of debugging builds is in the " +"file :file:`Misc/SpecialBuilds.txt` in the Python source distribution. " +"Builds are available that support tracing of reference counts, debugging the " +"memory allocator, or low-level profiling of the main interpreter loop. Only " +"the most frequently used builds will be described in the remainder of this " "section." msgstr "" "Uma lista completa dos vários tipos de compilações de depuração está no " @@ -1097,18 +1836,25 @@ msgstr "" "compilações usadas com mais frequência serão descritas no restante desta " "seção." -#: ../../c-api/intro.rst:817 +#: ../../c-api/intro.rst:1016 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:825 +"build>`. :c:macro:`!Py_DEBUG` is enabled in the Unix build by " +"adding :option:`--with-pydebug` to the :file:`./configure` command. It is " +"also implied by the presence of the not-Python-specific :c:macro:`!_DEBUG` " +"macro. When :c:macro:`!Py_DEBUG` is enabled in the Unix build, compiler " +"optimization is disabled." +msgstr "" +"Compilar o interpretador com a macro :c:macro:`!Py_DEBUG` definida produz o " +"que geralmente se entende por :ref:`uma construção de depuração do Python " +"`. :c:macro:`!Py_DEBUG` é habilitada na construção Unix " +"adicionando :option:`--with-pydebug` ao comando :file:`./configure`. Também " +"está implícito na presença da macro não específica do Python :c:macro:`!" +"_DEBUG`. Quando :c:macro:`!Py_DEBUG` está habilitado na construção do Unix, " +"a otimização do compilador é desabilitada." + +#: ../../c-api/intro.rst:1024 msgid "" "In addition to the reference count debugging described below, extra checks " "are performed, see :ref:`Python Debug Build `." @@ -1117,24 +1863,17 @@ msgstr "" "extras são realizadas, consulte :ref:`Compilação de Depuração do Python " "`." -#: ../../c-api/intro.rst:828 +#: ../../c-api/intro.rst:1027 msgid "" -"Defining :c:macro:`Py_TRACE_REFS` enables reference tracing (see the :option:" -"`configure --with-trace-refs option <--with-trace-refs>`). When defined, a " -"circular doubly linked list of active objects is maintained by adding two " -"extra fields to every :c:type:`PyObject`. Total allocations are tracked as " -"well. Upon exit, all existing references are printed. (In interactive mode " -"this happens after every statement run by the interpreter.)" +"Defining ``Py_TRACE_REFS`` enables reference tracing (see " +"the :option:`configure --with-trace-refs option <--with-trace-refs>`). When " +"defined, a circular doubly linked list of active objects is maintained by " +"adding two extra fields to every :c:type:`PyObject`. Total allocations are " +"tracked as well. Upon exit, all existing references are printed. (In " +"interactive mode this happens after every statement run by the interpreter.)" msgstr "" -"Definir :c:macro:`Py_TRACE_REFS` habilita o rastreamento de referência (veja " -"a opção :option:`opção --with-trace-refs de configure <--with-trace-refs>`). " -"Quando definida, uma lista circular duplamente vinculada de objetos ativos é " -"mantida adicionando dois campos extras a cada :c:type:`PyObject`. As " -"alocações totais também são rastreadas. Ao sair, todas as referências " -"existentes são impressas. (No modo interativo, isso acontece após cada " -"instrução executada pelo interpretador.)" -#: ../../c-api/intro.rst:835 +#: ../../c-api/intro.rst:1034 msgid "" "Please refer to :file:`Misc/SpecialBuilds.txt` in the Python source " "distribution for more detailed information." @@ -1142,126 +1881,220 @@ msgstr "" "Consulte :file:`Misc/SpecialBuilds.txt` na distribuição do código-fonte " "Python para informações mais detalhadas." -#: ../../c-api/intro.rst:288 +#: ../../c-api/intro.rst:1041 +msgid "Recommended third party tools" +msgstr "Ferramentas de terceiros recomendadas" + +#: ../../c-api/intro.rst:1043 +msgid "" +"The following third party tools offer both simpler and more sophisticated " +"approaches to creating C, C++ and Rust extensions for Python:" +msgstr "" +"As seguintes ferramentas de terceiros oferecem abordagens mais simples e " +"mais sofisticadas para criar extensões C, C++ e Rust para Python:" + +#: ../../c-api/intro.rst:1046 +msgid "`Cython `_" +msgstr "`Cython `_" + +#: ../../c-api/intro.rst:1047 +msgid "`cffi `_" +msgstr "`cffi `_" + +#: ../../c-api/intro.rst:1048 +msgid "`HPy `_" +msgstr "`HPy `_" + +#: ../../c-api/intro.rst:1049 +msgid "`nanobind `_ (C++)" +msgstr "`nanobind `_ (C++)" + +#: ../../c-api/intro.rst:1050 +msgid "`Numba `_" +msgstr "`Numba `_" + +#: ../../c-api/intro.rst:1051 +msgid "`pybind11 `_ (C++)" +msgstr "`pybind11 `_ (C++)" + +#: ../../c-api/intro.rst:1052 +msgid "`PyO3 `_ (Rust)" +msgstr "`PyO3 `_ (Rust)" + +#: ../../c-api/intro.rst:1053 +msgid "`SWIG `_" +msgstr "`SWIG `_" + +#: ../../c-api/intro.rst:1055 +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." +msgstr "" +"O uso de ferramentas como essas pode ajudar a evitar a criação de código " +"estritamente vinculado a uma versão específica do CPython, evitar erros de " +"contagem de referências e focar mais no seu próprio código do que em usar a " +"API do CPython. Em geral, novas versões do Python podem ser suportadas " +"atualizando a ferramenta, e seu código frequentemente usará APIs mais novas " +"e eficientes automaticamente. Algumas ferramentas também oferecem suporte à " +"compilação para outras implementações do Python a partir de um único " +"conjunto de fontes." + +#: ../../c-api/intro.rst:1062 +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 "" +"Esses projetos não são suportados pelas mesmas pessoas que mantêm o Python, " +"e quaisquer problemas precisam ser relatados diretamente aos projetos. " +"Lembre-se de verificar se o projeto ainda é mantido e tem suporte, pois a " +"lista acima pode ficar desatualizada." + +#: ../../c-api/intro.rst:1069 +msgid "" +"`Python Packaging User Guide: Binary Extensions `_" +msgstr "" +"`Guia do Usuário de Empacotamento do Python: Extensões Binárias `_" + +#: ../../c-api/intro.rst:1070 +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 "" +"O Guia do Usuário de Empacotamento do Python não abrange apenas várias " +"ferramentas disponíveis que simplificam a criação de extensões binárias, mas " +"também discute os vários motivos pelos quais a criação de um módulo de " +"extensão pode ser desejável em primeiro lugar." + +#: ../../c-api/intro.rst:484 msgid "object" msgstr "objeto" -#: ../../c-api/intro.rst:288 +#: ../../c-api/intro.rst:484 msgid "type" msgstr "tipo" -#: ../../c-api/intro.rst:327 +#: ../../c-api/intro.rst:523 msgid "Py_INCREF (C function)" -msgstr "" +msgstr "Py_INCREF (função C)" -#: ../../c-api/intro.rst:327 +#: ../../c-api/intro.rst:523 msgid "Py_DECREF (C function)" -msgstr "" +msgstr "Py_DECREF (função C)" -#: ../../c-api/intro.rst:403 +#: ../../c-api/intro.rst:602 msgid "PyList_SetItem (C function)" -msgstr "" +msgstr "PyList_SetItem (função C)" -#: ../../c-api/intro.rst:403 +#: ../../c-api/intro.rst:602 msgid "PyTuple_SetItem (C function)" -msgstr "" +msgstr "PyTuple_SetItem (função C)" -#: ../../c-api/intro.rst:474 +#: ../../c-api/intro.rst:673 msgid "set_all()" -msgstr "" +msgstr "set_all()" -#: ../../c-api/intro.rst:493 +#: ../../c-api/intro.rst:692 msgid "PyList_GetItem (C function)" -msgstr "" +msgstr "PyList_GetItem (função C)" -#: ../../c-api/intro.rst:493 +#: ../../c-api/intro.rst:692 msgid "PySequence_GetItem (C function)" -msgstr "" +msgstr "PySequence_GetItem (função C)" -#: ../../c-api/intro.rst:523 +#: ../../c-api/intro.rst:722 msgid "sum_list()" -msgstr "" +msgstr "sum_list()" -#: ../../c-api/intro.rst:555 ../../c-api/intro.rst:647 +#: ../../c-api/intro.rst:754 ../../c-api/intro.rst:846 msgid "sum_sequence()" -msgstr "" +msgstr "sum_sequence()" -#: ../../c-api/intro.rst:590 +#: ../../c-api/intro.rst:789 msgid "PyErr_Occurred (C function)" -msgstr "" +msgstr "PyErr_Occurred (função C)" -#: ../../c-api/intro.rst:603 +#: ../../c-api/intro.rst:802 msgid "PyErr_SetString (C function)" -msgstr "" +msgstr "PyErr_SetString (função C)" -#: ../../c-api/intro.rst:603 ../../c-api/intro.rst:711 +#: ../../c-api/intro.rst:802 ../../c-api/intro.rst:910 msgid "PyErr_Clear (C function)" -msgstr "" +msgstr "PyErr_Clear (função C)" -#: ../../c-api/intro.rst:627 +#: ../../c-api/intro.rst:826 msgid "exc_info (in module sys)" -msgstr "" +msgstr "exc_info (no módulo sys)" -#: ../../c-api/intro.rst:662 ../../c-api/intro.rst:709 +#: ../../c-api/intro.rst:861 ../../c-api/intro.rst:908 msgid "incr_item()" -msgstr "" +msgstr "incr_item()" -#: ../../c-api/intro.rst:711 +#: ../../c-api/intro.rst:910 msgid "PyErr_ExceptionMatches (C function)" -msgstr "" +msgstr "PyErr_ExceptionMatches (função C)" -#: ../../c-api/intro.rst:711 +#: ../../c-api/intro.rst:910 msgid "Py_XDECREF (C function)" -msgstr "" +msgstr "Py_XDECREF (função C)" -#: ../../c-api/intro.rst:737 +#: ../../c-api/intro.rst:936 msgid "Py_Initialize (C function)" -msgstr "" +msgstr "Py_Initialize (função C)" -#: ../../c-api/intro.rst:737 +#: ../../c-api/intro.rst:936 msgid "module" msgstr "módulo" -#: ../../c-api/intro.rst:737 +#: ../../c-api/intro.rst:936 msgid "builtins" msgstr "builtins" -#: ../../c-api/intro.rst:737 +#: ../../c-api/intro.rst:936 msgid "__main__" msgstr "__main__" -#: ../../c-api/intro.rst:737 +#: ../../c-api/intro.rst:936 msgid "sys" msgstr "sys" -#: ../../c-api/intro.rst:737 +#: ../../c-api/intro.rst:936 msgid "search" msgstr "pesquisa" -#: ../../c-api/intro.rst:737 +#: ../../c-api/intro.rst:936 msgid "path" msgstr "caminho" -#: ../../c-api/intro.rst:737 +#: ../../c-api/intro.rst:936 msgid "path (in module sys)" -msgstr "" +msgstr "path (no módulo sys)" -#: ../../c-api/intro.rst:772 +#: ../../c-api/intro.rst:971 msgid "Py_GetPath (C function)" -msgstr "" +msgstr "Py_GetPath (função C)" -#: ../../c-api/intro.rst:772 +#: ../../c-api/intro.rst:971 msgid "Py_GetPrefix (C function)" -msgstr "" +msgstr "Py_GetPrefix (função C)" -#: ../../c-api/intro.rst:772 +#: ../../c-api/intro.rst:971 msgid "Py_GetExecPrefix (C function)" -msgstr "" +msgstr "Py_GetExecPrefix (função C)" -#: ../../c-api/intro.rst:772 +#: ../../c-api/intro.rst:971 msgid "Py_GetProgramFullPath (C function)" -msgstr "" +msgstr "Py_GetProgramFullPath (função C)" -#: ../../c-api/intro.rst:787 +#: ../../c-api/intro.rst:986 msgid "Py_IsInitialized (C function)" -msgstr "" +msgstr "Py_IsInitialized (função C)" diff --git a/c-api/iter.po b/c-api/iter.po index a4f8785d6..d8f435a25 100644 --- a/c-api/iter.po +++ b/c-api/iter.po @@ -1,27 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Italo Penaforte , 2021 -# Rafael Fontenelle , 2022 +# python-doc bot, 2025 +# Rafael Fontenelle , 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-24 14:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Rafael Fontenelle , 2022\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -35,8 +34,9 @@ msgstr "Existem duas funções especificas para trabalhar com iteradores." #: ../../c-api/iter.rst:12 msgid "" -"Return non-zero if the object *o* can be safely passed to :c:func:" -"`PyIter_Next`, and ``0`` otherwise. This function always succeeds." +"Return non-zero if the object *o* can be safely passed " +"to :c:func:`PyIter_Next`, and ``0`` otherwise. This function always " +"succeeds." msgstr "" "Retorna valor diferente de zero se o objeto *o* puder ser passado com " "segurança para :c:func:`PyIter_Next`, e ``0`` caso contrário. Esta função " @@ -47,8 +47,9 @@ msgid "" "Return non-zero if the object *o* provides the :class:`AsyncIterator` " "protocol, and ``0`` otherwise. This function always succeeds." msgstr "" -"Retorna valor diferente de zero se o objeto *o* fornecer o protocolo :class:" -"`AsyncIterator` e ``0`` caso contrário. Esta função sempre é bem-sucedida." +"Retorna valor diferente de zero se o objeto *o* fornecer o " +"protocolo :class:`AsyncIterator` e ``0`` caso contrário. Esta função sempre " +"é bem-sucedida." #: ../../c-api/iter.rst:24 msgid "" @@ -71,12 +72,60 @@ msgstr "" "Para escrever um laço que itere sobre um iterador, o código C deve ser algo " "como isto::" +#: ../../c-api/iter.rst:33 +msgid "" +"PyObject *iterator = PyObject_GetIter(obj);\n" +"PyObject *item;\n" +"\n" +"if (iterator == NULL) {\n" +" /* propagate error */\n" +"}\n" +"\n" +"while ((item = PyIter_Next(iterator))) {\n" +" /* do something with item */\n" +" ...\n" +" /* release reference when done */\n" +" Py_DECREF(item);\n" +"}\n" +"\n" +"Py_DECREF(iterator);\n" +"\n" +"if (PyErr_Occurred()) {\n" +" /* propagate error */\n" +"}\n" +"else {\n" +" /* continue doing useful work */\n" +"}" +msgstr "" +"PyObject *iterator = PyObject_GetIter(obj);\n" +"PyObject *item;\n" +"\n" +"if (iterator == NULL) {\n" +" /* propaga o erro */\n" +"}\n" +"\n" +"while ((item = PyIter_Next(iterator))) {\n" +" /* faz algo com o item */\n" +" ...\n" +" /* liberar a referência quando concluído */\n" +" Py_DECREF(item);\n" +"}\n" +"\n" +"Py_DECREF(iterator);\n" +"\n" +"if (PyErr_Occurred()) {\n" +" /* propaga o erro */\n" +"}\n" +"else {\n" +" /* continua fazendo algum trabalho útil */\n" +"}" + #: ../../c-api/iter.rst:59 msgid "" "The enum value used to represent different results of :c:func:`PyIter_Send`." msgstr "" -"O valor de enum usado para representar diferentes resultados de :c:func:" -"`PyIter_Send`." +"O valor de enum usado para representar diferentes resultados " +"de :c:func:`PyIter_Send`." #: ../../c-api/iter.rst:66 msgid "Sends the *arg* value into the iterator *iter*. Returns:" @@ -93,7 +142,7 @@ msgstr "" msgid "" "``PYGEN_NEXT`` if iterator yields. Yielded value is returned via *presult*." msgstr "" -"``PYGEN_NEXT`` se o iterador render. O valor preduzido é retornado via " +"``PYGEN_NEXT`` se o iterador render. O valor produzido é retornado via " "*presult*." #: ../../c-api/iter.rst:70 diff --git a/c-api/iterator.po b/c-api/iterator.po index e0c26f3c4..ac0ad3b0b 100644 --- a/c-api/iterator.po +++ b/c-api/iterator.po @@ -1,26 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Felipefpl, 2021 -# Rafael Fontenelle , 2023 +# python-doc bot, 2025 +# Rafael Fontenelle , 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-24 14:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -31,10 +31,10 @@ msgstr "Objetos Iteradores" #: ../../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:`~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." msgstr "" "O Python fornece dois objetos iteradores de propósito geral. O primeiro, um " "iterador de sequência, trabalha com uma sequência arbitrária suportando o " @@ -48,9 +48,9 @@ msgid "" "one-argument form of the :func:`iter` built-in function for built-in " "sequence types." msgstr "" -"Objeto de tipo para objetos iteradores retornados por :c:func:" -"`PySeqIter_New` e a forma de um argumento da função embutida :func:`iter` " -"para os tipos de sequência embutidos." +"Objeto de tipo para objetos iteradores retornados " +"por :c:func:`PySeqIter_New` e a forma de um argumento da função " +"embutida :func:`iter` para os tipos de sequência embutidos." #: ../../c-api/iterator.rst:24 msgid "" @@ -75,9 +75,9 @@ msgid "" "Type object for iterator objects returned by :c:func:`PyCallIter_New` and " "the two-argument form of the :func:`iter` built-in function." msgstr "" -"Objeto de tipo para objetos iteradores retornados por :c:func:" -"`PyCallIter_New` e a forma de dois argumentos da função embutida :func:" -"`iter`." +"Objeto de tipo para objetos iteradores retornados " +"por :c:func:`PyCallIter_New` e a forma de dois argumentos da função " +"embutida :func:`iter`." #: ../../c-api/iterator.rst:43 msgid "" @@ -98,3 +98,89 @@ msgstr "" "qualquer objeto chamável do Python que possa ser chamado sem parâmetros; " "cada chamada deve retornar o próximo item na iteração. Quando *callable* " "retorna um valor igual a *sentinel*, a iteração será encerrada." + +#: ../../c-api/iterator.rst:56 +msgid "Range Objects" +msgstr "Objetos intervalo" + +#: ../../c-api/iterator.rst:60 +msgid "The type object for :class:`range` objects." +msgstr "O objeto tipo para objetos :class:`range`." + +#: ../../c-api/iterator.rst:65 +msgid "" +"Return true if the object *o* is an instance of a :class:`range` object. " +"This function always succeeds." +msgstr "" +"Retorna verdadeiro se o objeto *op* for uma instância de um " +"objeto :class:`range`. Esta função sempre tem sucesso." + +#: ../../c-api/iterator.rst:70 +msgid "Builtin Iterator Types" +msgstr "Tipos de iteradores embutidos" + +#: ../../c-api/iterator.rst:72 +msgid "" +"These are built-in iteration types that are included in Python's C API, but " +"provide no additional functions. They are here for completeness." +msgstr "" +"Esses são tipos de iteração embutidos que estão incluídos na API C do " +"Python, mas não fornecem funções adicionais. Eles estão aqui para fins de " +"completude." + +#: ../../c-api/iterator.rst:80 +msgid "C type" +msgstr "Tipo em C" + +#: ../../c-api/iterator.rst:81 +msgid "Python type" +msgstr "Tipo em Python" + +#: ../../c-api/iterator.rst:83 +msgid ":py:class:`enumerate`" +msgstr ":py:class:`enumerate`" + +#: ../../c-api/iterator.rst:85 +msgid ":py:class:`filter`" +msgstr ":py:class:`filter`" + +#: ../../c-api/iterator.rst:87 +msgid ":py:class:`map`" +msgstr ":py:class:`map`" + +#: ../../c-api/iterator.rst:89 +msgid ":py:class:`reversed`" +msgstr ":py:class:`reversed`" + +#: ../../c-api/iterator.rst:91 +msgid ":py:class:`zip`" +msgstr ":py:class:`zip`" + +#: ../../c-api/iterator.rst:95 +msgid "Other Iterator Objects" +msgstr "Outros objetos iteradores" + +#: ../../c-api/iterator.rst:113 +msgid "Type objects for iterators of various built-in objects." +msgstr "Objetos de tipo para iteradores de vários objetos embutidos." + +#: ../../c-api/iterator.rst:115 +msgid "" +"Do not create instances of these directly; prefer " +"calling :c:func:`PyObject_GetIter` instead." +msgstr "" +"Não cria instâncias dessas diretamente; prefira " +"chamar :c:func:`PyObject_GetIter` em vez disso." + +#: ../../c-api/iterator.rst:118 +msgid "" +"Note that there is no guarantee that a given built-in type uses a given " +"iterator type. For example, iterating over :class:`range` will use one of " +"two iterator types depending on the size of the range. Other types may start " +"using a similar scheme in the future, without warning." +msgstr "" +"Note que não há garantia de que um determinado tipo embutido utilize um " +"determinado tipo de iterador. Por exemplo, iterar sobre um :class:`range` " +"utilizará um de dois tipos de iterador, dependendo do tamanho do intervalo. " +"Outros tipos podem começar a usar um esquema semelhante no futuro, sem aviso " +"prévio." diff --git a/c-api/list.po b/c-api/list.po index 66f5bbba3..895cb03c1 100644 --- a/c-api/list.po +++ b/c-api/list.po @@ -1,29 +1,25 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Livia Cavalcanti , 2021 -# Marco Rougeth , 2023 -# Rafael Fontenelle , 2024 -# Adorilson Bezerra , 2024 +# python-doc bot, 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-08-03 20:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Adorilson Bezerra , 2024\n" +"POT-Creation-Date: 2026-10-13 21:57+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: python-doc bot, 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -69,20 +65,20 @@ 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` " +"or :c:func:`PyList_SET_ITEM()`. The following APIs are safe APIs before the " +"list is fully initialized: :c:func:`PyList_SetItem()` " +"and :c:func:`PyList_SET_ITEM()`." msgstr "" "Se *len* for maior que zero, os itens do objeto da lista retornada são " "definidos como ``NULL``. Portanto, você não pode usar funções API abstratas, " "como :c:func:`PySequence_SetItem` ou expor o objeto ao código Python antes " "de definir todos os itens para um objeto real com :c:func:`PyList_SetItem` " "ou :c:func:`PyList_SET_ITEM()`. As seguintes APIs são seguras desde que " -"antes as listas tenham sido inicializadas: :c:func:`PyList_SetItem()` e :c:" -"func:`PyList_SET_ITEM()`." +"antes as listas tenham sido inicializadas: :c:func:`PyList_SetItem()` " +"e :c:func:`PyList_SET_ITEM()`." #: ../../c-api/list.rst:53 msgid "" @@ -132,13 +128,12 @@ msgstr "" #: ../../c-api/list.rst:91 msgid "" -"This function \"steals\" a reference to *item* and discards a reference to " -"an item already in the list at the affected position." +"This function \":term:`steals `\" a reference to *item*, even on " +"error. On success, it discards a reference to an item already in the list at " +"the affected position (unless it was ``NULL``)." msgstr "" -"Esta função \"rouba\" uma referência para o *item* e descarta uma referência " -"para um item já presente na lista na posição afetada." -#: ../../c-api/list.rst:97 +#: ../../c-api/list.rst:99 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." @@ -147,26 +142,25 @@ msgstr "" "normalmente usado apenas para preencher novas listas onde não há conteúdo " "anterior." -#: ../../c-api/list.rst:100 +#: ../../c-api/list.rst:102 msgid "" -"Bounds checking is performed as an assertion if Python is built in :ref:" -"`debug mode ` or :option:`with assertions <--with-assertions>`." +"Bounds checking is performed as an assertion if Python is built " +"in :ref:`debug mode ` or :option:`with assertions <--with-" +"assertions>`." msgstr "" "A verificação de limites é realizada como uma asserção se o Python for " "construído em :ref:`modo de depuração ` ou :option:`com " "asserções <--with-assertions>`." -#: ../../c-api/list.rst:106 +#: ../../c-api/list.rst:108 msgid "" -"This macro \"steals\" a reference to *item*, and, unlike :c:func:" -"`PyList_SetItem`, does *not* discard a reference to any item that is being " -"replaced; any reference in *list* at position *i* will be leaked." +"This macro \":term:`steals `\" a reference to *item*, and, " +"unlike :c:func:`PyList_SetItem`, does *not* discard a reference to any item " +"that is being replaced; any reference in *list* at position *i* will be " +"leaked." msgstr "" -"Esta macro \"rouba\" uma referência para o *item* e, ao contrário de :c:func:" -"`PyList_SetItem`, *não* descarta uma referência para nenhum item que esteja " -"sendo substituído; qualquer referência em *list* será perdida." -#: ../../c-api/list.rst:114 +#: ../../c-api/list.rst:116 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. " @@ -176,7 +170,7 @@ msgstr "" "``0`` se for bem-sucedido; retorna ``-1`` e levanta uma exceção se " "malsucedido. Análogo a ``list.insert(index, item)``." -#: ../../c-api/list.rst:121 +#: ../../c-api/list.rst:123 msgid "" "Append the object *item* at the end of list *list*. Return ``0`` if " "successful; return ``-1`` and set an exception if unsuccessful. Analogous " @@ -186,7 +180,7 @@ msgstr "" "sucedido; retorna ``-1`` e levanta uma exceção se malsucedido. Análogo a " "``list.insert(index, item)``." -#: ../../c-api/list.rst:128 +#: ../../c-api/list.rst:130 msgid "" "Return a list of the objects in *list* containing the objects *between* " "*low* and *high*. Return ``NULL`` and set an exception if unsuccessful. " @@ -197,7 +191,7 @@ msgstr "" "*alto*. Retorne ``NULL`` e levanta uma exceção se malsucedido. Análogo a " "``list[low:high]``. Não há suporte à indexação do final da lista." -#: ../../c-api/list.rst:135 +#: ../../c-api/list.rst:137 msgid "" "Set the slice of *list* between *low* and *high* to the contents of " "*itemlist*. Analogous to ``list[low:high] = itemlist``. The *itemlist* may " @@ -211,7 +205,7 @@ msgstr "" "em caso de sucesso, ``-1`` em caso de falha. Não há suporte à indexação do " "final da lista." -#: ../../c-api/list.rst:144 +#: ../../c-api/list.rst:146 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 " @@ -221,15 +215,15 @@ msgstr "" "``PyList_SetSlice(list, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, iterable)`` e " "análogo a ``list.extend(iterable)`` ou ``list += iterable``." -#: ../../c-api/list.rst:148 +#: ../../c-api/list.rst:150 msgid "" "Raise an exception and return ``-1`` if *list* is not a :class:`list` " "object. Return 0 on success." msgstr "" -"Levanta uma exceção e retorna ``-1`` se *list* não for um objeto :class:" -"`list`. Retorna 0 em caso de sucesso." +"Levanta uma exceção e retorna ``-1`` se *list* não for um " +"objeto :class:`list`. Retorna 0 em caso de sucesso." -#: ../../c-api/list.rst:156 +#: ../../c-api/list.rst:158 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 " @@ -238,15 +232,15 @@ msgstr "" "Remove todos os itens da *lista*. Isto é o mesmo que ``PyList_SetSlice(list, " "0, PY_SSIZE_T_MAX, NULL)`` e análogo a ``list.clear()`` ou ``del list[:]``." -#: ../../c-api/list.rst:160 +#: ../../c-api/list.rst:162 msgid "" "Raise an exception and return ``-1`` if *list* is not a :class:`list` " "object. Return 0 on success." msgstr "" -"Levanta uma exceção e retorna ``-1`` se *list* não for um objeto :class:" -"`list`. Retorna 0 em caso de sucesso." +"Levanta uma exceção e retorna ``-1`` se *list* não for um " +"objeto :class:`list`. Retorna 0 em caso de sucesso." -#: ../../c-api/list.rst:168 +#: ../../c-api/list.rst:170 msgid "" "Sort the items of *list* in place. Return ``0`` on success, ``-1`` on " "failure. This is equivalent to ``list.sort()``." @@ -254,7 +248,7 @@ msgstr "" "Ordena os itens de *list* no mesmo lugar. Retorna ``0`` em caso de sucesso, " "e ``-1`` em caso de falha. Isso é o equivalente de ``list.sort()``." -#: ../../c-api/list.rst:174 +#: ../../c-api/list.rst:176 msgid "" "Reverse the items of *list* in place. Return ``0`` on success, ``-1`` on " "failure. This is the equivalent of ``list.reverse()``." @@ -262,7 +256,7 @@ msgstr "" "Inverte os itens de *list* no mesmo lugar. Retorna ``0`` em caso de sucesso, " "e ``-1`` em caso de falha. Isso é o equivalente de ``list.reverse()``." -#: ../../c-api/list.rst:182 +#: ../../c-api/list.rst:184 msgid "" "Return a new tuple object containing the contents of *list*; equivalent to " "``tuple(list)``." @@ -278,7 +272,7 @@ msgstr "objeto" msgid "list" msgstr "lista" -#: ../../c-api/list.rst:51 ../../c-api/list.rst:180 +#: ../../c-api/list.rst:51 ../../c-api/list.rst:182 msgid "built-in function" msgstr "função embutida" @@ -286,6 +280,6 @@ msgstr "função embutida" msgid "len" msgstr "len" -#: ../../c-api/list.rst:180 +#: ../../c-api/list.rst:182 msgid "tuple" msgstr "tupla" diff --git a/c-api/long.po b/c-api/long.po index 9fe52a8f4..3e1a5890b 100644 --- a/c-api/long.po +++ b/c-api/long.po @@ -1,29 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Marco Rougeth , 2024 -# Claudio Rogerio Carvalho Filho , 2024 -# Welington Carlos , 2024 -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 +# Rafael Fontenelle , 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-08-09 16:36+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-17 18:27+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -45,8 +42,8 @@ msgid "" "disambiguate." msgstr "" "Em caso de erro, a maioria das APIs ``PyLong_As*`` retorna ``(tipo de " -"retorno)-1`` que não pode ser distinguido de um número. Use :c:func:" -"`PyErr_Occurred` para desambiguar." +"retorno)-1`` que não pode ser distinguido de um número. " +"Use :c:func:`PyErr_Occurred` para desambiguar." #: ../../c-api/long.rst:18 msgid "This subtype of :c:type:`PyObject` represents a Python integer object." @@ -63,11 +60,11 @@ msgstr "" #: ../../c-api/long.rst:29 msgid "" -"Return true if its argument is a :c:type:`PyLongObject` or a subtype of :c:" -"type:`PyLongObject`. This function always succeeds." +"Return true if its argument is a :c:type:`PyLongObject` or a subtype " +"of :c:type:`PyLongObject`. This function always succeeds." msgstr "" -"Retorna true se seu argumento é um :c:type:`PyLongObject` ou um subtipo de :" -"c:type:`PyLongObject`. Esta função sempre tem sucesso." +"Retorna true se seu argumento é um :c:type:`PyLongObject` ou um subtipo " +"de :c:type:`PyLongObject`. Esta função sempre tem sucesso." #: ../../c-api/long.rst:35 msgid "" @@ -84,20 +81,22 @@ msgstr "" "Retorna um novo objeto :c:type:`PyLongObject` de *v* ou ``NULL`` em caso de " "falha." -#: ../../c-api/long.rst:43 +#: ../../c-api/long.rst:45 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 " -"you actually just get back a reference to the existing object." +"CPython keeps an array of integer objects for all 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 "" -#: ../../c-api/long.rst:50 +#: ../../c-api/long.rst:52 msgid "" "Return a new :c:type:`PyLongObject` object from a C :c:expr:`unsigned long`, " "or ``NULL`` on failure." msgstr "" +"Retorna um novo objeto :c:type:`PyLongObject` de um :c:expr:`unsigned long` " +"C ou ``NULL`` em caso de falha." -#: ../../c-api/long.rst:56 +#: ../../c-api/long.rst:58 msgid "" "Return a new :c:type:`PyLongObject` object from a C :c:type:`Py_ssize_t`, or " "``NULL`` on failure." @@ -105,7 +104,7 @@ msgstr "" "Retorna um novo objeto :c:type:`PyLongObject` de um :c:type:`Py_ssize_t` C " "ou ``NULL`` em caso de falha." -#: ../../c-api/long.rst:62 +#: ../../c-api/long.rst:64 msgid "" "Return a new :c:type:`PyLongObject` object from a C :c:type:`size_t`, or " "``NULL`` on failure." @@ -113,19 +112,23 @@ msgstr "" "Retorna um novo objeto :c:type:`PyLongObject` de um :c:type:`size_t` C ou " "``NULL`` em caso de falha." -#: ../../c-api/long.rst:68 +#: ../../c-api/long.rst:70 msgid "" "Return a new :c:type:`PyLongObject` object from a C :c:expr:`long long`, or " "``NULL`` on failure." msgstr "" +"Retorna um novo objeto :c:type:`PyLongObject` de um :c:expr:`long long` C ou " +"``NULL`` em caso de falha." -#: ../../c-api/long.rst:74 +#: ../../c-api/long.rst:76 msgid "" "Return a new :c:type:`PyLongObject` object from a C :c:expr:`unsigned long " "long`, or ``NULL`` on failure." msgstr "" +"Retorna um novo objeto :c:type:`PyLongObject` de um :c:expr:`unsigned long " +"long` C ou ``NULL`` em caso de falha." -#: ../../c-api/long.rst:80 +#: ../../c-api/long.rst:82 msgid "" "Return a new :c:type:`PyLongObject` object from the integer part of *v*, or " "``NULL`` on failure." @@ -133,7 +136,7 @@ msgstr "" "Retorna um novo objeto :c:type:`PyLongObject` da parte inteira de *v* ou " "``NULL`` em caso de falha." -#: ../../c-api/long.rst:86 +#: ../../c-api/long.rst:88 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 " @@ -147,15 +150,27 @@ msgid "" "digits or *str* is not NULL-terminated following the digits and trailing " "whitespace, :exc:`ValueError` will be raised." msgstr "" - -#: ../../c-api/long.rst:97 -msgid "" -"Python methods :meth:`int.to_bytes` and :meth:`int.from_bytes` to convert a :" -"c:type:`PyLongObject` to/from an array of bytes in base ``256``. You can " +"Retorna um novo :c:type:`PyLongObject` com base no valor da string em *str*, " +"que é interpretado de acordo com a raiz em *base* ou ``NULL`` em caso de " +"falha. Se *pend* não for ``NULL``, *\\*pend* apontará para o fim do *str* em " +"caso de sucesso ou para seu primeiro caractere que não pode ser processado " +"em caso de erro. Se *base* for ``0``, *str* é interpretado usando a " +"definição de :ref:`integers`; neste caso, zeros à esquerda em um número " +"decimal diferente de zero aumenta um :exc:`ValueError`. Se *base* não for " +"``0``, deve estar entre ``2`` e ``36``, inclusive. Espaços em branco no " +"início ou no final e sublinhados simples após um especificador de base e " +"entre dígitos são ignorados. Se não houver dígitos ou *str* não for " +"terminado em NULL após os dígitos e espaços em branco à " +"direita, :exc:`ValueError` será levantada." + +#: ../../c-api/long.rst:99 +msgid "" +"Python methods :meth:`int.to_bytes` and :meth:`int.from_bytes` to convert " +"a :c:type:`PyLongObject` to/from an array of bytes in base ``256``. You can " "call those from C using :c:func:`PyObject_CallMethod`." msgstr "" -#: ../../c-api/long.rst:104 +#: ../../c-api/long.rst:106 msgid "" "Convert a sequence of Unicode digits in the string *u* to a Python integer " "value." @@ -163,7 +178,7 @@ msgstr "" "Converte uma sequência de dígitos Unicode na string *u* para um valor " "inteiro Python." -#: ../../c-api/long.rst:112 +#: ../../c-api/long.rst:114 msgid "" "Create a Python integer from the pointer *p*. The pointer value can be " "retrieved from the resulting value using :c:func:`PyLong_AsVoidPtr`." @@ -171,13 +186,13 @@ msgstr "" "Cria um inteiro Python a partir do ponteiro *p*. O valor do ponteiro pode " "ser recuperado do valor resultante usando :c:func:`PyLong_AsVoidPtr`." -#: ../../c-api/long.rst:118 +#: ../../c-api/long.rst:120 msgid "" "Create a Python integer from the value contained in the first *n_bytes* of " "*buffer*, interpreted as a two's-complement signed number." msgstr "" -#: ../../c-api/long.rst:121 +#: ../../c-api/long.rst:123 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 " @@ -186,85 +201,104 @@ msgid "" "calling :c:func:`PyLong_FromUnsignedNativeBytes`. Other flags are ignored." msgstr "" -#: ../../c-api/long.rst:132 +#: ../../c-api/long.rst:134 msgid "" "Create a Python integer from the value contained in the first *n_bytes* of " "*buffer*, interpreted as an unsigned number." msgstr "" -#: ../../c-api/long.rst:135 +#: ../../c-api/long.rst:137 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:149 ../../c-api/long.rst:175 +#: ../../c-api/long.rst:146 +msgid "Macro for creating a Python integer from a process identifier." +msgstr "" + +#: ../../c-api/long.rst:148 +msgid "" +"This can be defined as an alias to :c:func:`PyLong_FromLong` " +"or :c:func:`PyLong_FromLongLong`, depending on the size of the system's PID " +"type." +msgstr "" + +#: ../../c-api/long.rst:161 ../../c-api/long.rst:195 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:153 +#: ../../c-api/long.rst:165 msgid "" -"Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:" -"expr:`long`." +"Raise :exc:`OverflowError` if the value of *obj* is out of range for " +"a :c:expr:`long`." msgstr "" -#: ../../c-api/long.rst:156 ../../c-api/long.rst:184 ../../c-api/long.rst:205 -#: ../../c-api/long.rst:225 ../../c-api/long.rst:248 +#: ../../c-api/long.rst:168 ../../c-api/long.rst:204 ../../c-api/long.rst:225 +#: ../../c-api/long.rst:245 ../../c-api/long.rst:268 msgid "Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" "Retorna ``-1`` no caso de erro. Use :c:func:`PyErr_Occurred` para " "desambiguar." -#: ../../c-api/long.rst:158 ../../c-api/long.rst:186 ../../c-api/long.rst:207 -#: ../../c-api/long.rst:229 ../../c-api/long.rst:313 ../../c-api/long.rst:333 +#: ../../c-api/long.rst:170 ../../c-api/long.rst:206 ../../c-api/long.rst:227 +#: ../../c-api/long.rst:249 ../../c-api/long.rst:333 ../../c-api/long.rst:353 msgid "Use :meth:`~object.__index__` if available." msgstr "Usa :meth:`~object.__index__`, se disponível." -#: ../../c-api/long.rst:161 ../../c-api/long.rst:189 ../../c-api/long.rst:210 -#: ../../c-api/long.rst:232 ../../c-api/long.rst:316 ../../c-api/long.rst:336 +#: ../../c-api/long.rst:173 ../../c-api/long.rst:209 ../../c-api/long.rst:230 +#: ../../c-api/long.rst:252 ../../c-api/long.rst:336 ../../c-api/long.rst:356 msgid "This function will no longer use :meth:`~object.__int__`." msgstr "" -#: ../../c-api/long.rst:167 +#: ../../c-api/long.rst:180 msgid "" -"Similar to :c:func:`PyLong_AsLong`, but store the result in a C :c:expr:" -"`int` instead of a C :c:expr:`long`." +"Exactly equivalent to the preferred ``PyLong_AsLong``. In particular, it can " +"fail with :exc:`OverflowError` or another exception." msgstr "" -#: ../../c-api/long.rst:179 +#: ../../c-api/long.rst:187 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." +"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:198 ../../c-api/long.rst:216 +#: ../../c-api/long.rst:199 +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." +msgstr "" + +#: ../../c-api/long.rst:218 ../../c-api/long.rst:236 msgid "" "Return a C :c:expr:`long long` representation of *obj*. If *obj* is not an " "instance of :c:type:`PyLongObject`, first call its :meth:`~object.__index__` " "method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:202 +#: ../../c-api/long.rst:222 msgid "" -"Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:" -"expr:`long long`." +"Raise :exc:`OverflowError` if the value of *obj* is out of range for " +"a :c:expr:`long long`." msgstr "" -#: ../../c-api/long.rst:220 +#: ../../c-api/long.rst:240 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 :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." msgstr "" -#: ../../c-api/long.rst:242 +#: ../../c-api/long.rst:262 msgid "" "Return a C :c:type:`Py_ssize_t` representation of *pylong*. *pylong* must " "be an instance of :c:type:`PyLongObject`." @@ -272,27 +306,27 @@ msgstr "" "Retorna uma representação de :c:type:`Py_ssize_t` C de *pylong*. *pylong* " "deve ser uma instância de :c:type:`PyLongObject`." -#: ../../c-api/long.rst:245 +#: ../../c-api/long.rst:265 msgid "" -"Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" -"type:`Py_ssize_t`." +"Raise :exc:`OverflowError` if the value of *pylong* is out of range for " +"a :c:type:`Py_ssize_t`." msgstr "" "Levanta :exc:`OverflowError` se o valor de *pylong* estiver fora do " "intervalo de um :c:type:`Py_ssize_t`." -#: ../../c-api/long.rst:257 +#: ../../c-api/long.rst:277 msgid "" "Return a C :c:expr:`unsigned long` representation of *pylong*. *pylong* " "must be an instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:260 +#: ../../c-api/long.rst:280 msgid "" -"Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" -"expr:`unsigned long`." +"Raise :exc:`OverflowError` if the value of *pylong* is out of range for " +"a :c:expr:`unsigned long`." msgstr "" -#: ../../c-api/long.rst:263 +#: ../../c-api/long.rst:283 msgid "" "Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." @@ -300,7 +334,7 @@ msgstr "" "Retorna ``(unsigned long)-1`` no caso de erro. Use :c:func:`PyErr_Occurred` " "para desambiguar." -#: ../../c-api/long.rst:273 +#: ../../c-api/long.rst:293 msgid "" "Return a C :c:type:`size_t` representation of *pylong*. *pylong* must be an " "instance of :c:type:`PyLongObject`." @@ -308,15 +342,15 @@ msgstr "" "Retorna uma representação de :c:type:`size_t` C de *pylong*. *pylong* deve " "ser uma instância de :c:type:`PyLongObject`." -#: ../../c-api/long.rst:276 +#: ../../c-api/long.rst:296 msgid "" -"Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" -"type:`size_t`." +"Raise :exc:`OverflowError` if the value of *pylong* is out of range for " +"a :c:type:`size_t`." msgstr "" "Levanta :exc:`OverflowError` se o valor de *pylong* estiver fora do " "intervalo de um :c:type:`size_t`." -#: ../../c-api/long.rst:279 +#: ../../c-api/long.rst:299 msgid "" "Returns ``(size_t)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." @@ -324,47 +358,48 @@ msgstr "" "Retorna ``(size)-1`` no caso de erro. Use :c:func:`PyErr_Occurred` para " "desambiguar." -#: ../../c-api/long.rst:288 +#: ../../c-api/long.rst:308 msgid "" "Return a C :c:expr:`unsigned long long` representation of *pylong*. " "*pylong* must be an instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:291 +#: ../../c-api/long.rst:311 msgid "" -"Raise :exc:`OverflowError` if the value of *pylong* is out of range for an :" -"c:expr:`unsigned long long`." +"Raise :exc:`OverflowError` if the value of *pylong* is out of range for " +"an :c:expr:`unsigned long long`." msgstr "" -#: ../../c-api/long.rst:294 +#: ../../c-api/long.rst:314 msgid "" "Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -"Retorna ``(unsigned long long)-1`` no caso de erro. Use :c:func:" -"`PyErr_Occurred` para desambiguar." +"Retorna ``(unsigned long long)-1`` no caso de erro. " +"Use :c:func:`PyErr_Occurred` para desambiguar." -#: ../../c-api/long.rst:297 +#: ../../c-api/long.rst:317 msgid "" "A negative *pylong* now raises :exc:`OverflowError`, not :exc:`TypeError`." msgstr "" -"Um *pylong* negativo agora levanta :exc:`OverflowError`, não :exc:" -"`TypeError`." +"Um *pylong* negativo agora levanta :exc:`OverflowError`, " +"não :exc:`TypeError`." -#: ../../c-api/long.rst:303 +#: ../../c-api/long.rst:323 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`." +"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:307 +#: ../../c-api/long.rst:327 msgid "" "If the value of *obj* is out of range for an :c:expr:`unsigned long`, return " "the reduction of that value modulo ``ULONG_MAX + 1``." msgstr "" -#: ../../c-api/long.rst:310 +#: ../../c-api/long.rst:330 msgid "" "Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." @@ -372,190 +407,251 @@ msgstr "" "Retorna ``(unsigned long)-1`` no caso de erro. Use :c:func:`PyErr_Occurred` " "para desambiguar." -#: ../../c-api/long.rst:322 +#: ../../c-api/long.rst:342 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`." +"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:327 +#: ../../c-api/long.rst:347 msgid "" "If the value of *obj* is out of range for an :c:expr:`unsigned long long`, " "return the reduction of that value modulo ``ULLONG_MAX + 1``." msgstr "" -#: ../../c-api/long.rst:330 +#: ../../c-api/long.rst:350 msgid "" "Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` " "to disambiguate." msgstr "" -"Retorna ``(unsigned long long)-1`` no caso de erro. Use :c:func:" -"`PyErr_Occurred` para desambiguar." +"Retorna ``(unsigned long long)-1`` no caso de erro. " +"Use :c:func:`PyErr_Occurred` para desambiguar." -#: ../../c-api/long.rst:342 +#: ../../c-api/long.rst:362 msgid "" "Return a C :c:expr:`double` representation of *pylong*. *pylong* must be an " "instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:345 +#: ../../c-api/long.rst:365 msgid "" -"Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" -"expr:`double`." +"Raise :exc:`OverflowError` if the value of *pylong* is out of range for " +"a :c:expr:`double`." msgstr "" -#: ../../c-api/long.rst:348 +#: ../../c-api/long.rst:368 msgid "" "Returns ``-1.0`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" "Retorna ``-1.0`` no caso de erro. Use :c:func:`PyErr_Occurred` para " "desambiguar." -#: ../../c-api/long.rst:353 +#: ../../c-api/long.rst:373 msgid "" "Convert a Python integer *pylong* to a C :c:expr:`void` pointer. If *pylong* " "cannot be converted, an :exc:`OverflowError` will be raised. This is only " -"assured to produce a usable :c:expr:`void` pointer for values created with :" -"c:func:`PyLong_FromVoidPtr`." +"assured to produce a usable :c:expr:`void` pointer for values created " +"with :c:func:`PyLong_FromVoidPtr`." msgstr "" -#: ../../c-api/long.rst:358 +#: ../../c-api/long.rst:378 msgid "" "Returns ``NULL`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" "Retorna ``NULL`` no caso de erro. Use :c:func:`PyErr_Occurred` para " "desambiguar." -#: ../../c-api/long.rst:363 +#: ../../c-api/long.rst:383 +msgid "Macro for converting a Python integer into a process identifier." +msgstr "" + +#: ../../c-api/long.rst:385 +msgid "" +"This can be defined as an alias " +"to :c:func:`PyLong_AsLong`, :c:func:`PyLong_FromLongLong`, " +"or :c:func:`PyLong_AsInt`, depending on the size of the system's PID type." +msgstr "" + +#: ../../c-api/long.rst:394 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:367 +#: ../../c-api/long.rst:398 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:371 +#: ../../c-api/long.rst:402 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." +"*n_bytes* of the buffer are written: remaining bytes filled by copies of the " +"sign bit." msgstr "" -#: ../../c-api/long.rst:376 +#: ../../c-api/long.rst:407 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." +"If the returned value is greater 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:383 +#: ../../c-api/long.rst:414 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:386 +#: ../../c-api/long.rst:417 msgid "``0`` will never be returned." msgstr "" -#: ../../c-api/long.rst:388 +#: ../../c-api/long.rst:419 msgid "Values are always copied as two's-complement." msgstr "" -#: ../../c-api/long.rst:390 +#: ../../c-api/long.rst:421 msgid "Usage example::" msgstr "" -#: ../../c-api/long.rst:406 +#: ../../c-api/long.rst:423 +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:437 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:413 +#: ../../c-api/long.rst:444 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:416 +#: ../../c-api/long.rst:447 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:447 +#: ../../c-api/long.rst:450 +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:478 msgid "" "*flags* is either ``-1`` (``Py_ASNATIVEBYTES_DEFAULTS``) to select defaults " -"that behave most like a C cast, or a combintation of the other flags in the " +"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:452 +#: ../../c-api/long.rst:483 msgid "" "Currently, ``-1`` corresponds to ``Py_ASNATIVEBYTES_NATIVE_ENDIAN | " "Py_ASNATIVEBYTES_UNSIGNED_BUFFER``." msgstr "" -#: ../../c-api/long.rst:456 +#: ../../c-api/long.rst:489 msgid "Flag" msgstr "Sinalizador" -#: ../../c-api/long.rst:456 +#: ../../c-api/long.rst:489 msgid "Value" msgstr "Valor" -#: ../../c-api/long.rst:458 +#: ../../c-api/long.rst:491 msgid "``-1``" -msgstr "" +msgstr "``-1``" -#: ../../c-api/long.rst:459 +#: ../../c-api/long.rst:492 msgid "``0``" msgstr "``0``" -#: ../../c-api/long.rst:460 +#: ../../c-api/long.rst:493 msgid "``1``" msgstr "``1``" -#: ../../c-api/long.rst:461 +#: ../../c-api/long.rst:494 msgid "``3``" msgstr "``3``" -#: ../../c-api/long.rst:462 +#: ../../c-api/long.rst:495 msgid "``4``" msgstr "``4``" -#: ../../c-api/long.rst:463 +#: ../../c-api/long.rst:496 msgid "``8``" msgstr "``8``" -#: ../../c-api/long.rst:464 +#: ../../c-api/long.rst:497 msgid "``16``" -msgstr "" +msgstr "``16``" -#: ../../c-api/long.rst:467 +#: ../../c-api/long.rst:500 msgid "" "Specifying ``Py_ASNATIVEBYTES_NATIVE_ENDIAN`` will override any other endian " "flags. Passing ``2`` is reserved." msgstr "" -#: ../../c-api/long.rst:470 +#: ../../c-api/long.rst:503 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:474 +#: ../../c-api/long.rst:507 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 " @@ -565,7 +661,7 @@ msgid "" "requested." msgstr "" -#: ../../c-api/long.rst:481 +#: ../../c-api/long.rst:514 msgid "" "Specifying ``Py_ASNATIVEBYTES_REJECT_NEGATIVE`` causes an exception to be " "set if *pylong* is negative. Without this flag, negative values will be " @@ -573,17 +669,17 @@ msgid "" "of whether ``Py_ASNATIVEBYTES_UNSIGNED_BUFFER`` was specified." msgstr "" -#: ../../c-api/long.rst:486 +#: ../../c-api/long.rst:519 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`." +"``-1``, this option is not set, and non-integer values will " +"raise :exc:`TypeError`." msgstr "" -#: ../../c-api/long.rst:495 +#: ../../c-api/long.rst:528 msgid "" "With the default *flags* (``-1``, or *UNSIGNED_BUFFER* without " "*REJECT_NEGATIVE*), multiple Python integers can map to a single value " @@ -591,46 +687,47 @@ msgid "" "buffer and set all its bits. This matches typical C cast behavior." msgstr "" -#: ../../c-api/long.rst:506 +#: ../../c-api/long.rst:539 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:510 +#: ../../c-api/long.rst:543 msgid "On failure, return ``NULL`` with an exception set." msgstr "Em caso de falha, retorna ``NULL`` com uma exceção definida." -#: ../../c-api/long.rst:517 +#: ../../c-api/long.rst:550 msgid "Return 1 if *op* is compact, 0 otherwise." msgstr "" -#: ../../c-api/long.rst:519 +#: ../../c-api/long.rst:552 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`." +"“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:525 +#: ../../c-api/long.rst:558 msgid "The speedup is expected to be negligible for most users." msgstr "" -#: ../../c-api/long.rst:527 +#: ../../c-api/long.rst:560 msgid "" "Exactly what values are considered compact is an implementation detail and " "is subject to change." msgstr "" -#: ../../c-api/long.rst:532 +#: ../../c-api/long.rst:568 msgid "" "If *op* is compact, as determined by :c:func:`PyUnstable_Long_IsCompact`, " "return its value." msgstr "" -#: ../../c-api/long.rst:535 +#: ../../c-api/long.rst:571 msgid "Otherwise, the return value is undefined." msgstr "" @@ -646,23 +743,23 @@ msgstr "" msgid "integer" msgstr "inteiro" -#: ../../c-api/long.rst:145 +#: ../../c-api/long.rst:157 msgid "LONG_MAX (C macro)" msgstr "" -#: ../../c-api/long.rst:145 ../../c-api/long.rst:195 ../../c-api/long.rst:238 -#: ../../c-api/long.rst:253 ../../c-api/long.rst:269 ../../c-api/long.rst:285 +#: ../../c-api/long.rst:157 ../../c-api/long.rst:215 ../../c-api/long.rst:258 +#: ../../c-api/long.rst:273 ../../c-api/long.rst:289 ../../c-api/long.rst:305 msgid "OverflowError (built-in exception)" msgstr "" -#: ../../c-api/long.rst:238 +#: ../../c-api/long.rst:258 msgid "PY_SSIZE_T_MAX (C macro)" msgstr "" -#: ../../c-api/long.rst:253 +#: ../../c-api/long.rst:273 msgid "ULONG_MAX (C macro)" msgstr "" -#: ../../c-api/long.rst:269 +#: ../../c-api/long.rst:289 msgid "SIZE_MAX (C macro)" msgstr "" diff --git a/c-api/mapping.po b/c-api/mapping.po index f6c29fcdd..f4900a05b 100644 --- a/c-api/mapping.po +++ b/c-api/mapping.po @@ -1,25 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 +# Rafael Fontenelle , 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-08-09 16:36+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -29,11 +30,11 @@ msgstr "Protocolo de mapeamento" #: ../../c-api/mapping.rst:8 msgid "" -"See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and :c:func:" -"`PyObject_DelItem`." +"See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` " +"and :c:func:`PyObject_DelItem`." msgstr "" -"Veja também :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` e :c:func:" -"`PyObject_DelItem`." +"Veja também :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` " +"e :c:func:`PyObject_DelItem`." #: ../../c-api/mapping.rst:14 msgid "" @@ -59,13 +60,13 @@ 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*`." +"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*`." msgstr "" "É o mesmo que :c:func:`PyObject_GetItem`, mas *key* é especificada como uma " -"string de bytes :c:expr:`const char*` codificada em UTF-8, em vez de um :c:" -"expr:`PyObject*`." +"string de bytes :c:expr:`const char*` codificada em UTF-8, em vez de " +"um :c:expr:`PyObject*`." #: ../../c-api/mapping.rst:38 msgid "" @@ -83,10 +84,10 @@ msgid "" "error other than :exc:`KeyError` is raised, return ``-1`` and set " "*\\*result* to ``NULL``." msgstr "" -"Se a chave for encontrada, retorna ``1`` e define *\\*result* como uma nova :" -"term:`referência forte` para o valor correspondente. Se a chave não for " -"encontrada, retorna ``0`` e define *\\*result* como ``NULL``; o :exc:" -"`KeyError` é silenciado. Se um erro diferente de :exc:`KeyError` for " +"Se a chave for encontrada, retorna ``1`` e define *\\*result* como uma " +"nova :term:`referência forte` para o valor correspondente. Se a chave não " +"for encontrada, retorna ``0`` e define *\\*result* como ``NULL``; " +"o :exc:`KeyError` é silenciado. Se um erro diferente de :exc:`KeyError` for " "levanta, retorna ``-1`` e define *\\*result* como ``NULL``." #: ../../c-api/mapping.rst:53 @@ -101,13 +102,13 @@ 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*`." +"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 "" "É o mesmo que :c:func:`PyObject_SetItem`, mas *key* é especificada como uma " -"string de bytes :c:expr:`const char*` codificada em UTF-8, em vez de um :c:" -"expr:`PyObject*`." +"string de bytes :c:expr:`const char*` codificada em UTF-8, em vez de " +"um :c:expr:`PyObject*`." #: ../../c-api/mapping.rst:69 msgid "This is an alias of :c:func:`PyObject_DelItem`." @@ -115,13 +116,13 @@ msgstr "Este é um apelido de :c:func:`PyObject_DelItem`." #: ../../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*`." +"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 "" "É o mesmo que :c:func:`PyObject_DelItem`, mas *key* é especificada como uma " -"string de bytes :c:expr:`const char*` codificada em UTF-8, em vez de um :c:" -"expr:`PyObject*`." +"string de bytes :c:expr:`const char*` codificada em UTF-8, em vez de " +"um :c:expr:`PyObject*`." #: ../../c-api/mapping.rst:81 msgid "" @@ -155,38 +156,40 @@ msgstr "" #: ../../c-api/mapping.rst:105 msgid "" -"Exceptions which occur when this calls :meth:`~object.__getitem__` method " -"are silently ignored. For proper error handling, use :c:func:" -"`PyMapping_HasKeyWithError`, :c:func:`PyMapping_GetOptionalItem` or :c:func:" -"`PyObject_GetItem()` instead." +"Exceptions which occur when this calls the :meth:`~object.__getitem__` " +"method are silently ignored. For proper error handling, " +"use :c:func:`PyMapping_HasKeyWithError`, :c:func:`PyMapping_GetOptionalItem` " +"or :c:func:`PyObject_GetItem()` instead." msgstr "" -"As exceções que ocorrem quando esse método chama :meth:`~object.__getitem__` " -"são silenciosamente ignoradas. Para o tratamento adequado de erros, use :c:" -"func:`PyMapping_HasKeyWithError`, :c:func:`PyMapping_GetOptionalItem` ou :c:" -"func:`PyObject_GetItem()` em vez disso." +"As exceções que ocorrem quando este construtor chama o " +"método :meth:`~object.__getitem__` são silenciosamente ignoradas. Para o " +"tratamento adequado de erros, " +"use :c:func:`PyMapping_HasKeyWithError`, :c:func:`PyMapping_GetOptionalItem` " +"ou :c:func:`PyObject_GetItem()` em vez disso." #: ../../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*`." +"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 "" "É o mesmo que :c:func:`PyMapping_HasKey`, mas *key* é especificada como uma " -"string de bytes :c:expr:`const char*` codificada em UTF-8, em vez de um :c:" -"expr:`PyObject*`." +"string de bytes :c:expr:`const char*` codificada em UTF-8, em vez de " +"um :c:expr:`PyObject*`." #: ../../c-api/mapping.rst:119 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." -msgstr "" -"As exceções que ocorrem quando esse método chama :meth:`~object.__getitem__` " -"ou ao criar o objeto temporário :class:`str` são silenciosamente ignoradas. " -"Para o tratamento adequado de erros, use :c:func:" -"`PyMapping_HasKeyStringWithError`, :c:func:`PyMapping_GetOptionalItemString` " +"Exceptions that occur when this calls the :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." +msgstr "" +"As exceções que ocorrem quando este construtor chama o " +"método :meth:`~object.__getitem__` ou ao criar o objeto " +"temporário :class:`str` são silenciosamente ignoradas. Para o tratamento " +"adequado de erros, " +"use :c:func:`PyMapping_HasKeyStringWithError`, :c:func:`PyMapping_GetOptionalItemString` " "ou :c:func:`PyMapping_GetItemString` em vez disso." #: ../../c-api/mapping.rst:129 diff --git a/c-api/marshal.po b/c-api/marshal.po index 48ff06ffb..79673d8c8 100644 --- a/c-api/marshal.po +++ b/c-api/marshal.po @@ -1,25 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 +# Rafael Fontenelle , 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-29 04:06+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -72,11 +73,11 @@ msgstr "" #: ../../c-api/marshal.rst:28 ../../c-api/marshal.rst:36 msgid "" -"This function can fail, in which case it sets the error indicator. Use :c:" -"func:`PyErr_Occurred` to check for that." +"This function can fail, in which case it sets the error indicator. " +"Use :c:func:`PyErr_Occurred` to check for that." msgstr "" -"Esta função pode falhar, caso em que define o indicador de erro. Use :c:func:" -"`PyErr_Occurred` para verificar isso." +"Esta função pode falhar, caso em que define o indicador de erro. " +"Use :c:func:`PyErr_Occurred` para verificar isso." #: ../../c-api/marshal.rst:33 msgid "" @@ -142,8 +143,8 @@ msgid "" "On error, sets the appropriate exception (:exc:`EOFError`, :exc:`ValueError` " "or :exc:`TypeError`) and returns ``NULL``." msgstr "" -"Em caso de erro, define a exceção apropriada (:exc:`EOFError`, :exc:" -"`ValueError` ou :exc:`TypeError`) e retorna ``NULL``." +"Em caso de erro, define a exceção apropriada " +"(:exc:`EOFError`, :exc:`ValueError` ou :exc:`TypeError`) e retorna ``NULL``." #: ../../c-api/marshal.rst:79 msgid "" @@ -152,7 +153,7 @@ msgid "" "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 " "operate from data in memory rather than reading a byte at a time from the " -"file. Only use these variant if you are certain that you won't be reading " +"file. Only use this variant if you are certain that you won't be reading " "anything else from the file." msgstr "" "Retorna um objeto Python do fluxo de dados em um :c:expr:`FILE*` aberto para " @@ -160,7 +161,7 @@ msgstr "" "função presume que nenhum objeto adicional será lido do arquivo, permitindo " "que ela carregue agressivamente os dados do arquivo na memória, para que a " "desserialização possa operar a partir de dados na memória em vez de ler um " -"byte por vez do arquivo. Use essas variantes apenas se tiver certeza de que " +"byte por vez do arquivo. Use essa variante apenas se tiver certeza de que " "não estará lendo mais nada do arquivo." #: ../../c-api/marshal.rst:93 diff --git a/c-api/memory.po b/c-api/memory.po index 6110fa5b4..1c834a707 100644 --- a/c-api/memory.po +++ b/c-api/memory.po @@ -1,31 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Raphael Mendonça, 2021 -# Marco Rougeth , 2021 -# Welington Carlos , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Rodrigo Cândido, 2022 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2026 +# python-doc bot, 2026 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-11 02:33+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2026-10-13 21:57+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: python-doc bot, 2026\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -45,6 +40,12 @@ msgid "" "different components which deal with various dynamic storage management " "aspects, like sharing, segmentation, preallocation or caching." msgstr "" +"O gerenciamento de memória em Python envolve um heap privado contendo todos " +"os objetos e estruturas de dados Python. O gerenciamento desse heap privado " +"é garantido internamente pelo *gerenciador de memória do Python*. O " +"gerenciador de memória do Python possui diferentes componentes que lidam com " +"diversos aspectos dinâmicos do gerenciamento de armazenamento, como " +"compartilhamento, segmentação, pré-alocação ou cache." #: ../../c-api/memory.rst:25 msgid "" @@ -59,6 +60,18 @@ msgid "" "manager thus delegates some of the work to the object-specific allocators, " "but ensures that the latter operate within the bounds of the private heap." msgstr "" +"No nível mais baixo, um alocador de memória bruta garante que haja espaço " +"suficiente no heap privado para armazenar todos os dados relacionados ao " +"Python, interagindo com o gerenciador de memória do sistema operacional. " +"Além do alocador de memória bruta, vários alocadores específicos de objeto " +"operam no mesmo heap e implementam políticas distintas de gerenciamento de " +"memória, adaptadas às peculiaridades de cada tipo de objeto. Por exemplo, " +"objetos inteiros são gerenciados dentro do heap de forma diferente de " +"strings, tuplas ou dicionários, pois inteiros implicam diferentes requisitos " +"de armazenamento e compensações entre velocidade e espaço. O gerenciador de " +"memória do Python, portanto, delega parte do trabalho aos alocadores " +"específicos de objeto, mas garante que estes operem dentro dos limites do " +"heap privado." #: ../../c-api/memory.rst:36 msgid "" @@ -73,13 +86,27 @@ msgstr "" #: ../../c-api/memory.rst:49 msgid "" "To avoid memory corruption, extension writers should never try to operate on " -"Python objects with the functions exported by the C library: :c:func:" -"`malloc`, :c:func:`calloc`, :c:func:`realloc` and :c:func:`free`. This will " -"result in mixed calls between the C allocator and the Python memory manager " -"with fatal consequences, because they implement different algorithms and " -"operate on different heaps. However, one may safely allocate and release " -"memory blocks with the C library allocator for individual purposes, as shown " -"in the following example::" +"Python objects with the functions exported by the C " +"library: :c:func:`malloc`, :c:func:`calloc`, :c:func:`realloc` " +"and :c:func:`free`. This will result in mixed calls between the C " +"allocator and the Python memory manager with fatal consequences, because " +"they implement different algorithms and operate on different heaps. " +"However, one may safely allocate and release memory blocks with the C " +"library allocator for individual purposes, as shown in the following " +"example::" +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 @@ -103,8 +130,8 @@ msgid "" "certain circumstances, the Python memory manager may or may not trigger " "appropriate actions, like garbage collection, memory compaction or other " "preventive procedures. Note that by using the C library allocator as shown " -"in the previous example, the allocated memory for the I/O buffer escapes " -"completely the Python memory manager." +"in the previous example, the allocated memory for the I/O buffer completely " +"escapes the Python memory manager." msgstr "" #: ../../c-api/memory.rst:88 @@ -131,60 +158,71 @@ msgid "" "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 `. There is no hard requirement to use the memory returned by the " -"allocation functions belonging to a given domain for only the purposes " -"hinted by that domain (although this is the recommended practice). For " -"example, one could use the memory returned by :c:func:`PyMem_RawMalloc` for " -"allocating Python objects or the memory returned by :c:func:" -"`PyObject_Malloc` for allocating memory for buffers." +"purposes a simplified table can be found at :ref:`default-memory-" +"allocators`. The APIs used to allocate and free a block of memory must be " +"from the same domain. For example, :c:func:`PyMem_Free` must be used to free " +"memory allocated using :c:func:`PyMem_Malloc`." msgstr "" -#: ../../c-api/memory.rst:112 +#: ../../c-api/memory.rst:109 msgid "The three allocation domains are:" msgstr "" -#: ../../c-api/memory.rst:114 +#: ../../c-api/memory.rst:111 msgid "" "Raw domain: intended for allocating memory for general-purpose memory " "buffers where the allocation *must* go to the system allocator or where the " "allocator can operate without the :term:`GIL`. The memory is requested " -"directly to the system." +"directly from the system. See :ref:`Raw Memory Interface `." msgstr "" -#: ../../c-api/memory.rst:119 +#: ../../c-api/memory.rst:116 msgid "" "\"Mem\" domain: intended for allocating memory for Python buffers and " "general-purpose memory buffers where the allocation must be performed with " -"the :term:`GIL` held. The memory is taken from the Python private heap." +"the :term:`GIL` held. The memory is taken from the Python private heap. " +"See :ref:`Memory Interface `." msgstr "" -#: ../../c-api/memory.rst:123 +#: ../../c-api/memory.rst:121 msgid "" -"Object domain: intended for allocating memory belonging to Python objects. " -"The memory is taken from the Python private heap." +"Object domain: intended for allocating memory for Python objects. The memory " +"is taken from the Python private heap. See :ref:`Object allocators " +"`." msgstr "" #: ../../c-api/memory.rst:126 msgid "" -"When freeing memory previously allocated by the allocating functions " -"belonging to a given domain,the matching specific deallocating functions " -"must be used. For example, :c:func:`PyMem_Free` must be used to free memory " -"allocated using :c:func:`PyMem_Malloc`." +"The :term:`free-threaded ` build requires that only Python " +"objects are allocated using the \"object\" domain and that all Python " +"objects are allocated using that domain. This differs from the prior Python " +"versions, where this was only a best practice and not a hard requirement." msgstr "" -#: ../../c-api/memory.rst:131 -msgid "Raw Memory Interface" +#: ../../c-api/memory.rst:130 +msgid "" +"For example, buffers (non-Python objects) should be allocated " +"using :c:func:`PyMem_Malloc`, :c:func:`PyMem_RawMalloc`, " +"or :c:func:`malloc`, but not :c:func:`PyObject_Malloc`." msgstr "" #: ../../c-api/memory.rst:133 +msgid "See :ref:`Memory Allocation APIs `." +msgstr "" + +#: ../../c-api/memory.rst:139 +msgid "Raw Memory Interface" +msgstr "" + +#: ../../c-api/memory.rst:141 msgid "" "The following function sets are wrappers to the system allocator. These " "functions are thread-safe, the :term:`GIL ` does " "not need to be held." msgstr "" -#: ../../c-api/memory.rst:137 +#: ../../c-api/memory.rst:145 msgid "" "The :ref:`default raw memory allocator ` uses the " "following functions: :c:func:`malloc`, :c:func:`calloc`, :c:func:`realloc` " @@ -192,158 +230,158 @@ msgid "" "requesting zero bytes." msgstr "" -#: ../../c-api/memory.rst:146 ../../c-api/memory.rst:217 -#: ../../c-api/memory.rst:325 +#: ../../c-api/memory.rst:154 ../../c-api/memory.rst:225 +#: ../../c-api/memory.rst:357 msgid "" "Allocates *n* bytes and returns a pointer of type :c:expr:`void*` to the " "allocated memory, or ``NULL`` if the request fails." msgstr "" -#: ../../c-api/memory.rst:149 +#: ../../c-api/memory.rst:157 msgid "" "Requesting zero bytes returns a distinct non-``NULL`` pointer if possible, " "as if ``PyMem_RawMalloc(1)`` had been called instead. The memory will not " "have been initialized in any way." msgstr "" -#: ../../c-api/memory.rst:156 ../../c-api/memory.rst:227 -#: ../../c-api/memory.rst:335 +#: ../../c-api/memory.rst:164 ../../c-api/memory.rst:235 +#: ../../c-api/memory.rst:367 msgid "" -"Allocates *nelem* elements each whose size in bytes is *elsize* and returns " -"a pointer of type :c:expr:`void*` to the allocated memory, or ``NULL`` if " -"the request fails. The memory is initialized to zeros." +"Allocates *nelem* elements each of size *elsize* bytes and returns a pointer " +"of type :c:expr:`void*` to the allocated memory, or ``NULL`` if the request " +"fails. The memory is initialized to zeros." msgstr "" -#: ../../c-api/memory.rst:160 +#: ../../c-api/memory.rst:168 msgid "" "Requesting zero elements or elements of size zero bytes returns a distinct " "non-``NULL`` pointer if possible, as if ``PyMem_RawCalloc(1, 1)`` had been " "called instead." msgstr "" -#: ../../c-api/memory.rst:169 ../../c-api/memory.rst:240 -#: ../../c-api/memory.rst:348 +#: ../../c-api/memory.rst:177 ../../c-api/memory.rst:248 +#: ../../c-api/memory.rst:380 msgid "" "Resizes the memory block pointed to by *p* to *n* bytes. The contents will " "be unchanged to the minimum of the old and the new sizes." msgstr "" -#: ../../c-api/memory.rst:172 +#: ../../c-api/memory.rst:180 msgid "" "If *p* is ``NULL``, the call is equivalent to ``PyMem_RawMalloc(n)``; else " "if *n* is equal to zero, the memory block is resized but is not freed, and " "the returned pointer is non-``NULL``." msgstr "" -#: ../../c-api/memory.rst:176 +#: ../../c-api/memory.rst:184 msgid "" -"Unless *p* is ``NULL``, it must have been returned by a previous call to :c:" -"func:`PyMem_RawMalloc`, :c:func:`PyMem_RawRealloc` or :c:func:" -"`PyMem_RawCalloc`." +"Unless *p* is ``NULL``, it must have been returned by a previous call " +"to :c:func:`PyMem_RawMalloc`, :c:func:`PyMem_RawRealloc` " +"or :c:func:`PyMem_RawCalloc`." msgstr "" -#: ../../c-api/memory.rst:180 +#: ../../c-api/memory.rst:188 msgid "" "If the request fails, :c:func:`PyMem_RawRealloc` returns ``NULL`` and *p* " "remains a valid pointer to the previous memory area." msgstr "" -#: ../../c-api/memory.rst:186 +#: ../../c-api/memory.rst:194 msgid "" "Frees the memory block pointed to by *p*, which must have been returned by a " -"previous call to :c:func:`PyMem_RawMalloc`, :c:func:`PyMem_RawRealloc` or :c:" -"func:`PyMem_RawCalloc`. Otherwise, or if ``PyMem_RawFree(p)`` has been " -"called before, undefined behavior occurs." +"previous call to :c:func:`PyMem_RawMalloc`, :c:func:`PyMem_RawRealloc` " +"or :c:func:`PyMem_RawCalloc`. Otherwise, or if ``PyMem_RawFree(p)`` has " +"been called before, undefined behavior occurs." msgstr "" -#: ../../c-api/memory.rst:191 ../../c-api/memory.rst:261 -#: ../../c-api/memory.rst:369 +#: ../../c-api/memory.rst:199 ../../c-api/memory.rst:269 +#: ../../c-api/memory.rst:401 msgid "If *p* is ``NULL``, no operation is performed." msgstr "" -#: ../../c-api/memory.rst:197 +#: ../../c-api/memory.rst:205 msgid "Memory Interface" msgstr "Interface da Memória" -#: ../../c-api/memory.rst:199 ../../c-api/memory.rst:305 +#: ../../c-api/memory.rst:207 ../../c-api/memory.rst:337 msgid "" "The following function sets, modeled after the ANSI C standard, but " "specifying behavior when requesting zero bytes, are available for allocating " "and releasing memory from the Python heap." msgstr "" -#: ../../c-api/memory.rst:203 +#: ../../c-api/memory.rst:211 msgid "" -"The :ref:`default memory allocator ` uses the :" -"ref:`pymalloc memory allocator `." +"The :ref:`default memory allocator ` uses " +"the :ref:`pymalloc memory allocator `." msgstr "" -#: ../../c-api/memory.rst:208 ../../c-api/memory.rst:320 +#: ../../c-api/memory.rst:216 ../../c-api/memory.rst:352 msgid "" "The :term:`GIL ` must be held when using these " "functions." msgstr "" -#: ../../c-api/memory.rst:213 +#: ../../c-api/memory.rst:221 msgid "" "The default allocator is now pymalloc instead of system :c:func:`malloc`." msgstr "" -#: ../../c-api/memory.rst:220 +#: ../../c-api/memory.rst:228 msgid "" "Requesting zero bytes returns a distinct non-``NULL`` pointer if possible, " "as if ``PyMem_Malloc(1)`` had been called instead. The memory will not have " "been initialized in any way." msgstr "" -#: ../../c-api/memory.rst:231 +#: ../../c-api/memory.rst:239 msgid "" "Requesting zero elements or elements of size zero bytes returns a distinct " "non-``NULL`` pointer if possible, as if ``PyMem_Calloc(1, 1)`` had been " "called instead." msgstr "" -#: ../../c-api/memory.rst:243 +#: ../../c-api/memory.rst:251 msgid "" "If *p* is ``NULL``, the call is equivalent to ``PyMem_Malloc(n)``; else if " "*n* is equal to zero, the memory block is resized but is not freed, and the " "returned pointer is non-``NULL``." msgstr "" -#: ../../c-api/memory.rst:247 +#: ../../c-api/memory.rst:255 msgid "" -"Unless *p* is ``NULL``, it must have been returned by a previous call to :c:" -"func:`PyMem_Malloc`, :c:func:`PyMem_Realloc` or :c:func:`PyMem_Calloc`." +"Unless *p* is ``NULL``, it must have been returned by a previous call " +"to :c:func:`PyMem_Malloc`, :c:func:`PyMem_Realloc` or :c:func:`PyMem_Calloc`." msgstr "" -#: ../../c-api/memory.rst:250 +#: ../../c-api/memory.rst:258 msgid "" "If the request fails, :c:func:`PyMem_Realloc` returns ``NULL`` and *p* " "remains a valid pointer to the previous memory area." msgstr "" -#: ../../c-api/memory.rst:256 +#: ../../c-api/memory.rst:264 msgid "" "Frees the memory block pointed to by *p*, which must have been returned by a " -"previous call to :c:func:`PyMem_Malloc`, :c:func:`PyMem_Realloc` or :c:func:" -"`PyMem_Calloc`. Otherwise, or if ``PyMem_Free(p)`` has been called before, " -"undefined behavior occurs." +"previous call to :c:func:`PyMem_Malloc`, :c:func:`PyMem_Realloc` " +"or :c:func:`PyMem_Calloc`. Otherwise, or if ``PyMem_Free(p)`` has been " +"called before, undefined behavior occurs." msgstr "" -#: ../../c-api/memory.rst:263 +#: ../../c-api/memory.rst:271 msgid "" "The following type-oriented macros are provided for convenience. Note that " "*TYPE* refers to any C type." msgstr "" -#: ../../c-api/memory.rst:269 +#: ../../c-api/memory.rst:277 msgid "" "Same as :c:func:`PyMem_Malloc`, but allocates ``(n * sizeof(TYPE))`` bytes " "of memory. Returns a pointer cast to ``TYPE*``. The memory will not have " "been initialized in any way." msgstr "" -#: ../../c-api/memory.rst:276 +#: ../../c-api/memory.rst:284 msgid "" "Same as :c:func:`PyMem_Realloc`, but the memory block is resized to ``(n * " "sizeof(TYPE))`` bytes. Returns a pointer cast to ``TYPE*``. On return, *p* " @@ -351,53 +389,70 @@ msgid "" "failure." msgstr "" -#: ../../c-api/memory.rst:281 +#: ../../c-api/memory.rst:289 msgid "" "This is a C preprocessor macro; *p* is always reassigned. Save the original " "value of *p* to avoid losing memory when handling errors." msgstr "" -#: ../../c-api/memory.rst:287 +#: ../../c-api/memory.rst:295 msgid "Same as :c:func:`PyMem_Free`." msgstr "" -#: ../../c-api/memory.rst:289 +#: ../../c-api/memory.rst:299 +msgid "Deprecated aliases" +msgstr "Apelidos descontinuados" + +#: ../../c-api/memory.rst:301 msgid "" -"In addition, the following macro sets are provided for calling the Python " -"memory allocator directly, without involving the C API functions listed " -"above. However, note that their use does not preserve binary compatibility " -"across Python versions and is therefore deprecated in extension modules." +"These are :term:`soft deprecated` aliases to existing functions and macros. " +"They exist solely for backwards compatibility." msgstr "" +"Esses são apelidos :term:`suavemente descontinuados ` para funções e macros existentes. Eles existem unicamente " +"para fins de retrocompatibilidade." -#: ../../c-api/memory.rst:294 -msgid "``PyMem_MALLOC(size)``" -msgstr "``PyMem_MALLOC(size)``" +#: ../../c-api/memory.rst:308 +msgid "Deprecated alias" +msgstr "Apelido descontinuado" -#: ../../c-api/memory.rst:295 -msgid "``PyMem_NEW(type, size)``" -msgstr "``PyMem_NEW(type, size)``" +#: ../../c-api/memory.rst:309 +msgid "Corresponding function or macro" +msgstr "" -#: ../../c-api/memory.rst:296 -msgid "``PyMem_REALLOC(ptr, size)``" -msgstr "``PyMem_REALLOC(ptr, size)``" +#: ../../c-api/memory.rst:311 +msgid ":c:func:`PyMem_Malloc`" +msgstr "" -#: ../../c-api/memory.rst:297 -msgid "``PyMem_RESIZE(ptr, type, size)``" +#: ../../c-api/memory.rst:313 +msgid ":c:macro:`PyMem_New`" msgstr "" -#: ../../c-api/memory.rst:298 -msgid "``PyMem_FREE(ptr)``" -msgstr "``PyMem_FREE(ptr)``" +#: ../../c-api/memory.rst:315 ../../c-api/memory.rst:484 +msgid ":c:func:`PyMem_Realloc`" +msgstr ":c:func:`PyMem_Realloc`" -#: ../../c-api/memory.rst:299 -msgid "``PyMem_DEL(ptr)``" -msgstr "``PyMem_DEL(ptr)``" +#: ../../c-api/memory.rst:317 +msgid ":c:macro:`PyMem_Resize`" +msgstr "" -#: ../../c-api/memory.rst:303 +#: ../../c-api/memory.rst:319 ../../c-api/memory.rst:321 +#: ../../c-api/memory.rst:486 +msgid ":c:func:`PyMem_Free`" +msgstr ":c:func:`PyMem_Free`" + +#: ../../c-api/memory.rst:325 +msgid "" +"The macros are now aliases of the corresponding functions and macros. " +"Previously, their behavior was the same, but their use did not necessarily " +"preserve binary compatibility across Python versions." +msgstr "" + +#: ../../c-api/memory.rst:335 msgid "Object allocators" msgstr "Alocadores de objeto" -#: ../../c-api/memory.rst:310 +#: ../../c-api/memory.rst:342 msgid "" "There is no guarantee that the memory returned by these allocators can be " "successfully cast to a Python object when intercepting the allocating " @@ -405,383 +460,376 @@ msgid "" "Memory Allocators ` section." msgstr "" -#: ../../c-api/memory.rst:315 +#: ../../c-api/memory.rst:347 msgid "" -"The :ref:`default object allocator ` uses the :" -"ref:`pymalloc memory allocator `." +"The :ref:`default object allocator ` uses " +"the :ref:`pymalloc memory allocator `." msgstr "" -#: ../../c-api/memory.rst:328 +#: ../../c-api/memory.rst:360 msgid "" "Requesting zero bytes returns a distinct non-``NULL`` pointer if possible, " "as if ``PyObject_Malloc(1)`` had been called instead. The memory will not " "have been initialized in any way." msgstr "" -#: ../../c-api/memory.rst:339 +#: ../../c-api/memory.rst:371 msgid "" "Requesting zero elements or elements of size zero bytes returns a distinct " "non-``NULL`` pointer if possible, as if ``PyObject_Calloc(1, 1)`` had been " "called instead." msgstr "" -#: ../../c-api/memory.rst:351 +#: ../../c-api/memory.rst:383 msgid "" "If *p* is ``NULL``, the call is equivalent to ``PyObject_Malloc(n)``; else " "if *n* is equal to zero, the memory block is resized but is not freed, and " "the returned pointer is non-``NULL``." msgstr "" -#: ../../c-api/memory.rst:355 +#: ../../c-api/memory.rst:387 msgid "" -"Unless *p* is ``NULL``, it must have been returned by a previous call to :c:" -"func:`PyObject_Malloc`, :c:func:`PyObject_Realloc` or :c:func:" -"`PyObject_Calloc`." +"Unless *p* is ``NULL``, it must have been returned by a previous call " +"to :c:func:`PyObject_Malloc`, :c:func:`PyObject_Realloc` " +"or :c:func:`PyObject_Calloc`." msgstr "" -#: ../../c-api/memory.rst:358 +#: ../../c-api/memory.rst:390 msgid "" "If the request fails, :c:func:`PyObject_Realloc` returns ``NULL`` and *p* " "remains a valid pointer to the previous memory area." msgstr "" -#: ../../c-api/memory.rst:364 +#: ../../c-api/memory.rst:396 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:" -"func:`PyObject_Calloc`. Otherwise, or if ``PyObject_Free(p)`` has been " -"called before, undefined behavior occurs." +"previous call to :c:func:`PyObject_Malloc`, :c:func:`PyObject_Realloc` " +"or :c:func:`PyObject_Calloc`. Otherwise, or if ``PyObject_Free(p)`` has " +"been called before, undefined behavior occurs." msgstr "" -#: ../../c-api/memory.rst:375 +#: ../../c-api/memory.rst:407 msgid "Default Memory Allocators" msgstr "Alocadores de memória padrão" -#: ../../c-api/memory.rst:377 +#: ../../c-api/memory.rst:409 msgid "Default memory allocators:" msgstr "Alocadores de memória padrão:" -#: ../../c-api/memory.rst:380 +#: ../../c-api/memory.rst:412 msgid "Configuration" msgstr "Configuração" -#: ../../c-api/memory.rst:380 +#: ../../c-api/memory.rst:412 msgid "Name" msgstr "Nome" -#: ../../c-api/memory.rst:380 +#: ../../c-api/memory.rst:412 msgid "PyMem_RawMalloc" msgstr "PyMem_RawMalloc" -#: ../../c-api/memory.rst:380 +#: ../../c-api/memory.rst:412 msgid "PyMem_Malloc" msgstr "PyMem_Malloc" -#: ../../c-api/memory.rst:380 +#: ../../c-api/memory.rst:412 msgid "PyObject_Malloc" msgstr "PyObject_Malloc" -#: ../../c-api/memory.rst:382 +#: ../../c-api/memory.rst:414 msgid "Release build" msgstr "" -#: ../../c-api/memory.rst:382 +#: ../../c-api/memory.rst:414 msgid "``\"pymalloc\"``" msgstr "``\"pymalloc\"``" -#: ../../c-api/memory.rst:382 ../../c-api/memory.rst:384 +#: ../../c-api/memory.rst:414 ../../c-api/memory.rst:416 msgid "``malloc``" msgstr "``malloc``" -#: ../../c-api/memory.rst:382 +#: ../../c-api/memory.rst:414 msgid "``pymalloc``" msgstr "``pymalloc``" -#: ../../c-api/memory.rst:383 +#: ../../c-api/memory.rst:415 msgid "Debug build" msgstr "" -#: ../../c-api/memory.rst:383 +#: ../../c-api/memory.rst:415 msgid "``\"pymalloc_debug\"``" msgstr "``\"pymalloc_debug\"``" -#: ../../c-api/memory.rst:383 ../../c-api/memory.rst:385 +#: ../../c-api/memory.rst:415 ../../c-api/memory.rst:417 msgid "``malloc`` + debug" msgstr "" -#: ../../c-api/memory.rst:383 +#: ../../c-api/memory.rst:415 msgid "``pymalloc`` + debug" msgstr "" -#: ../../c-api/memory.rst:384 +#: ../../c-api/memory.rst:416 msgid "Release build, without pymalloc" msgstr "" -#: ../../c-api/memory.rst:384 +#: ../../c-api/memory.rst:416 msgid "``\"malloc\"``" msgstr "``\"malloc\"``" -#: ../../c-api/memory.rst:385 +#: ../../c-api/memory.rst:417 msgid "Debug build, without pymalloc" msgstr "" -#: ../../c-api/memory.rst:385 +#: ../../c-api/memory.rst:417 msgid "``\"malloc_debug\"``" msgstr "``\"malloc_debug\"``" -#: ../../c-api/memory.rst:388 +#: ../../c-api/memory.rst:420 msgid "Legend:" -msgstr "" +msgstr "Legenda:" -#: ../../c-api/memory.rst:390 +#: ../../c-api/memory.rst:422 msgid "Name: value for :envvar:`PYTHONMALLOC` environment variable." msgstr "" -#: ../../c-api/memory.rst:391 +#: ../../c-api/memory.rst:423 msgid "" -"``malloc``: system allocators from the standard C library, C functions: :c:" -"func:`malloc`, :c:func:`calloc`, :c:func:`realloc` and :c:func:`free`." +"``malloc``: system allocators from the standard C library, C " +"functions: :c:func:`malloc`, :c:func:`calloc`, :c:func:`realloc` " +"and :c:func:`free`." msgstr "" -#: ../../c-api/memory.rst:393 +#: ../../c-api/memory.rst:425 msgid "``pymalloc``: :ref:`pymalloc memory allocator `." msgstr "" -#: ../../c-api/memory.rst:394 +#: ../../c-api/memory.rst:426 msgid "" "``mimalloc``: :ref:`mimalloc memory allocator `. The pymalloc " "allocator will be used if mimalloc support isn't available." msgstr "" -#: ../../c-api/memory.rst:396 +#: ../../c-api/memory.rst:428 msgid "" "\"+ debug\": with :ref:`debug hooks on the Python memory allocators `." msgstr "" -#: ../../c-api/memory.rst:398 +#: ../../c-api/memory.rst:430 msgid "\"Debug build\": :ref:`Python build in debug mode `." msgstr "" -#: ../../c-api/memory.rst:403 +#: ../../c-api/memory.rst:435 msgid "Customize Memory Allocators" msgstr "Alocadores de memória" -#: ../../c-api/memory.rst:409 +#: ../../c-api/memory.rst:441 msgid "" "Structure used to describe a memory block allocator. The structure has the " "following fields:" msgstr "" -#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:660 +#: ../../c-api/memory.rst:445 ../../c-api/memory.rst:696 msgid "Field" msgstr "Campo" -#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:660 +#: ../../c-api/memory.rst:445 ../../c-api/memory.rst:696 msgid "Meaning" msgstr "Significado" -#: ../../c-api/memory.rst:415 ../../c-api/memory.rst:662 +#: ../../c-api/memory.rst:447 ../../c-api/memory.rst:698 msgid "``void *ctx``" msgstr "``void *ctx``" -#: ../../c-api/memory.rst:415 ../../c-api/memory.rst:662 +#: ../../c-api/memory.rst:447 ../../c-api/memory.rst:698 msgid "user context passed as first argument" msgstr "" -#: ../../c-api/memory.rst:417 +#: ../../c-api/memory.rst:449 msgid "``void* malloc(void *ctx, size_t size)``" msgstr "``void* malloc(void *ctx, size_t size)``" -#: ../../c-api/memory.rst:417 +#: ../../c-api/memory.rst:449 msgid "allocate a memory block" msgstr "" -#: ../../c-api/memory.rst:419 +#: ../../c-api/memory.rst:451 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:419 +#: ../../c-api/memory.rst:451 msgid "allocate a memory block initialized with zeros" msgstr "" -#: ../../c-api/memory.rst:422 +#: ../../c-api/memory.rst:454 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:422 +#: ../../c-api/memory.rst:454 msgid "allocate or resize a memory block" msgstr "" -#: ../../c-api/memory.rst:424 +#: ../../c-api/memory.rst:456 msgid "``void free(void *ctx, void *ptr)``" msgstr "``void free(void *ctx, void *ptr)``" -#: ../../c-api/memory.rst:424 +#: ../../c-api/memory.rst:456 msgid "free a memory block" msgstr "" -#: ../../c-api/memory.rst:427 +#: ../../c-api/memory.rst:459 msgid "" -"The :c:type:`!PyMemAllocator` structure was renamed to :c:type:" -"`PyMemAllocatorEx` and a new ``calloc`` field was added." +"The :c:type:`!PyMemAllocator` structure was renamed " +"to :c:type:`PyMemAllocatorEx` and a new ``calloc`` field was added." msgstr "" -#: ../../c-api/memory.rst:434 +#: ../../c-api/memory.rst:466 msgid "Enum used to identify an allocator domain. Domains:" msgstr "" -#: ../../c-api/memory.rst:440 ../../c-api/memory.rst:449 -#: ../../c-api/memory.rst:458 +#: ../../c-api/memory.rst:472 ../../c-api/memory.rst:481 +#: ../../c-api/memory.rst:490 msgid "Functions:" msgstr "Funções:" -#: ../../c-api/memory.rst:442 +#: ../../c-api/memory.rst:474 msgid ":c:func:`PyMem_RawMalloc`" msgstr ":c:func:`PyMem_RawMalloc`" -#: ../../c-api/memory.rst:443 +#: ../../c-api/memory.rst:475 msgid ":c:func:`PyMem_RawRealloc`" msgstr ":c:func:`PyMem_RawRealloc`" -#: ../../c-api/memory.rst:444 +#: ../../c-api/memory.rst:476 msgid ":c:func:`PyMem_RawCalloc`" msgstr ":c:func:`PyMem_RawCalloc`" -#: ../../c-api/memory.rst:445 +#: ../../c-api/memory.rst:477 msgid ":c:func:`PyMem_RawFree`" msgstr ":c:func:`PyMem_RawFree`" -#: ../../c-api/memory.rst:451 +#: ../../c-api/memory.rst:483 msgid ":c:func:`PyMem_Malloc`," msgstr ":c:func:`PyMem_Malloc`," -#: ../../c-api/memory.rst:452 -msgid ":c:func:`PyMem_Realloc`" -msgstr ":c:func:`PyMem_Realloc`" - -#: ../../c-api/memory.rst:453 +#: ../../c-api/memory.rst:485 msgid ":c:func:`PyMem_Calloc`" msgstr ":c:func:`PyMem_Calloc`" -#: ../../c-api/memory.rst:454 -msgid ":c:func:`PyMem_Free`" -msgstr ":c:func:`PyMem_Free`" - -#: ../../c-api/memory.rst:460 +#: ../../c-api/memory.rst:492 msgid ":c:func:`PyObject_Malloc`" msgstr ":c:func:`PyObject_Malloc`" -#: ../../c-api/memory.rst:461 +#: ../../c-api/memory.rst:493 msgid ":c:func:`PyObject_Realloc`" msgstr ":c:func:`PyObject_Realloc`" -#: ../../c-api/memory.rst:462 +#: ../../c-api/memory.rst:494 msgid ":c:func:`PyObject_Calloc`" msgstr ":c:func:`PyObject_Calloc`" -#: ../../c-api/memory.rst:463 +#: ../../c-api/memory.rst:495 msgid ":c:func:`PyObject_Free`" msgstr ":c:func:`PyObject_Free`" -#: ../../c-api/memory.rst:467 +#: ../../c-api/memory.rst:499 msgid "Get the memory block allocator of the specified domain." msgstr "" -#: ../../c-api/memory.rst:472 +#: ../../c-api/memory.rst:504 msgid "Set the memory block allocator of the specified domain." msgstr "" -#: ../../c-api/memory.rst:474 +#: ../../c-api/memory.rst:506 msgid "" "The new allocator must return a distinct non-``NULL`` pointer when " "requesting zero bytes." msgstr "" -#: ../../c-api/memory.rst:477 +#: ../../c-api/memory.rst:509 msgid "" "For the :c:macro:`PYMEM_DOMAIN_RAW` domain, the allocator must be thread-" "safe: the :term:`GIL ` is not held when the " "allocator is called." msgstr "" -#: ../../c-api/memory.rst:481 +#: ../../c-api/memory.rst:513 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 " "``GIL``." msgstr "" -#: ../../c-api/memory.rst:485 +#: ../../c-api/memory.rst:517 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 " "debug hooks on top on the new allocator." msgstr "" -#: ../../c-api/memory.rst:489 +#: ../../c-api/memory.rst:521 msgid "" "See also :c:member:`PyPreConfig.allocator` and :ref:`Preinitialize Python " "with PyPreConfig `." msgstr "" -#: ../../c-api/memory.rst:494 +#: ../../c-api/memory.rst:526 msgid ":c:func:`PyMem_SetAllocator` does have the following contract:" msgstr "" -#: ../../c-api/memory.rst:496 +#: ../../c-api/memory.rst:528 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 the GIL held). See :ref:`the section on allocator domains ` for more information." +"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 the GIL held). See :ref:`the section on " +"allocator domains ` for more information." msgstr "" -#: ../../c-api/memory.rst:504 +#: ../../c-api/memory.rst:536 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**." +"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:509 +#: ../../c-api/memory.rst:541 msgid "All allocators must be thread-safe." msgstr "" -#: ../../c-api/memory.rst:515 +#: ../../c-api/memory.rst:547 msgid "" "Setup :ref:`debug hooks in the Python memory allocators ` " "to detect memory errors." msgstr "" -#: ../../c-api/memory.rst:522 +#: ../../c-api/memory.rst:554 msgid "Debug hooks on the Python memory allocators" msgstr "" -#: ../../c-api/memory.rst:524 +#: ../../c-api/memory.rst:556 msgid "" -"When :ref:`Python is built in debug mode `, the :c:func:" -"`PyMem_SetupDebugHooks` function is called at the :ref:`Python " +"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:529 +#: ../../c-api/memory.rst:561 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:532 +#: ../../c-api/memory.rst:564 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:535 +#: ../../c-api/memory.rst:567 msgid "" "These debug hooks fill dynamically allocated memory blocks with special, " "recognizable bit patterns. Newly allocated memory is filled with the byte " @@ -791,25 +839,25 @@ msgid "" "these bytes are unlikely to be valid addresses, floats, or ASCII strings." msgstr "" -#: ../../c-api/memory.rst:542 +#: ../../c-api/memory.rst:574 msgid "Runtime checks:" msgstr "Checagens em Tempo de Execução:" -#: ../../c-api/memory.rst:544 +#: ../../c-api/memory.rst:576 msgid "" "Detect API violations. For example, detect if :c:func:`PyObject_Free` is " "called on a memory block allocated by :c:func:`PyMem_Malloc`." msgstr "" -#: ../../c-api/memory.rst:546 +#: ../../c-api/memory.rst:578 msgid "Detect write before the start of the buffer (buffer underflow)." msgstr "" -#: ../../c-api/memory.rst:547 +#: ../../c-api/memory.rst:579 msgid "Detect write after the end of the buffer (buffer overflow)." msgstr "" -#: ../../c-api/memory.rst:548 +#: ../../c-api/memory.rst:580 msgid "" "Check that the :term:`GIL ` is held when allocator " "functions of :c:macro:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) " @@ -817,7 +865,7 @@ msgid "" "called." msgstr "" -#: ../../c-api/memory.rst:553 +#: ../../c-api/memory.rst:585 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 " @@ -825,7 +873,7 @@ msgid "" "memory block was traced." msgstr "" -#: ../../c-api/memory.rst:558 +#: ../../c-api/memory.rst:590 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 " @@ -835,49 +883,49 @@ msgid "" "from a Python slice):" msgstr "" -#: ../../c-api/memory.rst:564 +#: ../../c-api/memory.rst:596 msgid "``p[-2*S:-S]``" msgstr "``p[-2*S:-S]``" -#: ../../c-api/memory.rst:565 +#: ../../c-api/memory.rst:597 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:567 +#: ../../c-api/memory.rst:599 msgid "``p[-S]``" msgstr "``p[-S]``" -#: ../../c-api/memory.rst:568 +#: ../../c-api/memory.rst:600 msgid "API identifier (ASCII character):" msgstr "" -#: ../../c-api/memory.rst:570 +#: ../../c-api/memory.rst:602 msgid "``'r'`` for :c:macro:`PYMEM_DOMAIN_RAW`." msgstr "" -#: ../../c-api/memory.rst:571 +#: ../../c-api/memory.rst:603 msgid "``'m'`` for :c:macro:`PYMEM_DOMAIN_MEM`." msgstr "" -#: ../../c-api/memory.rst:572 +#: ../../c-api/memory.rst:604 msgid "``'o'`` for :c:macro:`PYMEM_DOMAIN_OBJ`." msgstr "" -#: ../../c-api/memory.rst:574 +#: ../../c-api/memory.rst:606 msgid "``p[-S+1:0]``" msgstr "``p[-S+1:0]``" -#: ../../c-api/memory.rst:575 +#: ../../c-api/memory.rst:607 msgid "Copies of PYMEM_FORBIDDENBYTE. Used to catch under- writes and reads." msgstr "" -#: ../../c-api/memory.rst:577 +#: ../../c-api/memory.rst:609 msgid "``p[0:N]``" msgstr "``p[0:N]``" -#: ../../c-api/memory.rst:578 +#: ../../c-api/memory.rst:610 msgid "" "The requested memory, filled with copies of PYMEM_CLEANBYTE, used to catch " "reference to uninitialized memory. When a realloc-like function is called " @@ -888,25 +936,25 @@ msgid "" "bytes are also filled with PYMEM_DEADBYTE." msgstr "" -#: ../../c-api/memory.rst:586 +#: ../../c-api/memory.rst:618 msgid "``p[N:N+S]``" msgstr "``p[N:N+S]``" -#: ../../c-api/memory.rst:587 +#: ../../c-api/memory.rst:619 msgid "Copies of PYMEM_FORBIDDENBYTE. Used to catch over- writes and reads." msgstr "" -#: ../../c-api/memory.rst:589 +#: ../../c-api/memory.rst:621 msgid "``p[N+S:N+2*S]``" msgstr "``p[N+S:N+2*S]``" -#: ../../c-api/memory.rst:590 +#: ../../c-api/memory.rst:622 msgid "" "Only used if the ``PYMEM_DEBUG_SERIALNO`` macro is defined (not defined by " "default)." msgstr "" -#: ../../c-api/memory.rst:593 +#: ../../c-api/memory.rst:625 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 " @@ -916,7 +964,7 @@ msgid "" "number is incremented, and exists so you can set such a breakpoint easily." msgstr "" -#: ../../c-api/memory.rst:600 +#: ../../c-api/memory.rst:632 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, " @@ -929,16 +977,17 @@ msgid "" "getting used)." msgstr "" -#: ../../c-api/memory.rst:609 +#: ../../c-api/memory.rst:641 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 the GIL is held when functions of :c:macro:" -"`PYMEM_DOMAIN_OBJ` and :c:macro:`PYMEM_DOMAIN_MEM` domains are called." +"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:macro:`PYMEM_DOMAIN_OBJ` and :c:macro:`PYMEM_DOMAIN_MEM` domains are " +"called." msgstr "" -#: ../../c-api/memory.rst:617 +#: ../../c-api/memory.rst:649 msgid "" "Byte patterns ``0xCB`` (``PYMEM_CLEANBYTE``), ``0xDB`` (``PYMEM_DEADBYTE``) " "and ``0xFB`` (``PYMEM_FORBIDDENBYTE``) have been replaced with ``0xCD``, " @@ -946,88 +995,96 @@ msgid "" "``malloc()`` and ``free()``." msgstr "" -#: ../../c-api/memory.rst:627 +#: ../../c-api/memory.rst:659 msgid "The pymalloc allocator" msgstr "" -#: ../../c-api/memory.rst:629 +#: ../../c-api/memory.rst:661 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." +"on 64-bit platforms. It falls back to :c:func:`PyMem_RawMalloc` " +"and :c:func:`PyMem_RawRealloc` for allocations larger than 512 bytes." msgstr "" -#: ../../c-api/memory.rst:635 +#: ../../c-api/memory.rst:667 msgid "" "*pymalloc* is the :ref:`default allocator ` of " -"the :c:macro:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) and :c:macro:" -"`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) domains." +"the :c:macro:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) " +"and :c:macro:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) domains." msgstr "" -#: ../../c-api/memory.rst:639 +#: ../../c-api/memory.rst:671 msgid "The arena allocator uses the following functions:" msgstr "" -#: ../../c-api/memory.rst:641 +#: ../../c-api/memory.rst:673 msgid ":c:func:`!VirtualAlloc` and :c:func:`!VirtualFree` on Windows," msgstr "" -#: ../../c-api/memory.rst:642 +#: ../../c-api/memory.rst:674 msgid ":c:func:`!mmap` and :c:func:`!munmap` if available," msgstr "" -#: ../../c-api/memory.rst:643 +#: ../../c-api/memory.rst:675 msgid ":c:func:`malloc` and :c:func:`free` otherwise." msgstr ":c:func:`malloc` e :c:func:`free` do contrário." -#: ../../c-api/memory.rst:645 +#: ../../c-api/memory.rst:677 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``)." +"without-pymalloc` option. It can also be disabled at runtime using " +"the :envvar:`PYTHONMALLOC` environment variable (ex: " +"``PYTHONMALLOC=malloc``)." +msgstr "" + +#: ../../c-api/memory.rst:681 +msgid "" +"Typically, it makes sense to disable the pymalloc allocator when building " +"Python with AddressSanitizer (:option:`--with-address-sanitizer`) which " +"helps uncover low level bugs within the C code." msgstr "" -#: ../../c-api/memory.rst:650 +#: ../../c-api/memory.rst:686 msgid "Customize pymalloc Arena Allocator" msgstr "" -#: ../../c-api/memory.rst:656 +#: ../../c-api/memory.rst:692 msgid "" "Structure used to describe an arena allocator. The structure has three " "fields:" msgstr "" -#: ../../c-api/memory.rst:664 +#: ../../c-api/memory.rst:700 msgid "``void* alloc(void *ctx, size_t size)``" msgstr "``void* alloc(void *ctx, size_t size)``" -#: ../../c-api/memory.rst:664 +#: ../../c-api/memory.rst:700 msgid "allocate an arena of size bytes" msgstr "" -#: ../../c-api/memory.rst:666 +#: ../../c-api/memory.rst:702 msgid "``void free(void *ctx, void *ptr, size_t size)``" -msgstr "" +msgstr "``void free(void *ctx, void *ptr, size_t size)``" -#: ../../c-api/memory.rst:666 +#: ../../c-api/memory.rst:702 msgid "free an arena" msgstr "" -#: ../../c-api/memory.rst:671 +#: ../../c-api/memory.rst:707 msgid "Get the arena allocator." msgstr "" -#: ../../c-api/memory.rst:675 +#: ../../c-api/memory.rst:711 msgid "Set the arena allocator." msgstr "" -#: ../../c-api/memory.rst:680 +#: ../../c-api/memory.rst:716 msgid "The mimalloc allocator" msgstr "" -#: ../../c-api/memory.rst:684 +#: ../../c-api/memory.rst:720 msgid "" "Python supports the mimalloc allocator when the underlying platform support " "is available. mimalloc \"is a general purpose allocator with excellent " @@ -1035,50 +1092,76 @@ msgid "" "runtime systems of the Koka and Lean languages.\"" msgstr "" -#: ../../c-api/memory.rst:689 +#: ../../c-api/memory.rst:725 msgid "tracemalloc C API" msgstr "" -#: ../../c-api/memory.rst:695 +#: ../../c-api/memory.rst:731 msgid "Track an allocated memory block in the :mod:`tracemalloc` module." msgstr "" -#: ../../c-api/memory.rst:697 +#: ../../c-api/memory.rst:733 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:700 +#: ../../c-api/memory.rst:736 msgid "If memory block is already tracked, update the existing trace." msgstr "" -#: ../../c-api/memory.rst:704 +#: ../../c-api/memory.rst:740 msgid "" "Untrack an allocated memory block in the :mod:`tracemalloc` module. Do " "nothing if the block was not tracked." msgstr "" -#: ../../c-api/memory.rst:707 +#: ../../c-api/memory.rst:743 msgid "Return ``-2`` if tracemalloc is disabled, otherwise return ``0``." msgstr "" -#: ../../c-api/memory.rst:713 +#: ../../c-api/memory.rst:749 msgid "Examples" msgstr "Exemplos" -#: ../../c-api/memory.rst:715 +#: ../../c-api/memory.rst:751 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 " "set::" msgstr "" -#: ../../c-api/memory.rst:728 +#: ../../c-api/memory.rst:754 +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:764 msgid "The same code using the type-oriented function set::" msgstr "" -#: ../../c-api/memory.rst:740 +#: ../../c-api/memory.rst:766 +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_Del(buf); /* allocated with PyMem_New */\n" +"return res;" +msgstr "" + +#: ../../c-api/memory.rst:776 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 " @@ -1088,14 +1171,26 @@ msgid "" "different allocators operating on different heaps. ::" msgstr "" -#: ../../c-api/memory.rst:755 +#: ../../c-api/memory.rst:783 +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_Del() */" +msgstr "" + +#: ../../c-api/memory.rst:791 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_Del`." +"Python heap, objects in Python are allocated and released " +"with :c:macro:`PyObject_New`, :c:macro:`PyObject_NewVar` " +"and :c:func:`PyObject_Del`." msgstr "" -#: ../../c-api/memory.rst:759 +#: ../../c-api/memory.rst:795 msgid "" "These will be explained in the next chapter on defining and implementing new " "object types in C." diff --git a/c-api/memoryview.po b/c-api/memoryview.po index 7e6e8a2ec..5069d70ff 100644 --- a/c-api/memoryview.po +++ b/c-api/memoryview.po @@ -1,26 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 +# Rafael Fontenelle , 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-31 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -40,6 +40,14 @@ msgstr "" #: ../../c-api/memoryview.rst:18 msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python memoryview " +"type. This is the same object as :class:`memoryview` in the Python layer." +msgstr "" +"Esta instância de :c:type:`PyTypeObject` representa o tipo memoryview " +"Python. Este é o mesmo objeto que :class:`memoryview` na camada Python." + +#: ../../c-api/memoryview.rst:24 +msgid "" "Create a memoryview object from an object that provides the buffer " "interface. If *obj* supports writable buffer exports, the memoryview object " "will be read/write, otherwise it may be either read-only or read/write at " @@ -50,15 +58,15 @@ msgstr "" "memoryview será de leitura/gravação; caso contrário, poderá ser somente " "leitura ou leitura/gravação, a critério do exportador." -#: ../../c-api/memoryview.rst:26 +#: ../../c-api/memoryview.rst:32 msgid "Flag to request a readonly buffer." msgstr "Sinalizador para solicitar um buffer de somente leitura." -#: ../../c-api/memoryview.rst:31 +#: ../../c-api/memoryview.rst:37 msgid "Flag to request a writable buffer." msgstr "Sinalizador para solicitar um buffer gravável." -#: ../../c-api/memoryview.rst:36 +#: ../../c-api/memoryview.rst:42 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 +74,7 @@ msgstr "" "Cria um objeto memoryview usando *mem* como o buffer subjacente. *flags* " "pode ser um dos seguintes :c:macro:`PyBUF_READ` ou :c:macro:`PyBUF_WRITE`." -#: ../../c-api/memoryview.rst:43 +#: ../../c-api/memoryview.rst:49 msgid "" "Create a memoryview object wrapping the given buffer structure *view*. For " "simple byte buffers, :c:func:`PyMemoryView_FromMemory` is the preferred " @@ -76,7 +84,7 @@ msgstr "" "fornecida. Para buffers de bytes simples, :c:func:`PyMemoryView_FromMemory` " "é a função preferida." -#: ../../c-api/memoryview.rst:49 +#: ../../c-api/memoryview.rst:55 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,14 +98,14 @@ msgstr "" "memoryview apontará para a memória original. Caso contrário, é feita uma " "cópia e a visualização da memória aponta para um novo objeto bytes." -#: ../../c-api/memoryview.rst:55 +#: ../../c-api/memoryview.rst:61 msgid "" "*buffertype* can be one of :c:macro:`PyBUF_READ` or :c:macro:`PyBUF_WRITE`." msgstr "" -"*buffertype* pode ser um entre :c:macro:`PyBUF_READ` ou :c:macro:" -"`PyBUF_WRITE`." +"*buffertype* pode ser um entre :c:macro:`PyBUF_READ` " +"ou :c:macro:`PyBUF_WRITE`." -#: ../../c-api/memoryview.rst:60 +#: ../../c-api/memoryview.rst:66 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 " @@ -107,7 +115,7 @@ msgstr "" "permitido criar subclasses de :class:`memoryview`. Esta função sempre tem " "sucesso." -#: ../../c-api/memoryview.rst:67 +#: ../../c-api/memoryview.rst:73 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,17 +125,19 @@ msgstr "" "*mview* **deve** ser uma instância de memoryview; Se essa macro não " "verificar seu tipo, faça você mesmo ou corre o risco de travar." -#: ../../c-api/memoryview.rst:73 +#: ../../c-api/memoryview.rst:79 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:" -"func:`PyMemoryView_FromMemory` or :c:func:`PyMemoryView_FromBuffer`. *mview* " -"**must** be a memoryview instance." +"on or ``NULL`` if the memoryview has been created by one of the " +"functions :c:func:`PyMemoryView_FromMemory` " +"or :c:func:`PyMemoryView_FromBuffer`. *mview* **must** be a memoryview " +"instance." msgstr "" "Retorna um ponteiro para o objeto de exportação no qual a memória é baseada " -"ou ``NULL`` se a memória tiver sido criada por uma das funções :c:func:" -"`PyMemoryView_FromMemory` ou :c:func:`PyMemoryView_FromBuffer`. *mview* " -"**deve** ser uma instância de memoryview." +"ou ``NULL`` se a memória tiver sido criada por uma das " +"funções :c:func:`PyMemoryView_FromMemory` " +"ou :c:func:`PyMemoryView_FromBuffer`. *mview* **deve** ser uma instância de " +"memoryview." #: ../../c-api/memoryview.rst:5 msgid "object" diff --git a/c-api/method.po b/c-api/method.po index 98672273e..21dc0af78 100644 --- a/c-api/method.po +++ b/c-api/method.po @@ -1,28 +1,25 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Adorilson Bezerra , 2021 -# Cássio Nomura , 2021 -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-08-03 20:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: python-doc bot, 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -50,13 +47,13 @@ msgstr "" #: ../../c-api/method.rst:23 msgid "" -"Return true if *o* is an instance method object (has type :c:data:" -"`PyInstanceMethod_Type`). The parameter must not be ``NULL``. This function " -"always succeeds." +"Return true if *o* is an instance method object (has " +"type :c:data:`PyInstanceMethod_Type`). The parameter must not be ``NULL``. " +"This function always succeeds." msgstr "" -"Retorna verdadeiro se *o* é um objeto de método de instância (tem tipo :c:" -"data:`PyInstanceMethod_Type`). O parâmetro não deve ser ``NULL``. Esta " -"função sempre tem sucesso." +"Retorna verdadeiro se *o* é um objeto de método de instância (tem " +"tipo :c:data:`PyInstanceMethod_Type`). O parâmetro não deve ser ``NULL``. " +"Esta função sempre tem sucesso." #: ../../c-api/method.rst:30 msgid "" @@ -107,9 +104,9 @@ msgid "" "Return true if *o* is a method object (has type :c:data:`PyMethod_Type`). " "The parameter must not be ``NULL``. This function always succeeds." msgstr "" -"Retorna verdadeiro se *o* é um objeto de método (tem tipo :c:data:" -"`PyMethod_Type`). O parâmetro não deve ser ``NULL``. Esta função sempre tem " -"sucesso." +"Retorna verdadeiro se *o* é um objeto de método (tem " +"tipo :c:data:`PyMethod_Type`). O parâmetro não deve ser ``NULL``. Esta " +"função sempre tem sucesso." #: ../../c-api/method.rst:73 msgid "" diff --git a/c-api/module.po b/c-api/module.po index 5aab0786f..643a8cbf9 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -1,29 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# i17obot , 2021 -# Rodrigo Cândido, 2022 -# Welliton Malta , 2023 -# Marco Rougeth , 2023 -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 +# willian ohara, 2026 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-08-16 14:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-13 21:57+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: willian ohara, 2026\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -34,10 +31,8 @@ msgstr "Objetos do Módulo" #: ../../c-api/module.rst:15 msgid "" "This instance of :c:type:`PyTypeObject` represents the Python module type. " -"This is exposed to Python programs as ``types.ModuleType``." +"This is exposed to Python programs as :py:class:`types.ModuleType`." msgstr "" -"Esta instância de :c:type:`PyTypeObject` representa o tipo de módulo Python. " -"Isso é exposto a programas Python como ``types.ModuleType``." #: ../../c-api/module.rst:21 msgid "" @@ -49,36 +44,42 @@ msgstr "" #: ../../c-api/module.rst:27 msgid "" -"Return true if *p* is a module object, but not a subtype of :c:data:" -"`PyModule_Type`. This function always succeeds." +"Return true if *p* is a module object, but not a subtype " +"of :c:data:`PyModule_Type`. This function always succeeds." msgstr "" -"Retorna true se *p* for um objeto de módulo, mas não um subtipo de :c:data:" -"`PyModule_Type`. Essa função é sempre bem-sucedida." +"Retorna true se *p* for um objeto de módulo, mas não um subtipo " +"de :c:data:`PyModule_Type`. Essa função é sempre bem-sucedida." #: ../../c-api/module.rst:40 msgid "" -"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 "" -"Retorna um novo objeto de módulo com o atributo :attr:`__name__` definido " -"como *name*. Os atributos de módulo :attr:`__name__`, :attr:`__doc__`, :attr:" -"`__package__` e :attr:`__loader__` são preenchidos (todos exceto :attr:" -"`__name__` são definidos como ``None``); O chamador é responsásvel por " -"providenciar um atributo :attr:`__file__`." - -#: ../../c-api/module.rst:46 ../../c-api/module.rst:270 -#: ../../c-api/module.rst:470 +"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 "" +"Retorna um novo objeto de módulo com :attr:`module.__name__` definido como " +"*name*. Os atributos :attr:`!" +"__name__`, :attr:`~module.__doc__`, :attr:`~module.__package__` " +"e :attr:`~module.__loader__` do módulo são preenchidos (todos, " +"exceto :attr:`!__name__`, são definidos como ``None``). O chamador é " +"responsável por definir um atributo :attr:`~module.__file__`." + +#: ../../c-api/module.rst:46 ../../c-api/module.rst:292 +#: ../../c-api/module.rst:516 msgid "Return ``NULL`` with an exception set on error." msgstr "Retorna ``NULL`` com uma exceção definida em caso de erro." #: ../../c-api/module.rst:50 -msgid ":attr:`__package__` and :attr:`__loader__` are set to ``None``." -msgstr ":attr:`__package__` e :attr:`__loader__` são definidos como ``None``." +msgid "" +":attr:`~module.__package__` and :attr:`~module.__loader__` are now set to " +"``None``." +msgstr "" +":attr:`~module.__package__` e :attr:`~module.__loader__` agora estão " +"definidos como ``None``." -#: ../../c-api/module.rst:56 +#: ../../c-api/module.rst:57 msgid "" "Similar to :c:func:`PyModule_NewObject`, but the name is a UTF-8 encoded " "string instead of a Unicode object." @@ -86,7 +87,7 @@ msgstr "" "Semelhante a :c:func:`PyModule_NewObject`, mas o nome é uma string " "codificada em UTF-8 em vez de um objeto Unicode." -#: ../../c-api/module.rst:64 +#: ../../c-api/module.rst:65 msgid "" "Return the dictionary object that implements *module*'s namespace; this " "object is the same as the :attr:`~object.__dict__` attribute of the module " @@ -98,27 +99,33 @@ msgstr "" "módulo. Se *module* não for um objeto de módulo (ou um subtipo de um objeto " "de módulo), :exc:`SystemError` é levantada e ``NULL`` é retornado." -#: ../../c-api/module.rst:69 +#: ../../c-api/module.rst:70 msgid "" "It is recommended extensions use other ``PyModule_*`` and ``PyObject_*`` " -"functions rather than directly manipulate a module's :attr:`~object." -"__dict__`." +"functions rather than directly manipulate a " +"module's :attr:`~object.__dict__`." msgstr "" "É recomendado que as extensões usem outras funções ``PyModule_*`` e " "``PyObject_*`` em vez de manipular diretamente o :attr:`~object.__dict__` de " "um módulo." -#: ../../c-api/module.rst:80 +#: ../../c-api/module.rst:74 msgid "" -"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." +"The returned reference is borrowed from the module; it is valid until the " +"module is destroyed." msgstr "" -"Retorna o valor :attr:`__name__` do *módulo*. Se o módulo não fornecer um, " -"ou se não for uma string, :exc:`SystemError` é levantada e ``NULL`` é " -"retornado." -#: ../../c-api/module.rst:88 +#: ../../c-api/module.rst:84 +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." +msgstr "" +"Retorna o valor :attr:`~module.__name__` do *module*. Se o módulo não " +"fornecer um, ou se não for uma string, :exc:`SystemError` é levantada e " +"``NULL`` é retornado." + +#: ../../c-api/module.rst:93 msgid "" "Similar to :c:func:`PyModule_GetNameObject` but return the name encoded to " "``'utf-8'``." @@ -126,17 +133,24 @@ msgstr "" "Semelhante a :c:func:`PyModule_GetNameObject` mas retorna o nome codificado " "em ``'utf-8'``" -#: ../../c-api/module.rst:93 +#: ../../c-api/module.rst:96 +msgid "" +"The returned buffer is only valid until the module is renamed or destroyed. " +"Note that Python code may rename a module by setting " +"its :py:attr:`~module.__name__` attribute." +msgstr "" + +#: ../../c-api/module.rst:102 msgid "" "Return the \"state\" of the module, that is, a pointer to the block of " -"memory allocated at module creation time, or ``NULL``. See :c:member:" -"`PyModuleDef.m_size`." +"memory allocated at module creation time, or ``NULL``. " +"See :c:member:`PyModuleDef.m_size`." msgstr "" "Retorna o \"estado\" do módulo, ou seja, um ponteiro para o bloco de memória " -"alocado no momento de criação do módulo, ou ``NULL``. Ver :c:member:" -"`PyModuleDef.m_size`." +"alocado no momento de criação do módulo, ou ``NULL``. " +"Ver :c:member:`PyModuleDef.m_size`." -#: ../../c-api/module.rst:100 +#: ../../c-api/module.rst:109 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." @@ -144,19 +158,26 @@ msgstr "" "Retorna um ponteiro para a estrutura :c:type:`PyModuleDef` da qual o módulo " "foi criado, ou ``NULL`` se o módulo não foi criado de uma definição." -#: ../../c-api/module.rst:110 +#: ../../c-api/module.rst:112 msgid "" -"Return the name of the file from which *module* was loaded using *module*'s :" -"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." +"On error, return ``NULL`` with an exception set. " +"Use :c:func:`PyErr_Occurred` to tell this case apart from a " +"missing :c:type:`!PyModuleDef`." msgstr "" -"Retorna o nome do arquivo do qual o *módulo* foi carregado usando o " -"atributo :attr:`__file__` do *módulo*. Se não estiver definido, ou se não " -"for uma string unicode, levanta :exc:`SystemError` e retorna ``NULL``; Caso " -"contrário, retorna uma referência a um objeto Unicode." -#: ../../c-api/module.rst:120 +#: ../../c-api/module.rst:123 +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." +msgstr "" +"Retorna o nome do arquivo do qual o *module* foi carregado usando o " +"atributo :attr:`~module.__file__` do *module*. Se não estiver definido, ou " +"se não for uma string unicode, levanta :exc:`SystemError` e retorna " +"``NULL``; Caso contrário, retorna uma referência a um objeto Unicode." + +#: ../../c-api/module.rst:133 msgid "" "Similar to :c:func:`PyModule_GetFilenameObject` but return the filename " "encoded to 'utf-8'." @@ -164,7 +185,14 @@ msgstr "" "Semelhante a :c:func:`PyModule_GetFilenameObject` mas retorna o nome do " "arquivo codificado em 'utf-8'." -#: ../../c-api/module.rst:123 +#: ../../c-api/module.rst:136 +msgid "" +"The returned buffer is only valid until the " +"module's :py:attr:`~module.__file__` attribute is reassigned or the module " +"is destroyed." +msgstr "" + +#: ../../c-api/module.rst:139 msgid "" ":c:func:`PyModule_GetFilename` raises :exc:`UnicodeEncodeError` on " "unencodable filenames, use :c:func:`PyModule_GetFilenameObject` instead." @@ -172,11 +200,11 @@ msgstr "" ":c:func:`PyModule_GetFilename`: levanta :exc:`UnicodeEncodeError` quando há " "nomes de arquivos não codificáveis, use :c:func:`PyModule_GetFilenameObject`." -#: ../../c-api/module.rst:131 +#: ../../c-api/module.rst:147 msgid "Initializing C modules" msgstr "Inicializando módulos C" -#: ../../c-api/module.rst:133 +#: ../../c-api/module.rst:149 msgid "" "Modules objects are usually created from extension modules (shared libraries " "which export an initialization function), or compiled-in modules (where the " @@ -185,22 +213,23 @@ msgid "" msgstr "" "Objetos de módulos são geralmente criados a partir de módulos de extensão " "(bibliotecas compartilhadas que exportam uma função de inicialização), ou " -"módulos compilados (onde a função de inicialização é adicionada usando :c:" -"func:`PyImport_AppendInittab`). Ver :ref:`building` ou :ref:`extending-with-" -"embedding` para mais detalhes." +"módulos compilados (onde a função de inicialização é adicionada " +"usando :c:func:`PyImport_AppendInittab`). Ver :ref:`building` " +"ou :ref:`extending-with-embedding` para mais detalhes." -#: ../../c-api/module.rst:138 +#: ../../c-api/module.rst:154 msgid "" -"The initialization function can either pass a module definition instance to :" -"c:func:`PyModule_Create`, and return the resulting module object, or request " -"\"multi-phase initialization\" by returning the definition struct itself." +"The initialization function can either pass a module definition instance " +"to :c:func:`PyModule_Create`, and return the resulting module object, or " +"request \"multi-phase initialization\" by returning the definition struct " +"itself." msgstr "" "A função de inicialização pode passar uma instância de definição de módulo " "para :c:func:`PyModule_Create` e retornar o objeto de módulo resultante ou " "solicitar \"inicialização multifásica\" retornando a própria estrutura de " "definição." -#: ../../c-api/module.rst:144 +#: ../../c-api/module.rst:160 msgid "" "The module definition struct, which holds all information needed to create a " "module object. There is usually only one statically initialized variable of " @@ -210,23 +239,23 @@ msgstr "" "necessária para criar um objeto de módulo. Geralmente, há apenas uma " "variável inicializada estaticamente desse tipo para cada módulo." -#: ../../c-api/module.rst:150 +#: ../../c-api/module.rst:166 msgid "Always initialize this member to :c:macro:`PyModuleDef_HEAD_INIT`." msgstr "Sempre inicializa este membro para :c:macro:`PyModuleDef_HEAD_INIT`." -#: ../../c-api/module.rst:154 +#: ../../c-api/module.rst:170 msgid "Name for the new module." msgstr "Nome para o novo módulo." -#: ../../c-api/module.rst:158 +#: ../../c-api/module.rst:174 msgid "" -"Docstring for the module; usually a docstring variable created with :c:macro:" -"`PyDoc_STRVAR` is used." +"Docstring for the module; usually a docstring variable created " +"with :c:macro:`PyDoc_STRVAR` is used." msgstr "" -"Docstring para o módulo; geralmente uma variável docstring criada com :c:" -"macro:`PyDoc_STRVAR` é usada." +"Docstring para o módulo; geralmente uma variável docstring criada " +"com :c:macro:`PyDoc_STRVAR` é usada." -#: ../../c-api/module.rst:163 +#: ../../c-api/module.rst:179 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 " @@ -237,17 +266,17 @@ msgstr "" "estáticos. Isso torna os módulos seguros para uso em vários " "subinterpretadores." -#: ../../c-api/module.rst:167 +#: ../../c-api/module.rst:183 msgid "" "This memory area is allocated based on *m_size* on module creation, and " -"freed when the module object is deallocated, after the :c:member:" -"`~PyModuleDef.m_free` function has been called, if present." +"freed when the module object is deallocated, after " +"the :c:member:`~PyModuleDef.m_free` function has been called, if present." msgstr "" "Esta área de memória é alocada com base em *m_size* na criação do módulo e " -"liberada quando o objeto do módulo é desalocado, após a função :c:member:" -"`~PyModuleDef.m_free` ter sido chamada, se presente." +"liberada quando o objeto do módulo é desalocado, após a " +"função :c:member:`~PyModuleDef.m_free` ter sido chamada, se presente." -#: ../../c-api/module.rst:171 +#: ../../c-api/module.rst:187 msgid "" "Setting ``m_size`` to ``-1`` means that the module does not support sub-" "interpreters, because it has global state." @@ -255,7 +284,7 @@ msgstr "" "Definir ``m_size`` como ``-1`` significa que o módulo não oferece suporte a " "subinterpretadores, porque ele tem estado global." -#: ../../c-api/module.rst:174 +#: ../../c-api/module.rst:190 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 " @@ -267,20 +296,21 @@ msgstr "" "para seu estado. ``m_size`` não negativo é necessário para inicialização " "multifásica." -#: ../../c-api/module.rst:179 +#: ../../c-api/module.rst:195 msgid "See :PEP:`3121` for more details." msgstr "Ver :PEP:`3121` para mais detalhes." -#: ../../c-api/module.rst:183 +#: ../../c-api/module.rst:199 msgid "" -"A pointer to a table of module-level functions, described by :c:type:" -"`PyMethodDef` values. Can be ``NULL`` if no functions are present." +"A pointer to a table of module-level functions, described " +"by :c:type:`PyMethodDef` values. Can be ``NULL`` if no functions are " +"present." msgstr "" "Um ponteiro para uma tabela de funções de nível de módulo, descritas por " "valores :c:type:`PyMethodDef`. Pode ser ``NULL`` se nenhuma função estiver " "presente." -#: ../../c-api/module.rst:188 +#: ../../c-api/module.rst:204 msgid "" "An array of slot definitions for multi-phase initialization, terminated by a " "``{0, NULL}`` entry. When using single-phase initialization, *m_slots* must " @@ -290,7 +320,7 @@ msgstr "" "por uma entrada ``{0, NULL}``. Ao usar inicialização monofásica, *m_slots* " "deve ser ``NULL``." -#: ../../c-api/module.rst:194 +#: ../../c-api/module.rst:210 msgid "" "Prior to version 3.5, this member was always set to ``NULL``, and was " "defined as:" @@ -298,7 +328,7 @@ msgstr "" "Antes da versão 3.5, esse membro era sempre definido como ``NULL`` e era " "definido como:" -#: ../../c-api/module.rst:201 +#: ../../c-api/module.rst:217 msgid "" "A traversal function to call during GC traversal of the module object, or " "``NULL`` if not needed." @@ -306,29 +336,29 @@ msgstr "" "Uma função de travessia para chamar durante a travessia do GC do objeto do " "módulo, ou ``NULL`` se não for necessário." -#: ../../c-api/module.rst:204 ../../c-api/module.rst:219 -#: ../../c-api/module.rst:240 +#: ../../c-api/module.rst:220 ../../c-api/module.rst:235 +#: ../../c-api/module.rst:256 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``." +"greater than 0 and the module state (as returned " +"by :c:func:`PyModule_GetState`) is ``NULL``." msgstr "" "Esta função não é mais chamada se o estado do módulo foi solicitado, mas " "ainda não está alocado. Este é o caso imediatamente após o módulo ser criado " "e antes de o módulo ser executado (função :c:data:`Py_mod_exec`). Mais " "precisamente, esta função não é chamada se :c:member:`~PyModuleDef.m_size` " -"for maior que 0 e o estado do módulo (como retornado por :c:func:" -"`PyModule_GetState`) for ``NULL``." +"for maior que 0 e o estado do módulo (como retornado " +"por :c:func:`PyModule_GetState`) for ``NULL``." -#: ../../c-api/module.rst:211 ../../c-api/module.rst:232 -#: ../../c-api/module.rst:247 +#: ../../c-api/module.rst:227 ../../c-api/module.rst:248 +#: ../../c-api/module.rst:263 msgid "No longer called before the module state is allocated." msgstr "Não é mais chamado antes que o estado do módulo seja alocado." -#: ../../c-api/module.rst:216 +#: ../../c-api/module.rst:232 msgid "" "A clear function to call during GC clearing of the module object, or " "``NULL`` if not needed." @@ -336,7 +366,7 @@ msgstr "" "Uma função de limpeza para chamar durante a limpeza do GC do objeto do " "módulo, ou ``NULL`` se não for necessário." -#: ../../c-api/module.rst:226 +#: ../../c-api/module.rst:242 msgid "" "Like :c:member:`PyTypeObject.tp_clear`, this function is not *always* called " "before a module is deallocated. For example, when reference counting is " @@ -344,8 +374,13 @@ msgid "" "collector is not involved and :c:member:`~PyModuleDef.m_free` is called " "directly." msgstr "" +"Assim como :c:member:`PyTypeObject.tp_clear`, esta função não é *sempre* " +"chamada antes de um módulo ser desalocado. Por exemplo, quando a contagem de " +"referências é suficiente para determinar que um objeto não é mais usado, o " +"coletor de lixo cíclico não é envolvido e :c:member:`~PyModuleDef.m_free` é " +"chamado diretamente." -#: ../../c-api/module.rst:237 +#: ../../c-api/module.rst:253 msgid "" "A function to call during deallocation of the module object, or ``NULL`` if " "not needed." @@ -353,11 +388,15 @@ msgstr "" "Uma função para ser chamada durante a desalocação do objeto do módulo, ou " "``NULL`` se não for necessário." -#: ../../c-api/module.rst:251 +#: ../../c-api/module.rst:269 +msgid "The type of ``PyModuleDef`` objects." +msgstr "" + +#: ../../c-api/module.rst:273 msgid "Single-phase initialization" msgstr "inicialização de fase única" -#: ../../c-api/module.rst:253 +#: ../../c-api/module.rst:275 msgid "" "The module initialization function may create and return the module object " "directly. This is referred to as \"single-phase initialization\", and uses " @@ -367,78 +406,106 @@ msgstr "" "diretamente. Isso é chamado de \"inicialização de fase única\" e usa uma das " "duas funções de criação de módulo a seguir:" -#: ../../c-api/module.rst:259 +#: ../../c-api/module.rst:281 msgid "" "Create a new module object, given the definition in *def*. This behaves " -"like :c:func:`PyModule_Create2` with *module_api_version* set to :c:macro:" -"`PYTHON_API_VERSION`." +"like :c:func:`PyModule_Create2` with *module_api_version* set " +"to :c:macro:`PYTHON_API_VERSION`." msgstr "" +"Cria um novo objeto de módulo, dada a definição em *def*. Isso se comporta " +"como :c:func:`PyModule_Create2` com *module_api_version* definido " +"como :c:macro:`PYTHON_API_VERSION`" -#: ../../c-api/module.rst:266 +#: ../../c-api/module.rst:288 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 " "the running interpreter, a :exc:`RuntimeWarning` is emitted." msgstr "" -#: ../../c-api/module.rst:274 +#: ../../c-api/module.rst:296 msgid "" "Most uses of this function should be using :c:func:`PyModule_Create` " "instead; only use this if you are sure you need it." msgstr "" -"A maioria dos usos dessa função deve ser feita com :c:func:" -"`PyModule_Create`; use-o apenas se tiver certeza de que precisa." +"A maioria dos usos dessa função deve ser feita " +"com :c:func:`PyModule_Create`; use-o apenas se tiver certeza de que precisa." -#: ../../c-api/module.rst:277 +#: ../../c-api/module.rst:299 msgid "" "Before it is returned from in the initialization function, the resulting " -"module object is typically populated using functions like :c:func:" -"`PyModule_AddObjectRef`." +"module object is typically populated using functions " +"like :c:func:`PyModule_AddObjectRef`." msgstr "" -#: ../../c-api/module.rst:283 +#: ../../c-api/module.rst:305 msgid "Multi-phase initialization" msgstr "Inicialização multifásica" -#: ../../c-api/module.rst:285 +#: ../../c-api/module.rst:307 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:`!__new__` and :py:meth:`!" -"__init__` methods of classes." +"The distinction is similar to the :py:meth:`~object.__new__` " +"and :py:meth:`~object.__init__` methods of classes." msgstr "" -#: ../../c-api/module.rst:292 +#: ../../c-api/module.rst:314 msgid "" "Unlike modules created using single-phase initialization, these modules are " -"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:`~object." -"__dict__` or individual classes created with :c:func:`PyType_FromSpec`)." +"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:322 +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:302 +#: ../../c-api/module.rst:329 +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:335 +msgid "" +"A simpler way to avoid these issues is :ref:`raising an error on repeated " +"initialization `." +msgstr "" +"Uma maneira mais simples de evitar esses problemas é :ref:`levantar um erro " +"na inicialização repetida `." + +#: ../../c-api/module.rst:338 msgid "" "All modules created using multi-phase initialization are expected to " -"support :ref:`sub-interpreters `. Making sure " -"multiple modules are independent is typically enough to achieve this." +"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." msgstr "" -#: ../../c-api/module.rst:306 +#: ../../c-api/module.rst:346 msgid "" "To request multi-phase initialization, the initialization function " -"(PyInit_modulename) returns a :c:type:`PyModuleDef` instance with non-empty :" -"c:member:`~PyModuleDef.m_slots`. Before it is returned, the ``PyModuleDef`` " -"instance must be initialized with the following function:" +"(PyInit_modulename) returns a :c:type:`PyModuleDef` instance with non-" +"empty :c:member:`~PyModuleDef.m_slots`. Before it is returned, the " +"``PyModuleDef`` instance must be initialized with the following function:" msgstr "" -#: ../../c-api/module.rst:313 +#: ../../c-api/module.rst:353 msgid "" "Ensures a module definition is a properly initialized Python object that " "correctly reports its type and reference count." @@ -446,54 +513,54 @@ msgstr "" "Garante que uma definição de módulo é um objeto Python devidamente " "inicializado que reporta corretamente seu tipo e contagem de referências." -#: ../../c-api/module.rst:316 +#: ../../c-api/module.rst:356 msgid "Returns *def* cast to ``PyObject*``, or ``NULL`` if an error occurred." msgstr "" -#: ../../c-api/module.rst:320 +#: ../../c-api/module.rst:360 msgid "" "The *m_slots* member of the module definition must point to an array of " "``PyModuleDef_Slot`` structures:" msgstr "" -#: ../../c-api/module.rst:327 +#: ../../c-api/module.rst:367 msgid "A slot ID, chosen from the available values explained below." msgstr "" "Um ID de lot, escolhido a partir dos valores disponíveis explicados abaixo." -#: ../../c-api/module.rst:331 +#: ../../c-api/module.rst:371 msgid "Value of the slot, whose meaning depends on the slot ID." msgstr "Valor do slot, cujo significado depende do ID do slot." -#: ../../c-api/module.rst:335 +#: ../../c-api/module.rst:375 msgid "The *m_slots* array must be terminated by a slot with id 0." msgstr "" -#: ../../c-api/module.rst:337 +#: ../../c-api/module.rst:377 msgid "The available slot types are:" msgstr "Os tipos de slot disponíveis são:" -#: ../../c-api/module.rst:341 +#: ../../c-api/module.rst:381 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:" msgstr "" -#: ../../c-api/module.rst:348 +#: ../../c-api/module.rst:388 msgid "" "The function receives a :py:class:`~importlib.machinery.ModuleSpec` " "instance, as defined in :PEP:`451`, and the module definition. It should " "return a new module object, or set an error and return ``NULL``." msgstr "" -#: ../../c-api/module.rst:353 +#: ../../c-api/module.rst:393 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 " "in an infinite loop." msgstr "" -#: ../../c-api/module.rst:357 +#: ../../c-api/module.rst:397 msgid "" "Multiple ``Py_mod_create`` slots may not be specified in one module " "definition." @@ -501,7 +568,7 @@ msgstr "" "Múltiplos slots ``Py_mod_create`` podem não estar especificados em uma " "definição de módulo." -#: ../../c-api/module.rst:360 +#: ../../c-api/module.rst:400 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 " @@ -510,17 +577,17 @@ msgid "" "through symlinks, all while sharing a single module definition." msgstr "" -#: ../../c-api/module.rst:366 +#: ../../c-api/module.rst:406 msgid "" -"There is no requirement for the returned object to be an instance of :c:type:" -"`PyModule_Type`. Any type can be used, as long as it supports setting and " -"getting import-related attributes. However, only ``PyModule_Type`` instances " -"may be returned if the ``PyModuleDef`` has non-``NULL`` ``m_traverse``, " -"``m_clear``, ``m_free``; non-zero ``m_size``; or slots other than " -"``Py_mod_create``." +"There is no requirement for the returned object to be an instance " +"of :c:type:`PyModule_Type`. Any type can be used, as long as it supports " +"setting and getting import-related attributes. However, only " +"``PyModule_Type`` instances may be returned if the ``PyModuleDef`` has non-" +"``NULL`` ``m_traverse``, ``m_clear``, ``m_free``; non-zero ``m_size``; or " +"slots other than ``Py_mod_create``." msgstr "" -#: ../../c-api/module.rst:375 +#: ../../c-api/module.rst:417 msgid "" "Specifies a function that is called to *execute* the module. This is " "equivalent to executing the code of a Python module: typically, this " @@ -528,7 +595,7 @@ msgid "" "function is:" msgstr "" -#: ../../c-api/module.rst:384 +#: ../../c-api/module.rst:426 msgid "" "If multiple ``Py_mod_exec`` slots are specified, they are processed in the " "order they appear in the *m_slots* array." @@ -536,55 +603,55 @@ msgstr "" "Se vários slots ``Py_mod_exec`` forem especificados, eles serão processados " "na ordem em que aparecem no vetor *m_slots*." -#: ../../c-api/module.rst:389 ../../c-api/module.rst:422 +#: ../../c-api/module.rst:433 ../../c-api/module.rst:466 msgid "Specifies one of the following values:" msgstr "" -#: ../../c-api/module.rst:395 +#: ../../c-api/module.rst:439 msgid "The module does not support being imported in subinterpreters." msgstr "" -#: ../../c-api/module.rst:399 +#: ../../c-api/module.rst:443 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:405 +#: ../../c-api/module.rst:449 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:409 +#: ../../c-api/module.rst:453 msgid "" "This slot determines whether or not importing this module in a " "subinterpreter will fail." msgstr "" -#: ../../c-api/module.rst:412 +#: ../../c-api/module.rst:456 msgid "" "Multiple ``Py_mod_multiple_interpreters`` slots may not be specified in one " "module definition." msgstr "" -#: ../../c-api/module.rst:415 +#: ../../c-api/module.rst:459 msgid "" "If ``Py_mod_multiple_interpreters`` is not specified, the import machinery " -"defaults to ``Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED``." +"defaults to ``Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED``." msgstr "" -#: ../../c-api/module.rst:426 +#: ../../c-api/module.rst:472 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:431 +#: ../../c-api/module.rst:477 msgid "The module is safe to run without an active GIL." msgstr "" -#: ../../c-api/module.rst:433 +#: ../../c-api/module.rst:479 msgid "" "This slot is ignored by Python builds not configured with :option:`--disable-" "gil`. Otherwise, it determines whether or not importing this module will " @@ -592,27 +659,27 @@ msgid "" "threaded-cpython` for more detail." msgstr "" -#: ../../c-api/module.rst:438 +#: ../../c-api/module.rst:484 msgid "" "Multiple ``Py_mod_gil`` slots may not be specified in one module definition." msgstr "" -#: ../../c-api/module.rst:440 +#: ../../c-api/module.rst:486 msgid "" "If ``Py_mod_gil`` is not specified, the import machinery defaults to " "``Py_MOD_GIL_USED``." msgstr "" -#: ../../c-api/module.rst:445 +#: ../../c-api/module.rst:491 msgid "See :PEP:`489` for more details on multi-phase initialization." msgstr "" "Ver :PEP:`489` para obter mais detalhes sobre a inicialização multifásica." -#: ../../c-api/module.rst:448 +#: ../../c-api/module.rst:494 msgid "Low-level module creation functions" msgstr "Funções de criação de módulo de baixo nível" -#: ../../c-api/module.rst:450 +#: ../../c-api/module.rst:496 msgid "" "The following functions are called under the hood when using multi-phase " "initialization. They can be used directly, for example when creating module " @@ -620,14 +687,14 @@ msgid "" "``PyModule_ExecDef`` must be called to fully initialize a module." msgstr "" -#: ../../c-api/module.rst:457 +#: ../../c-api/module.rst:503 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`." msgstr "" -#: ../../c-api/module.rst:465 +#: ../../c-api/module.rst:511 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 " @@ -635,24 +702,28 @@ msgid "" "emitted." msgstr "" -#: ../../c-api/module.rst:474 +#: ../../c-api/module.rst:520 msgid "" "Most uses of this function should be using :c:func:`PyModule_FromDefAndSpec` " "instead; only use this if you are sure you need it." msgstr "" -#: ../../c-api/module.rst:481 +#: ../../c-api/module.rst:527 msgid "Process any execution slots (:c:data:`Py_mod_exec`) given in *def*." msgstr "" -#: ../../c-api/module.rst:487 +#: ../../c-api/module.rst:533 msgid "" "Set the docstring for *module* to *docstring*. This function is called " "automatically when creating a module from ``PyModuleDef``, using either " "``PyModule_Create`` or ``PyModule_FromDefAndSpec``." msgstr "" -#: ../../c-api/module.rst:496 +#: ../../c-api/module.rst:538 +msgid "Return ``0`` on success. Return ``-1`` with an exception set on error." +msgstr "" + +#: ../../c-api/module.rst:545 msgid "" "Add the functions from the ``NULL`` terminated *functions* array to " "*module*. Refer to the :c:type:`PyMethodDef` documentation for details on " @@ -664,11 +735,17 @@ msgid "" "``PyModule_FromDefAndSpec``." msgstr "" -#: ../../c-api/module.rst:508 +#: ../../c-api/module.rst:554 +msgid "" +"The *functions* array must be statically allocated (or otherwise guaranteed " +"to outlive the module object)." +msgstr "" + +#: ../../c-api/module.rst:560 msgid "Support functions" msgstr "" -#: ../../c-api/module.rst:510 +#: ../../c-api/module.rst:562 msgid "" "The module initialization function (if using single phase initialization) or " "a function called from a module execution slot (if using multi-phase " @@ -676,29 +753,45 @@ msgid "" "module state:" msgstr "" -#: ../../c-api/module.rst:517 +#: ../../c-api/module.rst:569 msgid "" "Add an object to *module* as *name*. This is a convenience function which " "can be used from the module's initialization function." msgstr "" -#: ../../c-api/module.rst:520 +#: ../../c-api/module.rst:572 msgid "" "On success, return ``0``. On error, raise an exception and return ``-1``." msgstr "" -#: ../../c-api/module.rst:522 +#: ../../c-api/module.rst:574 ../../c-api/module.rst:625 +#: ../../c-api/module.rst:652 +msgid "Example usage::" +msgstr "Exemplo de uso::" + +#: ../../c-api/module.rst:576 msgid "" -"Return ``-1`` if *value* is ``NULL``. It must be called with an exception " -"raised in this case." +"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:525 ../../c-api/module.rst:572 -#: ../../c-api/module.rst:599 -msgid "Example usage::" -msgstr "Exemplo de uso::" +#: ../../c-api/module.rst:588 +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:539 +#: ../../c-api/module.rst:592 msgid "" "The example can also be written without checking explicitly if *obj* is " "``NULL``::" @@ -706,73 +799,102 @@ msgstr "" "O exemplo também pode ser escrito sem verificar explicitamente se *obj* é " "``NULL``::" -#: ../../c-api/module.rst:551 +#: ../../c-api/module.rst:595 +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:604 msgid "" "Note that ``Py_XDECREF()`` should be used instead of ``Py_DECREF()`` in this " "case, since *obj* can be ``NULL``." msgstr "" -#: ../../c-api/module.rst:554 +#: ../../c-api/module.rst:607 msgid "" "The number of different *name* strings passed to this function should be " "kept small, usually by only using statically allocated strings as *name*. " -"For names that aren't known at compile time, prefer calling :c:func:" -"`PyUnicode_FromString` and :c:func:`PyObject_SetAttr` directly. For more " -"details, see :c:func:`PyUnicode_InternFromString`, which may be used " -"internally to create a key object." +"For names that aren't known at compile time, prefer " +"calling :c:func:`PyUnicode_FromString` and :c:func:`PyObject_SetAttr` " +"directly. For more details, see :c:func:`PyUnicode_InternFromString`, which " +"may be used internally to create a key object." +msgstr "" + +#: ../../c-api/module.rst:620 +msgid "" +"Similar to :c:func:`PyModule_AddObjectRef`, but \":term:`steals `\" a " +"reference to *value* (even on error). 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:567 +#: ../../c-api/module.rst:627 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." +"if (PyModule_Add(module, \"spam\", PyBytes_FromString(value)) < 0) {\n" +" goto error;\n" +"}" msgstr "" -#: ../../c-api/module.rst:583 +#: ../../c-api/module.rst:636 msgid "" -"Similar to :c:func:`PyModule_AddObjectRef`, but steals a reference to " -"*value* on success (if it returns ``0``)." +"Similar to :c:func:`PyModule_AddObjectRef`, but :term:`steals ` a " +"reference to *value* on success (if it returns ``0``)." msgstr "" -#: ../../c-api/module.rst:586 +#: ../../c-api/module.rst:639 msgid "" "The new :c:func:`PyModule_Add` or :c:func:`PyModule_AddObjectRef` functions " "are recommended, since it is easy to introduce reference leaks by misusing " "the :c:func:`PyModule_AddObject` function." msgstr "" -#: ../../c-api/module.rst:593 +#: ../../c-api/module.rst:646 msgid "" "Unlike other functions that steal references, ``PyModule_AddObject()`` only " "releases the reference to *value* **on success**." msgstr "" -#: ../../c-api/module.rst:596 +#: ../../c-api/module.rst:649 msgid "" -"This means that its return value must be checked, and calling code must :c:" -"func:`Py_XDECREF` *value* manually on error." +"This means that its return value must be checked, and calling code " +"must :c:func:`Py_XDECREF` *value* manually on error." msgstr "" -#: ../../c-api/module.rst:614 -msgid ":c:func:`PyModule_AddObject` is :term:`soft deprecated`." +#: ../../c-api/module.rst:654 +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:619 +#: ../../c-api/module.rst:670 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:623 +#: ../../c-api/module.rst:674 msgid "" -"This is a convenience function that calls :c:func:`PyLong_FromLong` and :c:" -"func:`PyModule_AddObjectRef`; see their documentation for details." +"This is a convenience function that calls :c:func:`PyLong_FromLong` " +"and :c:func:`PyModule_AddObjectRef`; see their documentation for details." msgstr "" -#: ../../c-api/module.rst:629 +#: ../../c-api/module.rst:680 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 " @@ -780,14 +902,14 @@ msgid "" "on success." msgstr "" -#: ../../c-api/module.rst:634 +#: ../../c-api/module.rst:685 msgid "" -"This is a convenience function that calls :c:func:" -"`PyUnicode_InternFromString` and :c:func:`PyModule_AddObjectRef`; see their " -"documentation for details." +"This is a convenience function that " +"calls :c:func:`PyUnicode_InternFromString` " +"and :c:func:`PyModule_AddObjectRef`; see their documentation for details." msgstr "" -#: ../../c-api/module.rst:641 +#: ../../c-api/module.rst:692 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 " @@ -795,11 +917,11 @@ msgid "" "with an exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:649 +#: ../../c-api/module.rst:700 msgid "Add a string constant to *module*." msgstr "" -#: ../../c-api/module.rst:653 +#: ../../c-api/module.rst:704 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 " @@ -807,7 +929,7 @@ msgid "" "``-1`` with an exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:663 +#: ../../c-api/module.rst:714 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`. " @@ -818,25 +940,25 @@ msgid "" "Return ``-1`` with an exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:676 +#: ../../c-api/module.rst:727 msgid "Module lookup" msgstr "Pesquisa por módulos" -#: ../../c-api/module.rst:678 +#: ../../c-api/module.rst:729 msgid "" "Single-phase initialization creates singleton modules that can be looked up " "in the context of the current interpreter. This allows the module object to " "be retrieved later with only a reference to the module definition." msgstr "" -#: ../../c-api/module.rst:682 +#: ../../c-api/module.rst:733 msgid "" "These functions will not work on modules created using multi-phase " "initialization, since multiple such modules can be created from a single " "definition." msgstr "" -#: ../../c-api/module.rst:687 +#: ../../c-api/module.rst:738 msgid "" "Returns the module object that was created from *def* for the current " "interpreter. This method requires that the module object has been attached " @@ -845,18 +967,18 @@ msgid "" "to the interpreter state yet, it returns ``NULL``." msgstr "" -#: ../../c-api/module.rst:694 +#: ../../c-api/module.rst:745 msgid "" "Attaches the module object passed to the function to the interpreter state. " -"This allows the module object to be accessible via :c:func:" -"`PyState_FindModule`." +"This allows the module object to be accessible " +"via :c:func:`PyState_FindModule`." msgstr "" -#: ../../c-api/module.rst:697 +#: ../../c-api/module.rst:748 msgid "Only effective on modules created using single-phase initialization." msgstr "" -#: ../../c-api/module.rst:699 +#: ../../c-api/module.rst:750 msgid "" "Python calls ``PyState_AddModule`` automatically after importing a module, " "so it is unnecessary (but harmless) to call it from module initialization " @@ -867,17 +989,17 @@ msgid "" "state updates)." msgstr "" -#: ../../c-api/module.rst:707 ../../c-api/module.rst:718 +#: ../../c-api/module.rst:758 ../../c-api/module.rst:769 msgid "The caller must hold the GIL." -msgstr "" +msgstr "O caller deve possuir o GIL." -#: ../../c-api/module.rst:709 +#: ../../c-api/module.rst:760 msgid "Return ``-1`` with an exception set on error, ``0`` on success." msgstr "" "Retorna ``-1`` com uma exceção definida em caso de erro, ``0`` em caso de " "sucesso." -#: ../../c-api/module.rst:715 +#: ../../c-api/module.rst:766 msgid "" "Removes the module object created from *def* from the interpreter state. " "Return ``-1`` with an exception set on error, ``0`` on success." @@ -895,30 +1017,30 @@ msgstr "módulo" msgid "ModuleType (in module types)" msgstr "" -#: ../../c-api/module.rst:33 ../../c-api/module.rst:76 +#: ../../c-api/module.rst:33 ../../c-api/module.rst:80 msgid "__name__ (module attribute)" -msgstr "" +msgstr "__name__ (atributo de módulo)" #: ../../c-api/module.rst:33 msgid "__doc__ (module attribute)" -msgstr "" +msgstr "__doc__ (atributo de módulo)" -#: ../../c-api/module.rst:33 ../../c-api/module.rst:106 +#: ../../c-api/module.rst:33 ../../c-api/module.rst:119 msgid "__file__ (module attribute)" -msgstr "" +msgstr "__file__ (atributo de módulo)" #: ../../c-api/module.rst:33 msgid "__package__ (module attribute)" -msgstr "" +msgstr "__package__ (atributo de módulo)" #: ../../c-api/module.rst:33 msgid "__loader__ (module attribute)" -msgstr "" +msgstr "__loader__ (atributo de módulo)" -#: ../../c-api/module.rst:62 +#: ../../c-api/module.rst:63 msgid "__dict__ (module attribute)" -msgstr "" +msgstr "__dict__ (atributo de módulo)" -#: ../../c-api/module.rst:76 ../../c-api/module.rst:106 +#: ../../c-api/module.rst:80 ../../c-api/module.rst:119 msgid "SystemError (built-in exception)" msgstr "" diff --git a/c-api/monitoring.po b/c-api/monitoring.po index ad91c273e..5f947a692 100644 --- a/c-api/monitoring.po +++ b/c-api/monitoring.po @@ -1,31 +1,32 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Pedro Fonini, 2024 +# python-doc bot, 2025 +# Rafael Fontenelle , 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-06-20 06:40+0000\n" -"PO-Revision-Date: 2024-05-11 01:07+0000\n" -"Last-Translator: Pedro Fonini, 2024\n" +"POT-Creation-Date: 2026-10-17 18:27+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../c-api/monitoring.rst:6 msgid "Monitoring C API" -msgstr "API C de Monitoramento" +msgstr "API C de monitoramento" #: ../../c-api/monitoring.rst:8 msgid "Added in version 3.13." @@ -43,7 +44,7 @@ msgstr "" #: ../../c-api/monitoring.rst:15 msgid "Generating Execution Events" -msgstr "Gerando Eventos de Execução" +msgstr "Gerando eventos de execução" #: ../../c-api/monitoring.rst:17 msgid "" @@ -52,10 +53,10 @@ msgid "" "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." +"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 "" "As funções abaixo permitem que extensões dispararem eventos de monitoramento " "emulando a execução de código Python. Cada uma dessas funções recebe uma " @@ -143,35 +144,35 @@ msgstr "Dispara um evento ``C_RETURN``." #: ../../c-api/monitoring.rst:90 msgid "" -"Fire a ``PY_THROW`` event with the current exception (as returned by :c:func:" -"`PyErr_GetRaisedException`)." +"Fire a ``PY_THROW`` event with the current exception (as returned " +"by :c:func:`PyErr_GetRaisedException`)." msgstr "" -"Dispara um evento ``PY_THROW`` com a exceção atual (conforme retornada por :" -"c:func:`PyErr_GetRaisedException`)." +"Dispara um evento ``PY_THROW`` com a exceção atual (conforme retornada " +"por :c:func:`PyErr_GetRaisedException`)." #: ../../c-api/monitoring.rst:96 msgid "" -"Fire a ``RAISE`` event with the current exception (as returned by :c:func:" -"`PyErr_GetRaisedException`)." +"Fire a ``RAISE`` event with the current exception (as returned " +"by :c:func:`PyErr_GetRaisedException`)." msgstr "" -"Dispara um evento ``RAISE`` com a exceção atual (conforme retornada por :c:" -"func:`PyErr_GetRaisedException`)." +"Dispara um evento ``RAISE`` com a exceção atual (conforme retornada " +"por :c:func:`PyErr_GetRaisedException`)." #: ../../c-api/monitoring.rst:102 msgid "" -"Fire a ``C_RAISE`` event with the current exception (as returned by :c:func:" -"`PyErr_GetRaisedException`)." +"Fire a ``C_RAISE`` event with the current exception (as returned " +"by :c:func:`PyErr_GetRaisedException`)." msgstr "" -"Dispara um evento ``C_RAISE`` com a exceção atual (conforme retornada por :c:" -"func:`PyErr_GetRaisedException`)." +"Dispara um evento ``C_RAISE`` com a exceção atual (conforme retornada " +"por :c:func:`PyErr_GetRaisedException`)." #: ../../c-api/monitoring.rst:108 msgid "" -"Fire a ``RERAISE`` event with the current exception (as returned by :c:func:" -"`PyErr_GetRaisedException`)." +"Fire a ``RERAISE`` event with the current exception (as returned " +"by :c:func:`PyErr_GetRaisedException`)." msgstr "" -"Dispara um evento ``RERAISE`` com a exceção atual (conforme retornada por :c:" -"func:`PyErr_GetRaisedException`)." +"Dispara um evento ``RERAISE`` com a exceção atual (conforme retornada " +"por :c:func:`PyErr_GetRaisedException`)." #: ../../c-api/monitoring.rst:114 msgid "" @@ -183,21 +184,21 @@ msgstr "" #: ../../c-api/monitoring.rst:120 msgid "" -"Fire a ``PY_UNWIND`` event with the current exception (as returned by :c:" -"func:`PyErr_GetRaisedException`)." +"Fire a ``PY_UNWIND`` event with the current exception (as returned " +"by :c:func:`PyErr_GetRaisedException`)." msgstr "" -"Dispara um evento ``PY_UNWIND`` com a exceção atual (conforme retornada por :" -"c:func:`PyErr_GetRaisedException`)." +"Dispara um evento ``PY_UNWIND`` com a exceção atual (conforme retornada " +"por :c:func:`PyErr_GetRaisedException`)." #: ../../c-api/monitoring.rst:126 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." +"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 "" -"Dispara um evento ``STOP_ITERATION``. Se ``value`` for uma instância de :exc:" -"`StopIteration`, ele é usado. Caso contrário, uma nova instância de :exc:" -"`StopIteration` é criada com ``value`` como o argumento." +"Dispara um evento ``STOP_ITERATION``. Se ``value`` for uma instância " +"de :exc:`StopIteration`, ele é usado. Caso contrário, uma nova instância " +"de :exc:`StopIteration` é criada com ``value`` como o argumento." #: ../../c-api/monitoring.rst:131 msgid "Managing the Monitoring State" @@ -206,7 +207,156 @@ msgstr "Gerenciando o Estado de um Monitoramento" #: ../../c-api/monitoring.rst:133 msgid "" "Monitoring states can be managed with the help of monitoring scopes. A scope " -"would typically correspond to a python function." +"would typically correspond to a Python function." msgstr "" "Estados de monitoramento podem ser gerenciados com a ajuda de escopos de " -"monitoramento. Um escopo corresponderia tipicamente a um função python." +"monitoramento. Um escopo corresponderia tipicamente a um função Python." + +#: ../../c-api/monitoring.rst:138 +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 "" +"Insere um escopo monitorado. ``event_types`` é um vetor de IDs de eventos " +"para eventos que podem ser disparados do escopo. Por exemplo, a ID de um " +"evento ``PY_START`` é o valor ``PY_MONITORING_EVENT_PY_START``, que é " +"numericamente igual ao logaritmo de base 2 de " +"``sys.monitoring.events.PY_START``. ``state_array`` é um vetor com uma " +"entrada de estado de monitoramento para cada evento em ``event_types``, é " +"alocado pelo usuário, mas preenchido por :c:func:`!PyMonitoring_EnterScope` " +"com informações sobre o estado de ativação do evento. O tamanho de " +"``event_types`` (e, portanto, também de ``state_array``) é fornecido em " +"``length``." + +#: ../../c-api/monitoring.rst:148 +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 "" +"O argumento ``version`` é um ponteiro para um valor que deve ser alocado " +"pelo usuário junto com ``state_array`` e inicializado como 0, e então " +"definido somente pelo próprio :c:func:`!PyMonitoring_EnterScope`. Ele " +"permite que esta função determine se os estados de eventos mudaram desde a " +"chamada anterior, e retorne rapidamente se não mudaram." + +#: ../../c-api/monitoring.rst:154 +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 "" +"Os escopos mencionados aqui são escopos lexicais: uma função, classe ou " +"método. :c:func:`!PyMonitoring_EnterScope` deve ser chamada sempre que o " +"escopo lexical for inserido. Os escopos podem ser inseridos novamente, " +"reutilizando o mesmo *state_array* e *version*, em situações como ao emular " +"uma função Python recursiva. Quando a execução de um código semelhante é " +"pausada, como ao emular um gerador, o escopo precisa ser encerrado e " +"inserido novamente." + +#: ../../c-api/monitoring.rst:161 +msgid "The macros for *event_types* are:" +msgstr "As macros para *event_types* são:" + +#: ../../c-api/monitoring.rst:169 +msgid "Macro" +msgstr "Macro" + +#: ../../c-api/monitoring.rst:169 +msgid "Event" +msgstr "Evento" + +#: ../../c-api/monitoring.rst:171 +msgid ":monitoring-event:`BRANCH`" +msgstr ":monitoring-event:`BRANCH`" + +#: ../../c-api/monitoring.rst:172 +msgid ":monitoring-event:`CALL`" +msgstr ":monitoring-event:`CALL`" + +#: ../../c-api/monitoring.rst:173 +msgid ":monitoring-event:`C_RAISE`" +msgstr ":monitoring-event:`C_RAISE`" + +#: ../../c-api/monitoring.rst:174 +msgid ":monitoring-event:`C_RETURN`" +msgstr ":monitoring-event:`C_RETURN`" + +#: ../../c-api/monitoring.rst:175 +msgid ":monitoring-event:`EXCEPTION_HANDLED`" +msgstr ":monitoring-event:`EXCEPTION_HANDLED`" + +#: ../../c-api/monitoring.rst:176 +msgid ":monitoring-event:`INSTRUCTION`" +msgstr ":monitoring-event:`INSTRUCTION`" + +#: ../../c-api/monitoring.rst:177 +msgid ":monitoring-event:`JUMP`" +msgstr ":monitoring-event:`JUMP`" + +#: ../../c-api/monitoring.rst:178 +msgid ":monitoring-event:`LINE`" +msgstr ":monitoring-event:`LINE`" + +#: ../../c-api/monitoring.rst:179 +msgid ":monitoring-event:`PY_RESUME`" +msgstr ":monitoring-event:`PY_RESUME`" + +#: ../../c-api/monitoring.rst:180 +msgid ":monitoring-event:`PY_RETURN`" +msgstr ":monitoring-event:`PY_RETURN`" + +#: ../../c-api/monitoring.rst:181 +msgid ":monitoring-event:`PY_START`" +msgstr ":monitoring-event:`PY_START`" + +#: ../../c-api/monitoring.rst:182 +msgid ":monitoring-event:`PY_THROW`" +msgstr ":monitoring-event:`PY_THROW`" + +#: ../../c-api/monitoring.rst:183 +msgid ":monitoring-event:`PY_UNWIND`" +msgstr ":monitoring-event:`PY_UNWIND`" + +#: ../../c-api/monitoring.rst:184 +msgid ":monitoring-event:`PY_YIELD`" +msgstr ":monitoring-event:`PY_YIELD`" + +#: ../../c-api/monitoring.rst:185 +msgid ":monitoring-event:`RAISE`" +msgstr ":monitoring-event:`RAISE`" + +#: ../../c-api/monitoring.rst:186 +msgid ":monitoring-event:`RERAISE`" +msgstr ":monitoring-event:`RERAISE`" + +#: ../../c-api/monitoring.rst:187 +msgid ":monitoring-event:`STOP_ITERATION`" +msgstr ":monitoring-event:`STOP_ITERATION`" + +#: ../../c-api/monitoring.rst:192 +msgid "" +"Exit the last scope that was entered with :c:func:`!PyMonitoring_EnterScope`." +msgstr "" +"Sai do último escopo no qual se entrou com :c:func:`!" +"PyMonitoring_EnterScope`." + +#: ../../c-api/monitoring.rst:197 +msgid "" +"Return true if the event corresponding to the event ID *ev* is a :ref:`local " +"event `." +msgstr "" +"Retorna verdadeiro se o evento correspondente ao ID do evento *ev* for " +"um :ref:`evento local `." diff --git a/c-api/none.po b/c-api/none.po index 96acc9fb0..429920d8f 100644 --- a/c-api/none.po +++ b/c-api/none.po @@ -1,26 +1,25 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2023 -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-31 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2025-09-15 15:19+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: python-doc bot, 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/number.po b/c-api/number.po index d266acc4f..1cdc52fe4 100644 --- a/c-api/number.po +++ b/c-api/number.po @@ -1,26 +1,28 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2024 -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 +# willian ohara, 2026 +# Lucas Silva, 2026 +# Rafael Fontenelle , 2026 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-19 14:16+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-13 21:57+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2026\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -77,6 +79,8 @@ msgid "" "Return the floor of *o1* divided by *o2*, or ``NULL`` on failure. This is " "the equivalent of the Python expression ``o1 // o2``." msgstr "" +"Retorna o piso de *o1* dividido por *o2* ou ``NULL`` em caso de falha. Isso " +"é equivalente à expressão Python ``o1 // o2``." #: ../../c-api/number.rst:52 msgid "" @@ -87,18 +91,28 @@ msgid "" "point value when passed two integers. This is the equivalent of the Python " "expression ``o1 / o2``." msgstr "" +"Retorna uma aproximação razoável para o valor matemático de *o1* dividido " +"por *o2*, ou ``NULL`` em caso de falha. O valor devolvido é \"aproximado\" " +"porque os números binários de ponto flutuante são aproximados; não é " +"possível representar todos os números reais na base dois. Esta função pode " +"devolver um valor de ponto flutuante quando lhe são passados dois inteiros. " +"Isso é o equivalente à expressão Python ``o1 / o2``." #: ../../c-api/number.rst:61 msgid "" "Returns the remainder of dividing *o1* by *o2*, or ``NULL`` on failure. " "This is the equivalent of the Python expression ``o1 % o2``." msgstr "" +"Retorna o resto da divisão de *o1* por *o2* ou ``NULL`` em caso de falha. " +"Isso é equivalente à expressão Python ``o1 % o2``." #: ../../c-api/number.rst:69 msgid "" "See the built-in function :func:`divmod`. Returns ``NULL`` on failure. This " "is the equivalent of the Python expression ``divmod(o1, o2)``." msgstr "" +"Consulte a função embutida :func:`divmod`. Retorna ``NULL`` em caso de " +"falha. Isso é equivalente à expressão Python ``divmod(o1, o2)``." #: ../../c-api/number.rst:77 msgid "" @@ -107,60 +121,84 @@ msgid "" "optional. If *o3* is to be ignored, pass :c:data:`Py_None` in its place " "(passing ``NULL`` for *o3* would cause an illegal memory access)." msgstr "" +"Consulte a função embutida :func:`pow`. Retorna ``NULL`` em caso de falha. " +"Isso é equivalente à expressão Python ``pow(o1, o2, o3)``, na qual *o3* é " +"opcional. Se *o3* deve ser ignorado, passe :c:data:`Py_None` em seu lugar " +"(passar ``NULL`` para *o3* causaria um acesso ilegal à memória)." #: ../../c-api/number.rst:85 msgid "" "Returns the negation of *o* on success, or ``NULL`` on failure. This is the " "equivalent of the Python expression ``-o``." msgstr "" +"Retorna a negação de *o* em caso de sucesso ou ``NULL`` em caso de falha. " +"Isso é equivalente à expressão Python ``-o``." #: ../../c-api/number.rst:91 msgid "" "Returns *o* on success, or ``NULL`` on failure. This is the equivalent of " "the Python expression ``+o``." msgstr "" +"Retorna *o* em caso de sucesso ou ``NULL`` em caso de falha. Isso é " +"equivalente à expressão Python ``+o``." #: ../../c-api/number.rst:99 msgid "" "Returns the absolute value of *o*, or ``NULL`` on failure. This is the " "equivalent of the Python expression ``abs(o)``." msgstr "" +"Retorna o valor absoluto de *o* ou ``NULL`` em caso de falha. Isso é " +"equivalente à expressão Python ``abs(o)``." #: ../../c-api/number.rst:105 msgid "" "Returns the bitwise negation of *o* on success, or ``NULL`` on failure. " "This is the equivalent of the Python expression ``~o``." msgstr "" +"Retorna a negação bit a bit de *o* em caso de sucesso, ou ``NULL`` em caso " +"de falha. Isso é equivalente à expressão Python ``~o``." #: ../../c-api/number.rst:111 msgid "" "Returns the result of left shifting *o1* by *o2* on success, or ``NULL`` on " "failure. This is the equivalent of the Python expression ``o1 << o2``." msgstr "" +"Retorna o resultado do deslocamento à esquerda de *o1* por *o2* em caso de " +"sucesso ou ``NULL`` em caso de falha. Isso é equivalente à expressão Python " +"``o1 << o2``." #: ../../c-api/number.rst:117 msgid "" "Returns the result of right shifting *o1* by *o2* on success, or ``NULL`` on " "failure. This is the equivalent of the Python expression ``o1 >> o2``." msgstr "" +"Retorna o resultado do deslocamento à direita de *o1* por *o2* em caso de " +"sucesso ou ``NULL`` em caso de falha. Isso é equivalente à expressão Python " +"``o1 >> o2``." #: ../../c-api/number.rst:123 msgid "" "Returns the \"bitwise and\" of *o1* and *o2* on success and ``NULL`` on " "failure. This is the equivalent of the Python expression ``o1 & o2``." msgstr "" +"Retorna o bit a bit \"e\" de *o1* e *o2* em caso de sucesso e ``NULL`` em " +"caso de falha. Isso é equivalente à expressão Python ``o1 & o2``." #: ../../c-api/number.rst:129 msgid "" "Returns the \"bitwise exclusive or\" of *o1* by *o2* on success, or ``NULL`` " "on failure. This is the equivalent of the Python expression ``o1 ^ o2``." msgstr "" +"Retorna o bit a bit \"ou exclusivo\" de *o1* por *o2* em caso de sucesso ou " +"``NULL`` em caso de falha. Isso é equivalente à expressão Python ``o1 ^ o2``." #: ../../c-api/number.rst:135 msgid "" "Returns the \"bitwise or\" of *o1* and *o2* on success, or ``NULL`` on " "failure. This is the equivalent of the Python expression ``o1 | o2``." msgstr "" +"Retorna o bit a bit \"ou\" de *o1* e *o2* em caso de sucesso ou ``NULL`` em " +"caso de falha. Isto é equivalente à expressão Python ``o1 | o2``." #: ../../c-api/number.rst:141 msgid "" @@ -168,6 +206,9 @@ msgid "" "operation is done *in-place* when *o1* supports it. This is the equivalent " "of the Python statement ``o1 += o2``." msgstr "" +"Retorna o resultado da adição de *o1* e *o2* ou ``NULL`` em caso de falha. A " +"operação é feita *no local* quando *o1* dá suporte a isso. Isto é " +"equivalente à instrução Python ``o1 += o2``." #: ../../c-api/number.rst:148 msgid "" @@ -175,6 +216,9 @@ msgid "" "The operation is done *in-place* when *o1* supports it. This is the " "equivalent of the Python statement ``o1 -= o2``." msgstr "" +"Retorna o resultado da subtração de *o2* de *o1* ou ``NULL`` em caso de " +"falha. A operação é feita *no local* quando *o1* dá suporte a isso. Isto é " +"equivalente à instrução Python ``o1 -= o2``." #: ../../c-api/number.rst:155 msgid "" @@ -182,6 +226,9 @@ msgid "" "The operation is done *in-place* when *o1* supports it. This is the " "equivalent of the Python statement ``o1 *= o2``." msgstr "" +"Retorna o resultado da multiplicação de *o1* e *o2* ou ``NULL`` em caso de " +"falha. A operação é feita *no local* quando *o1* dá suporte a isso. Isto é " +"equivalente à instrução Python ``o1 *= o2``." #: ../../c-api/number.rst:162 msgid "" @@ -189,6 +236,9 @@ msgid "" "failure. The operation is done *in-place* when *o1* supports it. This is " "the equivalent of the Python statement ``o1 @= o2``." msgstr "" +"Retorna o resultado da multiplicação de matrizes entre *o1* e *o2*, ou " +"``NULL`` em caso de falha. A operação é realizada no local quando *o1* " +"oferece suporte a isso. Isso é equivalente à instrução Python ``o1 @= o2``." #: ../../c-api/number.rst:171 msgid "" @@ -196,6 +246,9 @@ msgid "" "failure. The operation is done *in-place* when *o1* supports it. This is " "the equivalent of the Python statement ``o1 //= o2``." msgstr "" +"Retorna o valor matemático mínimo da divisão de *o1* por *o2* ou ``NULL`` em " +"caso de falha. A operação é feita *no local* quando *o1* dá suporte a isso. " +"Isto é equivalente à instrução Python ``o1 //= o2``." #: ../../c-api/number.rst:178 msgid "" @@ -207,6 +260,13 @@ msgid "" "*o1* supports it. This is the equivalent of the Python statement ``o1 /= " "o2``." msgstr "" +"Retorna uma aproximação razoável para o valor matemático de *o1* dividido " +"por *o2*, ou ``NULL`` em caso de falha. O valor de retorno é \"aproximado\" " +"porque os números binários de ponto flutuante são aproximados; não é " +"possível representar todos os números reais na base dois. Esta função pode " +"retornar um valor de ponto flutuante quando lhe são passados dois inteiros. " +"A operação é feita no local quando *o1* oferece suporte a isso. Isso é o " +"equivalente à instrução Python ``o1 /= o2``." #: ../../c-api/number.rst:188 msgid "" @@ -214,6 +274,9 @@ msgid "" "operation is done *in-place* when *o1* supports it. This is the equivalent " "of the Python statement ``o1 %= o2``." msgstr "" +"Retorna o resto da divisão de *o1* por *o2* ou ``NULL`` em caso de falha. A " +"operação é feita *no local* quando *o1* dá suporte a isso. Isto é " +"equivalente à instrução Python ``o1 %= o2``." #: ../../c-api/number.rst:197 msgid "" @@ -224,6 +287,12 @@ msgid "" "pass :c:data:`Py_None` in its place (passing ``NULL`` for *o3* would cause " "an illegal memory access)." msgstr "" +"Consulte a função embutida :func:`pow`. Retorna ``NULL`` em caso de falha. A " +"operação é feita no lugar quando *o1* oferece suporte a isso. Isso é " +"equivalente à instrução Python ``o1 **= o2`` quando o3 é :c:data:`Py_None` " +"ou, do contrário, uma variante no local ``pow(o1, o2, o3)``. Se *o3* deve " +"ser ignorado, passe :c:data:`Py_None` em seu lugar (passar ``NULL`` para " +"*o3* causaria um acesso ilegal à memória)." #: ../../c-api/number.rst:206 msgid "" @@ -231,6 +300,10 @@ msgid "" "failure. The operation is done *in-place* when *o1* supports it. This is " "the equivalent of the Python statement ``o1 <<= o2``." msgstr "" +"Retorna o resultado do deslocamento à esquerda de *o1* por *o2* em caso de " +"sucesso, ou ``NULL`` em caso de falha. A operação é feita no local quando " +"*o1* oferece suporte a isso. Isto é equivalente à instrução Python ``o1 <<= " +"o2``." #: ../../c-api/number.rst:213 msgid "" @@ -238,6 +311,10 @@ msgid "" "failure. The operation is done *in-place* when *o1* supports it. This is " "the equivalent of the Python statement ``o1 >>= o2``." msgstr "" +"Retorna o resultado do deslocamento à direita de *o1* por *o2* em caso de " +"sucesso, ou ``NULL`` em caso de falha. A operação é feita no local quando " +"*o1* oferece suporte a isso. Isto é equivalente à instrução Python ``o1 >>= " +"o2``." #: ../../c-api/number.rst:220 msgid "" @@ -245,6 +322,9 @@ msgid "" "failure. The operation is done *in-place* when *o1* supports it. This is " "the equivalent of the Python statement ``o1 &= o2``." msgstr "" +"Retorna o \"bitwise and\" de *o1* e *o2* em caso de sucesso e ``NULL`` em " +"caso de falha. A operação é feita no local quando *o1* oferece suporte a " +"isso. Isto é equivalente à instrução Python ``o1 &= o2``." #: ../../c-api/number.rst:227 msgid "" @@ -252,6 +332,9 @@ msgid "" "on failure. The operation is done *in-place* when *o1* supports it. This " "is the equivalent of the Python statement ``o1 ^= o2``." msgstr "" +"Retorna o \"bitwise exclusive or\" de *o1* por *o2* em caso de sucesso, ou " +"``NULL`` em caso de falha. A operação é feita no local quando *o1* oferece " +"suporte a isso. Isto é equivalente à instrução Python ``o1 ^= o2``." #: ../../c-api/number.rst:234 msgid "" @@ -259,24 +342,33 @@ msgid "" "failure. The operation is done *in-place* when *o1* supports it. This is " "the equivalent of the Python statement ``o1 |= o2``." msgstr "" +"Retorna o \"bitwise or\" de *o1* e *o2* em caso de sucesso, ou ``NULL`` em " +"caso de falha. A operação é feita no local quando *o1* oferece suporte a " +"isso. Isto é equivalente à instrução Python ``o1 |= o2``." #: ../../c-api/number.rst:243 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)``." msgstr "" +"Retorna o *o* convertido para um objeto inteiro em caso de sucesso ou " +"``NULL`` em caso de falha. Isto é equivalente à expressão Python ``int(o)``." #: ../../c-api/number.rst:251 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)``." msgstr "" +"Retorna o *o* convertido para um objeto float em caso de sucesso ou ``NULL`` " +"em caso de falha. Isto é equivalente à expressão Python ``float(o)``." #: ../../c-api/number.rst:257 msgid "" -"Returns the *o* converted to a Python int on success or ``NULL`` with a :exc:" -"`TypeError` exception raised on failure." +"Returns the *o* converted to a Python int on success or ``NULL`` with " +"a :exc:`TypeError` exception raised on failure." msgstr "" +"Retorna *o* convertido para int Python em caso de sucesso ou ``NULL`` com " +"um :exc:`TypeError` exceção levantada ao falhar." #: ../../c-api/number.rst:260 msgid "" @@ -291,9 +383,14 @@ 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 " "string is prefixed with a base marker of ``'0b'``, ``'0o'``, or ``'0x'``, " -"respectively. If *n* is not a Python int, it is converted with :c:func:" -"`PyNumber_Index` first." +"respectively. If *n* is not a Python int, it is converted " +"with :c:func:`PyNumber_Index` first." msgstr "" +"Retorna o inteiro *n* convertido para a base *base* como uma string. O " +"argumento *base* deve ser 2, 8, 10 ou 16. Para as bases 2, 8 ou 16, a string " +"retornada é prefixada com um marcador de base ``'0b'``, ``'0o'`` ou " +"``'0x'``, respectivamente. Se *n* não for um inteiro Python, ele é " +"convertido primeiro com :c:func:`PyNumber_Index`." #: ../../c-api/number.rst:276 msgid "" @@ -301,16 +398,26 @@ msgid "" "interpreted as an integer. If the call fails, an exception is raised and " "``-1`` is returned." msgstr "" +"Retorna *o* convertido para um valor :c:type:`Py_ssize_t` se *o* puder ser " +"interpretado como um inteiro. Se a chamada falhar, uma exceção é levantada e " +"``-1`` é retornado." #: ../../c-api/number.rst:279 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* " -"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 "" +"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* 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 "" +"Se *o* puder ser convertido para um int Python, mas a tentativa de conversão " +"para um valor :c:type:`Py_ssize_t` levantar um :exc:`OverflowError`, então o " +"argumento *exc* é o tipo de exceção que será gerada " +"(geralmente :exc:`IndexError` ou :exc:`OverflowError`). Se *exc* for " +"``NULL``, então a exceção é limpa e o valor é cortado para " +"``PY_SSIZE_T_MIN`` para um inteiro negativo ou ``PY_SSIZE_T_MAX`` para um " +"inteiro positivo." #: ../../c-api/number.rst:289 msgid "" @@ -318,6 +425,9 @@ msgid "" "``tp_as_number`` structure filled in), and ``0`` otherwise. This function " "always succeeds." msgstr "" +"Retorna ``1`` se *o* for um índice inteiro (tem o slot ``nb_index`` da " +"estrutura ``tp_as_number`` preenchido) e ``0`` caso contrário. Esta função " +"sempre tem sucesso." #: ../../c-api/number.rst:67 ../../c-api/number.rst:75 #: ../../c-api/number.rst:97 ../../c-api/number.rst:195 @@ -327,15 +437,15 @@ msgstr "função embutida" #: ../../c-api/number.rst:67 msgid "divmod" -msgstr "" +msgstr "divmod" #: ../../c-api/number.rst:75 ../../c-api/number.rst:195 msgid "pow" -msgstr "" +msgstr "pow" #: ../../c-api/number.rst:97 msgid "abs" -msgstr "" +msgstr "abs" #: ../../c-api/number.rst:241 msgid "int" diff --git a/c-api/object.po b/c-api/object.po index 8ee517abe..7aec5140f 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -1,29 +1,25 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Marco Rougeth , 2024 -# Vitor Buxbaum Orlandi, 2024 -# Claudio Rogerio Carvalho Filho , 2024 -# Welington Carlos , 2024 -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-19 14:16+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: python-doc bot, 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -148,8 +144,8 @@ msgstr "" #: ../../c-api/object.rst:50 msgid "" -"This function is primarily intended for backwards compatibility: using :c:" -"func:`Py_GetConstant` is recommended for new code." +"This function is primarily intended for backwards compatibility: " +"using :c:func:`Py_GetConstant` is recommended for new code." msgstr "" "Esta função destina-se principalmente à compatibilidade com versões " "anteriores: usar :c:func:`Py_GetConstant` é recomendado para novo código." @@ -173,22 +169,20 @@ msgstr "" #: ../../c-api/object.rst:67 msgid "" "Properly handle returning :c:data:`Py_NotImplemented` from within a C " -"function (that is, create a new :term:`strong reference` to :const:" -"`NotImplemented` and return it)." +"function (that is, create a new :term:`strong reference` " +"to :const:`NotImplemented` and return it)." msgstr "" "Manipula adequadamente o retorno de :c:data:`Py_NotImplemented` de dentro de " -"uma função C (ou seja, cria uma nova :term:`referência forte` para :const:" -"`NotImplemented` e retorna-a)." +"uma função C (ou seja, cria uma nova :term:`referência forte` " +"para :const:`NotImplemented` e retorna-a)." #: ../../c-api/object.rst:74 msgid "" -"Flag to be used with multiple functions that print the object (like :c:func:" -"`PyObject_Print` and :c:func:`PyFile_WriteObject`). If passed, these " -"function would use the :func:`str` of the object instead of the :func:`repr`." +"Flag to be used with multiple functions that print the object " +"(like :c:func:`PyObject_Print` and :c:func:`PyFile_WriteObject`). If passed, " +"these functions use the :func:`str` of the object instead of " +"the :func:`repr`." msgstr "" -"Sinaliza a ser usado com múltiplas funções que imprimem o objeto (como :c:" -"func:`PyObject_Print` e :c:func:`PyFile_WriteObject`). Se passada, esta " -"função usaria o :func:`str` do objeto em vez do :func:`repr`." #: ../../c-api/object.rst:82 msgid "" @@ -220,124 +214,128 @@ msgstr "" #: ../../c-api/object.rst:113 msgid "" -"Exceptions that occur when this calls :meth:`~object.__getattr__` and :meth:" -"`~object.__getattribute__` methods are silently ignored. For proper error " -"handling, use :c:func:`PyObject_HasAttrWithError`, :c:func:" -"`PyObject_GetOptionalAttr` or :c:func:`PyObject_GetAttr` instead." +"Exceptions that occur when this calls :meth:`~object.__getattr__` " +"and :meth:`~object.__getattribute__` methods aren't propagated, but instead " +"given to :func:`sys.unraisablehook`. For proper error handling, " +"use :c:func:`PyObject_HasAttrWithError`, :c:func:`PyObject_GetOptionalAttr` " +"or :c:func:`PyObject_GetAttr` instead." msgstr "" -#: ../../c-api/object.rst:121 +#: ../../c-api/object.rst:122 msgid "" "This is the same as :c:func:`PyObject_HasAttr`, but *attr_name* is specified " -"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" -"`PyObject*`." +"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than " +"a :c:expr:`PyObject*`." msgstr "" -#: ../../c-api/object.rst:127 +#: ../../c-api/object.rst:128 msgid "" -"Exceptions that occur when this calls :meth:`~object.__getattr__` and :meth:" -"`~object.__getattribute__` methods or while creating the temporary :class:" -"`str` object are silently ignored. For proper error handling, use :c:func:" -"`PyObject_HasAttrStringWithError`, :c:func:`PyObject_GetOptionalAttrString` " +"Exceptions that occur when this calls :meth:`~object.__getattr__` " +"and :meth:`~object.__getattribute__` methods or while creating the " +"temporary :class:`str` object are silently ignored. For proper error " +"handling, " +"use :c:func:`PyObject_HasAttrStringWithError`, :c:func:`PyObject_GetOptionalAttrString` " "or :c:func:`PyObject_GetAttrString` instead." msgstr "" -#: ../../c-api/object.rst:137 +#: ../../c-api/object.rst:138 msgid "" "Retrieve an attribute named *attr_name* from object *o*. Returns the " "attribute value on success, or ``NULL`` on failure. This is the equivalent " "of the Python expression ``o.attr_name``." msgstr "" -#: ../../c-api/object.rst:141 +#: ../../c-api/object.rst:142 msgid "" -"If the missing attribute should not be treated as a failure, you can use :c:" -"func:`PyObject_GetOptionalAttr` instead." +"If the missing attribute should not be treated as a failure, you can " +"use :c:func:`PyObject_GetOptionalAttr` instead." msgstr "" -#: ../../c-api/object.rst:147 +#: ../../c-api/object.rst:148 msgid "" "This is the same as :c:func:`PyObject_GetAttr`, but *attr_name* is specified " -"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" -"`PyObject*`." +"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than " +"a :c:expr:`PyObject*`." msgstr "" -#: ../../c-api/object.rst:151 +#: ../../c-api/object.rst:152 msgid "" -"If the missing attribute should not be treated as a failure, you can use :c:" -"func:`PyObject_GetOptionalAttrString` instead." +"If the missing attribute should not be treated as a failure, you can " +"use :c:func:`PyObject_GetOptionalAttrString` instead." msgstr "" -#: ../../c-api/object.rst:157 +#: ../../c-api/object.rst:158 msgid "" -"Variant of :c:func:`PyObject_GetAttr` which doesn't raise :exc:" -"`AttributeError` if the attribute is not found." +"Variant of :c:func:`PyObject_GetAttr` which doesn't " +"raise :exc:`AttributeError` if the attribute is not found." msgstr "" -#: ../../c-api/object.rst:160 +#: ../../c-api/object.rst:161 msgid "" -"If the attribute is found, return ``1`` and set *\\*result* to a new :term:" -"`strong reference` to the attribute. If the attribute is not found, return " -"``0`` and set *\\*result* to ``NULL``; the :exc:`AttributeError` is " -"silenced. If an error other than :exc:`AttributeError` is raised, return " -"``-1`` and set *\\*result* to ``NULL``." +"If the attribute is found, return ``1`` and set *\\*result* to a " +"new :term:`strong reference` to the attribute. If the attribute is not " +"found, return ``0`` and set *\\*result* to ``NULL``; " +"the :exc:`AttributeError` is silenced. If an error other " +"than :exc:`AttributeError` is raised, return ``-1`` and set *\\*result* to " +"``NULL``." msgstr "" -#: ../../c-api/object.rst:172 +#: ../../c-api/object.rst:173 msgid "" "This is the same as :c:func:`PyObject_GetOptionalAttr`, but *attr_name* is " "specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than " "a :c:expr:`PyObject*`." msgstr "" -#: ../../c-api/object.rst:180 +#: ../../c-api/object.rst:181 msgid "" "Generic attribute getter function that is meant to be put into a type " "object's ``tp_getattro`` slot. It looks for a descriptor in the dictionary " -"of classes in the object's MRO as well as an attribute in the object's :attr:" -"`~object.__dict__` (if present). As outlined in :ref:`descriptors`, data " -"descriptors take preference over instance attributes, while non-data " -"descriptors don't. Otherwise, an :exc:`AttributeError` is raised." +"of classes in the object's MRO as well as an attribute in the " +"object's :attr:`~object.__dict__` (if present). As outlined " +"in :ref:`descriptors`, data descriptors take preference over instance " +"attributes, while non-data descriptors don't. Otherwise, " +"an :exc:`AttributeError` is raised." msgstr "" -#: ../../c-api/object.rst:190 +#: ../../c-api/object.rst:191 msgid "" "Set the value of the attribute named *attr_name*, for object *o*, to the " "value *v*. Raise an exception and return ``-1`` on failure; return ``0`` on " "success. This is the equivalent of the Python statement ``o.attr_name = v``." msgstr "" -#: ../../c-api/object.rst:195 +#: ../../c-api/object.rst:196 msgid "" "If *v* is ``NULL``, the attribute is deleted. This behaviour is deprecated " "in favour of using :c:func:`PyObject_DelAttr`, but there are currently no " "plans to remove it." msgstr "" -#: ../../c-api/object.rst:202 +#: ../../c-api/object.rst:203 msgid "" "This is the same as :c:func:`PyObject_SetAttr`, but *attr_name* is specified " -"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" -"`PyObject*`." +"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than " +"a :c:expr:`PyObject*`." msgstr "" -#: ../../c-api/object.rst:206 +#: ../../c-api/object.rst:207 msgid "" "If *v* is ``NULL``, the attribute is deleted, but this feature is deprecated " "in favour of using :c:func:`PyObject_DelAttrString`." msgstr "" -#: ../../c-api/object.rst:209 +#: ../../c-api/object.rst:210 msgid "" "The number of different attribute names passed to this function should be " "kept small, usually by using a statically allocated string as *attr_name*. " -"For attribute names that aren't known at compile time, prefer calling :c:" -"func:`PyUnicode_FromString` and :c:func:`PyObject_SetAttr` directly. For " -"more details, see :c:func:`PyUnicode_InternFromString`, which may be used " -"internally to create a key object." +"For attribute names that aren't known at compile time, prefer " +"calling :c:func:`PyUnicode_FromString` and :c:func:`PyObject_SetAttr` " +"directly. For more details, see :c:func:`PyUnicode_InternFromString`, which " +"may be used internally to create a key object." msgstr "" -#: ../../c-api/object.rst:219 +#: ../../c-api/object.rst:220 msgid "" "Generic attribute setter and deleter function that is meant to be put into a " "type object's :c:member:`~PyTypeObject.tp_setattro` slot. It looks for a " @@ -349,36 +347,36 @@ msgid "" "returned." msgstr "" -#: ../../c-api/object.rst:231 +#: ../../c-api/object.rst:232 msgid "" "Delete attribute named *attr_name*, for object *o*. Returns ``-1`` on " "failure. This is the equivalent of the Python statement ``del o.attr_name``." msgstr "" -#: ../../c-api/object.rst:237 +#: ../../c-api/object.rst:238 msgid "" "This is the same as :c:func:`PyObject_DelAttr`, but *attr_name* is specified " -"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" -"`PyObject*`." +"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than " +"a :c:expr:`PyObject*`." msgstr "" -#: ../../c-api/object.rst:241 +#: ../../c-api/object.rst:242 msgid "" "The number of different attribute names passed to this function should be " "kept small, usually by using a statically allocated string as *attr_name*. " -"For attribute names that aren't known at compile time, prefer calling :c:" -"func:`PyUnicode_FromString` and :c:func:`PyObject_DelAttr` directly. For " -"more details, see :c:func:`PyUnicode_InternFromString`, which may be used " -"internally to create a key object for lookup." +"For attribute names that aren't known at compile time, prefer " +"calling :c:func:`PyUnicode_FromString` and :c:func:`PyObject_DelAttr` " +"directly. For more details, see :c:func:`PyUnicode_InternFromString`, which " +"may be used internally to create a key object for lookup." msgstr "" -#: ../../c-api/object.rst:252 +#: ../../c-api/object.rst:253 msgid "" "A generic implementation for the getter of a ``__dict__`` descriptor. It " "creates the dictionary if necessary." msgstr "" -#: ../../c-api/object.rst:255 +#: ../../c-api/object.rst:256 msgid "" "This function may also be called to get the :py:attr:`~object.__dict__` of " "the object *o*. Pass ``NULL`` for *context* when calling it. Since this " @@ -387,67 +385,67 @@ msgid "" "the object." msgstr "" -#: ../../c-api/object.rst:261 +#: ../../c-api/object.rst:262 msgid "On failure, returns ``NULL`` with an exception set." msgstr "" -#: ../../c-api/object.rst:268 +#: ../../c-api/object.rst:269 msgid "" "A generic implementation for the setter of a ``__dict__`` descriptor. This " "implementation does not allow the dictionary to be deleted." msgstr "" -#: ../../c-api/object.rst:276 +#: ../../c-api/object.rst:277 msgid "" "Return a pointer to :py:attr:`~object.__dict__` of the object *obj*. If " "there is no ``__dict__``, return ``NULL`` without setting an exception." msgstr "" -#: ../../c-api/object.rst:279 +#: ../../c-api/object.rst:280 msgid "" "This function may need to allocate memory for the dictionary, so it may be " "more efficient to call :c:func:`PyObject_GetAttr` when accessing an " "attribute on the object." msgstr "" -#: ../../c-api/object.rst:286 +#: ../../c-api/object.rst:287 msgid "" "Compare the values of *o1* and *o2* using the operation specified by *opid*, " -"which must be one of :c:macro:`Py_LT`, :c:macro:`Py_LE`, :c:macro:`Py_EQ`, :" -"c:macro:`Py_NE`, :c:macro:`Py_GT`, or :c:macro:`Py_GE`, corresponding to " -"``<``, ``<=``, ``==``, ``!=``, ``>``, or ``>=`` respectively. This is the " -"equivalent of the Python expression ``o1 op o2``, where ``op`` is the " -"operator corresponding to *opid*. Returns the value of the comparison on " -"success, or ``NULL`` on failure." +"which must be one " +"of :c:macro:`Py_LT`, :c:macro:`Py_LE`, :c:macro:`Py_EQ`, :c:macro:`Py_NE`, :c:macro:`Py_GT`, " +"or :c:macro:`Py_GE`, corresponding to ``<``, ``<=``, ``==``, ``!=``, ``>``, " +"or ``>=`` respectively. This is the equivalent of the Python expression ``o1 " +"op o2``, where ``op`` is the operator corresponding to *opid*. Returns the " +"value of the comparison on success, or ``NULL`` on failure." msgstr "" -#: ../../c-api/object.rst:296 +#: ../../c-api/object.rst:297 msgid "" "Compare the values of *o1* and *o2* using the operation specified by *opid*, " "like :c:func:`PyObject_RichCompare`, but returns ``-1`` on error, ``0`` if " "the result is false, ``1`` otherwise." msgstr "" -#: ../../c-api/object.rst:301 +#: ../../c-api/object.rst:302 msgid "" "If *o1* and *o2* are the same object, :c:func:`PyObject_RichCompareBool` " "will always return ``1`` for :c:macro:`Py_EQ` and ``0`` for :c:macro:`Py_NE`." msgstr "" -#: ../../c-api/object.rst:306 +#: ../../c-api/object.rst:307 msgid "" "Format *obj* using *format_spec*. This is equivalent to the Python " "expression ``format(obj, format_spec)``." msgstr "" -#: ../../c-api/object.rst:309 +#: ../../c-api/object.rst:310 msgid "" "*format_spec* may be ``NULL``. In this case the call is equivalent to " "``format(obj)``. Returns the formatted string on success, ``NULL`` on " "failure." msgstr "" -#: ../../c-api/object.rst:317 +#: ../../c-api/object.rst:318 msgid "" "Compute a string representation of object *o*. Returns the string " "representation on success, ``NULL`` on failure. This is the equivalent of " @@ -455,7 +453,12 @@ msgid "" "function." msgstr "" -#: ../../c-api/object.rst:321 ../../c-api/object.rst:345 +#: ../../c-api/object.rst:322 ../../c-api/object.rst:338 +#: ../../c-api/object.rst:350 +msgid "If argument is ``NULL``, return the string ``''``." +msgstr "" + +#: ../../c-api/object.rst:324 ../../c-api/object.rst:352 msgid "" "This function now includes a debug assertion to help ensure that it does not " "silently discard an active exception." @@ -463,16 +466,16 @@ msgstr "" "Essa função agora inclui uma asserção de depuração para ajudar a garantir " "que ela não descarte silenciosamente uma exceção ativa." -#: ../../c-api/object.rst:329 +#: ../../c-api/object.rst:332 msgid "" "As :c:func:`PyObject_Repr`, compute a string representation of object *o*, " -"but escape the non-ASCII characters in the string returned by :c:func:" -"`PyObject_Repr` with ``\\x``, ``\\u`` or ``\\U`` escapes. This generates a " -"string similar to that returned by :c:func:`PyObject_Repr` in Python 2. " -"Called by the :func:`ascii` built-in function." +"but escape the non-ASCII characters in the string returned " +"by :c:func:`PyObject_Repr` with ``\\x``, ``\\u`` or ``\\U`` escapes. This " +"generates a string similar to that returned by :c:func:`PyObject_Repr` in " +"Python 2. Called by the :func:`ascii` built-in function." msgstr "" -#: ../../c-api/object.rst:340 +#: ../../c-api/object.rst:345 msgid "" "Compute a string representation of object *o*. Returns the string " "representation on success, ``NULL`` on failure. This is the equivalent of " @@ -480,7 +483,7 @@ msgid "" "function and, therefore, by the :func:`print` function." msgstr "" -#: ../../c-api/object.rst:354 +#: ../../c-api/object.rst:361 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 " @@ -489,73 +492,78 @@ msgid "" "bytes object." msgstr "" -#: ../../c-api/object.rst:363 +#: ../../c-api/object.rst:367 +msgid "" +"If argument is ``NULL``, return the :class:`bytes` object ``b''``." +msgstr "" + +#: ../../c-api/object.rst:372 msgid "" "Return ``1`` if the class *derived* is identical to or derived from the " "class *cls*, otherwise return ``0``. In case of an error, return ``-1``." msgstr "" -#: ../../c-api/object.rst:366 ../../c-api/object.rst:385 +#: ../../c-api/object.rst:375 ../../c-api/object.rst:394 msgid "" "If *cls* is a tuple, the check will be done against every entry in *cls*. " "The result will be ``1`` when at least one of the checks returns ``1``, " "otherwise it will be ``0``." msgstr "" -#: ../../c-api/object.rst:370 +#: ../../c-api/object.rst:379 msgid "" -"If *cls* has a :meth:`~class.__subclasscheck__` method, it will be called to " +"If *cls* has a :meth:`~type.__subclasscheck__` method, it will be called to " "determine the subclass status as described in :pep:`3119`. Otherwise, " -"*derived* is a subclass of *cls* if it is a direct or indirect subclass, i." -"e. contained in ``cls.__mro__``." +"*derived* is a subclass of *cls* if it is a direct or indirect subclass, " +"i.e. contained in :attr:`cls.__mro__ `." msgstr "" -#: ../../c-api/object.rst:375 +#: ../../c-api/object.rst:384 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:`~class.__bases__` attribute (which must be a tuple of base classes)." +"a :attr:`~type.__bases__` attribute (which must be a tuple of base classes)." msgstr "" -#: ../../c-api/object.rst:382 +#: ../../c-api/object.rst:391 msgid "" "Return ``1`` if *inst* is an instance of the class *cls* or a subclass of " "*cls*, or ``0`` if not. On error, returns ``-1`` and sets an exception." msgstr "" -#: ../../c-api/object.rst:389 +#: ../../c-api/object.rst:398 msgid "" -"If *cls* has a :meth:`~class.__instancecheck__` method, it will be called to " +"If *cls* has a :meth:`~type.__instancecheck__` method, it will be called to " "determine the subclass status as described in :pep:`3119`. Otherwise, " "*inst* is an instance of *cls* if its class is a subclass of *cls*." msgstr "" -#: ../../c-api/object.rst:393 +#: ../../c-api/object.rst:402 msgid "" -"An instance *inst* can override what is considered its class by having a :" -"attr:`~instance.__class__` attribute." +"An instance *inst* can override what is considered its class by having " +"a :attr:`~object.__class__` attribute." msgstr "" -#: ../../c-api/object.rst:396 +#: ../../c-api/object.rst:405 msgid "" "An object *cls* can override if it is considered a class, and what its base " -"classes are, by having a :attr:`~class.__bases__` attribute (which must be a " +"classes are, by having a :attr:`~type.__bases__` attribute (which must be a " "tuple of base classes)." msgstr "" -#: ../../c-api/object.rst:405 +#: ../../c-api/object.rst:414 msgid "" "Compute and return the hash value of an object *o*. On failure, return " "``-1``. This is the equivalent of the Python expression ``hash(o)``." msgstr "" -#: ../../c-api/object.rst:408 +#: ../../c-api/object.rst:417 msgid "" "The return type is now Py_hash_t. This is a signed integer the same size " "as :c:type:`Py_ssize_t`." msgstr "" -#: ../../c-api/object.rst:415 +#: ../../c-api/object.rst:424 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 " @@ -563,21 +571,21 @@ msgid "" "that it is not hashable." msgstr "" -#: ../../c-api/object.rst:423 +#: ../../c-api/object.rst:432 msgid "" "Returns ``1`` if the object *o* is considered to be true, and ``0`` " "otherwise. This is equivalent to the Python expression ``not not o``. On " "failure, return ``-1``." msgstr "" -#: ../../c-api/object.rst:430 +#: ../../c-api/object.rst:439 msgid "" "Returns ``0`` if the object *o* is considered to be true, and ``1`` " "otherwise. This is equivalent to the Python expression ``not o``. On " "failure, return ``-1``." msgstr "" -#: ../../c-api/object.rst:439 +#: ../../c-api/object.rst:448 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 " @@ -588,13 +596,13 @@ msgid "" "when a new :term:`strong reference` is needed." msgstr "" -#: ../../c-api/object.rst:451 +#: ../../c-api/object.rst:460 msgid "" "Return non-zero if the object *o* is of type *type* or a subtype of *type*, " "and ``0`` otherwise. Both parameters must be non-``NULL``." msgstr "" -#: ../../c-api/object.rst:460 +#: ../../c-api/object.rst:469 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, " @@ -602,7 +610,7 @@ msgid "" "``len(o)``." msgstr "" -#: ../../c-api/object.rst:467 +#: ../../c-api/object.rst:476 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 " @@ -611,36 +619,46 @@ msgid "" "defaultvalue)``." msgstr "" -#: ../../c-api/object.rst:477 +#: ../../c-api/object.rst:486 msgid "" "Return element of *o* corresponding to the object *key* or ``NULL`` on " "failure. This is the equivalent of the Python expression ``o[key]``." msgstr "" -#: ../../c-api/object.rst:483 +#: ../../c-api/object.rst:492 msgid "" "Map the object *key* to the value *v*. Raise an exception and return ``-1`` " "on failure; return ``0`` on success. This is the equivalent of the Python " "statement ``o[key] = v``. This function *does not* steal a reference to *v*." msgstr "" -#: ../../c-api/object.rst:491 +#: ../../c-api/object.rst:500 msgid "" "Remove the mapping for the object *key* from the object *o*. Return ``-1`` " "on failure. This is equivalent to the Python statement ``del o[key]``." msgstr "" -#: ../../c-api/object.rst:497 +#: ../../c-api/object.rst:506 +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 "" +"É o mesmo que :c:func:`PyObject_DelItem`, mas *key* é especificada como uma " +"string de bytes :c:expr:`const char*` codificada em UTF-8, em vez de " +"um :c:expr:`PyObject*`." + +#: ../../c-api/object.rst:513 msgid "" "This is equivalent to the Python expression ``dir(o)``, returning a " "(possibly empty) list of strings appropriate for the object argument, or " "``NULL`` if there was an error. If the argument is ``NULL``, this is like " "the Python ``dir()``, returning the names of the current locals; in this " -"case, if no execution frame is active then ``NULL`` is returned but :c:func:" -"`PyErr_Occurred` will return false." +"case, if no execution frame is active then ``NULL`` is returned " +"but :c:func:`PyErr_Occurred` will return false." msgstr "" -#: ../../c-api/object.rst:506 +#: ../../c-api/object.rst:522 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 " @@ -648,113 +666,126 @@ msgid "" "object cannot be iterated." msgstr "" -#: ../../c-api/object.rst:514 +#: ../../c-api/object.rst:530 msgid "" -"This is the equivalent to the Python expression ``aiter(o)``. Takes an :" -"class:`AsyncIterable` object and returns an :class:`AsyncIterator` for it. " -"This is typically a new iterator but if the argument is an :class:" -"`AsyncIterator`, this returns itself. Raises :exc:`TypeError` and returns " -"``NULL`` if the object cannot be iterated." +"This is equivalent to the Python ``__iter__(self): return self`` method. It " +"is intended for :term:`iterator` types, to be used in " +"the :c:member:`PyTypeObject.tp_iter` slot." msgstr "" -#: ../../c-api/object.rst:524 +#: ../../c-api/object.rst:536 +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:546 msgid "Get a pointer to subclass-specific data reserved for *cls*." msgstr "" -#: ../../c-api/object.rst:526 +#: ../../c-api/object.rst:548 msgid "" "The object *o* must be an instance of *cls*, and *cls* must have been " "created using negative :c:member:`PyType_Spec.basicsize`. Python does not " "check this." msgstr "" -#: ../../c-api/object.rst:530 +#: ../../c-api/object.rst:552 msgid "On error, set an exception and return ``NULL``." msgstr "" -#: ../../c-api/object.rst:536 +#: ../../c-api/object.rst:558 msgid "" "Return the size of the instance memory space reserved for *cls*, i.e. the " "size of the memory :c:func:`PyObject_GetTypeData` returns." msgstr "" -#: ../../c-api/object.rst:539 +#: ../../c-api/object.rst:561 msgid "" "This may be larger than requested using :c:member:`-PyType_Spec.basicsize " -"`; it is safe to use this larger size (e.g. with :c:" -"func:`!memset`)." +"`; it is safe to use this larger size (e.g. " +"with :c:func:`!memset`)." msgstr "" -#: ../../c-api/object.rst:542 +#: ../../c-api/object.rst:564 msgid "" -"The type *cls* **must** have been created using negative :c:member:" -"`PyType_Spec.basicsize`. Python does not check this." +"The type *cls* **must** have been created using " +"negative :c:member:`PyType_Spec.basicsize`. Python does not check this." msgstr "" -#: ../../c-api/object.rst:546 +#: ../../c-api/object.rst:568 msgid "On error, set an exception and return a negative value." msgstr "" -#: ../../c-api/object.rst:552 +#: ../../c-api/object.rst:574 msgid "" -"Get a pointer to per-item data for a class with :c:macro:" -"`Py_TPFLAGS_ITEMS_AT_END`." +"Get a pointer to per-item data for a class " +"with :c:macro:`Py_TPFLAGS_ITEMS_AT_END`." msgstr "" -#: ../../c-api/object.rst:555 +#: ../../c-api/object.rst:577 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:563 +#: ../../c-api/object.rst:585 msgid "Visit the managed dictionary of *obj*." msgstr "" -#: ../../c-api/object.rst:565 ../../c-api/object.rst:574 +#: ../../c-api/object.rst:587 msgid "" "This function must only be called in a traverse function of the type which " "has the :c:macro:`Py_TPFLAGS_MANAGED_DICT` flag set." msgstr "" -#: ../../c-api/object.rst:572 +#: ../../c-api/object.rst:594 msgid "Clear the managed dictionary of *obj*." msgstr "" -#: ../../c-api/object.rst:315 ../../c-api/object.rst:327 -#: ../../c-api/object.rst:352 ../../c-api/object.rst:403 -#: ../../c-api/object.rst:437 ../../c-api/object.rst:458 +#: ../../c-api/object.rst:596 +msgid "" +"This function must only be called in a clear function of the type which has " +"the :c:macro:`Py_TPFLAGS_MANAGED_DICT` flag set." +msgstr "" + +#: ../../c-api/object.rst:316 ../../c-api/object.rst:330 +#: ../../c-api/object.rst:359 ../../c-api/object.rst:412 +#: ../../c-api/object.rst:446 ../../c-api/object.rst:467 msgid "built-in function" msgstr "função embutida" -#: ../../c-api/object.rst:315 +#: ../../c-api/object.rst:316 msgid "repr" msgstr "repr" -#: ../../c-api/object.rst:327 +#: ../../c-api/object.rst:330 msgid "ascii" msgstr "ascii" -#: ../../c-api/object.rst:335 +#: ../../c-api/object.rst:340 msgid "string" msgstr "string" -#: ../../c-api/object.rst:335 +#: ../../c-api/object.rst:340 msgid "PyObject_Str (C function)" msgstr "" -#: ../../c-api/object.rst:352 +#: ../../c-api/object.rst:359 msgid "bytes" msgstr "bytes" -#: ../../c-api/object.rst:403 +#: ../../c-api/object.rst:412 msgid "hash" msgstr "hash" -#: ../../c-api/object.rst:437 +#: ../../c-api/object.rst:446 msgid "type" msgstr "tipo" -#: ../../c-api/object.rst:458 +#: ../../c-api/object.rst:467 msgid "len" msgstr "len" diff --git a/c-api/objimpl.po b/c-api/objimpl.po index ea12cc3b5..5841eab42 100644 --- a/c-api/objimpl.po +++ b/c-api/objimpl.po @@ -1,26 +1,25 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2024 -# Raphael Mendonça, 2024 +# python-doc bot, 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-17 14:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Raphael Mendonça, 2024\n" +"POT-Creation-Date: 2025-09-15 15:19+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: python-doc bot, 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/perfmaps.po b/c-api/perfmaps.po index 8238e657b..b4057d609 100644 --- a/c-api/perfmaps.po +++ b/c-api/perfmaps.po @@ -1,25 +1,25 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2024 +# python-doc bot, 2026 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-06-07 14:15+0000\n" -"PO-Revision-Date: 2023-05-24 13:07+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-29 20:35+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: python-doc bot, 2026\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -31,12 +31,12 @@ msgstr "Suporte a Mapas do Perf" 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`` " +"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 `_." +"Perf tool `_." msgstr "" "Em plataformas suportadas (no momento em que este livro foi escrito, apenas " "Linux), o tempo de execução pode tirar vantagem dos *arquivos de mapa perf* " @@ -69,16 +69,17 @@ 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." +"need to call this explicitly; just " +"use :c:func:`PyUnstable_WritePerfMapEntry` and it will initialize the state " +"on first call." msgstr "" "Abre o arquivo ``/tmp/perf-$pid.map``, a menos que já esteja aberto, e cria " "uma trava para garantir escritas seguras para thread no arquivo (desde que " -"as escritas sejam feitas através de :c:func:" -"`PyUnstable_WritePerfMapEntry` ). Normalmente, não há necessidade de chamar " -"isso explicitamente; basta usar :c:func:`PyUnstable_WritePerfMapEntry` e ele " -"inicializará o estado na primeira chamada." +"as escritas sejam feitas através " +"de :c:func:`PyUnstable_WritePerfMapEntry` ). Normalmente, não há necessidade " +"de chamar isso explicitamente; basta " +"usar :c:func:`PyUnstable_WritePerfMapEntry` e ele inicializará o estado na " +"primeira chamada." #: ../../c-api/perfmaps.rst:29 msgid "" @@ -98,6 +99,14 @@ msgstr "" "Escreve uma única entrada no arquivo ``/tmp/perf-$pid.map``. Esta função é " "segura para thread. Aqui está a aparência de um exemplo de entrada::" +#: ../../c-api/perfmaps.rst:38 +msgid "" +"# address size name\n" +"7f3529fcf759 b py::bar:/run/t.py" +msgstr "" +"# endereço tamanho nome\n" +"7f3529fcf759 b py::bar:/run/t.py" + #: ../../c-api/perfmaps.rst:41 msgid "" "Will call :c:func:`PyUnstable_PerfMapState_Init` before writing the entry, " @@ -106,8 +115,8 @@ msgid "" msgstr "" "Chamará :c:func:`PyUnstable_PerfMapState_Init` antes de escrever a entrada, " "se o arquivo de mapa de desempenho ainda não estiver aberto. Retorna ``0`` " -"em caso de sucesso ou os mesmos códigos de erro que :c:func:" -"`PyUnstable_PerfMapState_Init` em caso de falha." +"em caso de sucesso ou os mesmos códigos de erro " +"que :c:func:`PyUnstable_PerfMapState_Init` em caso de falha." #: ../../c-api/perfmaps.rst:47 msgid "" @@ -116,8 +125,77 @@ msgid "" "general, there shouldn't be a reason to explicitly call this, except to " "handle specific scenarios such as forking." msgstr "" -"Fecha o arquivo de mapa do perf aberto por :c:func:" -"`PyUnstable_PerfMapState_Init`. Isso é chamado pelo próprio tempo de " -"execução durante o desligamento do interpretador. Em geral, não deve haver " -"motivo para chamar isso explicitamente, exceto para lidar com cenários " -"específicos, como bifurcação." +"Fecha o arquivo de mapa do perf aberto " +"por :c:func:`PyUnstable_PerfMapState_Init`. Isso é chamado pelo próprio " +"tempo de execução durante o desligamento do interpretador. Em geral, não " +"deve haver motivo para chamar isso explicitamente, exceto para lidar com " +"cenários específicos, como bifurcação." + +#: ../../c-api/perfmaps.rst:54 +msgid "" +"Open the ``/tmp/perf-$pid.map`` file and append the content of " +"*parent_filename* to it." +msgstr "" + +#: ../../c-api/perfmaps.rst:57 +msgid "" +"This function is available on all platforms but only generates output on " +"platforms that support perf maps (currently only Linux). On other platforms, " +"it does nothing." +msgstr "" + +#: ../../c-api/perfmaps.rst:64 +msgid "Compile the given code object using the current perf trampoline." +msgstr "" + +#: ../../c-api/perfmaps.rst:66 +msgid "" +"The \"current\" trampoline is the one set by the runtime or the most " +"recent :c:func:`PyUnstable_PerfTrampoline_SetPersistAfterFork` call." +msgstr "" + +#: ../../c-api/perfmaps.rst:69 +msgid "" +"If no trampoline is set, falls back to normal compilation (no perf map " +"entry)." +msgstr "" + +#: ../../c-api/perfmaps.rst:0 +msgid "Parameters" +msgstr "Parâmetros" + +#: ../../c-api/perfmaps.rst:71 +msgid "The code object to compile." +msgstr "" + +#: ../../c-api/perfmaps.rst:0 +msgid "Returns" +msgstr "Retorna" + +#: ../../c-api/perfmaps.rst:72 ../../c-api/perfmaps.rst:88 +msgid "0 on success, -1 on failure." +msgstr "" + +#: ../../c-api/perfmaps.rst:78 +msgid "Set whether the perf trampoline should persist after a fork." +msgstr "" + +#: ../../c-api/perfmaps.rst:80 +msgid "" +"If ``enable`` is true (non-zero): perf map file remains open/valid post-" +"fork. Child process inherits all existing perf map entries." +msgstr "" + +#: ../../c-api/perfmaps.rst:82 +msgid "" +"If ``enable`` is false (zero): perf map closes post-fork. Child process gets " +"empty perf map." +msgstr "" + +#: ../../c-api/perfmaps.rst:85 +msgid "Default: false (clears on fork)." +msgstr "" + +#: ../../c-api/perfmaps.rst:87 +msgid "1 to enable, 0 to disable." +msgstr "" diff --git a/c-api/picklebuffer.po b/c-api/picklebuffer.po new file mode 100644 index 000000000..5c3afbd59 --- /dev/null +++ b/c-api/picklebuffer.po @@ -0,0 +1,131 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2026, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# python-doc bot, 2025 +# Rafael Fontenelle , 2025 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-11-17 15:05+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" +"Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" +"teams/5390/pt_BR/)\n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " +"1000000 == 0 ? 1 : 2;\n" + +#: ../../c-api/picklebuffer.rst:9 +msgid "Pickle buffer objects" +msgstr "Objetos buffer serializados com pickle" + +#: ../../c-api/picklebuffer.rst:13 +msgid "" +"A :class:`pickle.PickleBuffer` object wraps a :ref:`buffer-providing object " +"` for out-of-band data transfer with the :mod:`pickle` module." +msgstr "" +"Um objeto :class:`pickle.PickleBuffer` encapsula um :ref:`objeto provedor de " +"buffer ` para transferência de dados fora de banda com o " +"módulo :mod:`pickle`." + +#: ../../c-api/picklebuffer.rst:19 +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python pickle buffer " +"type. This is the same object as :class:`pickle.PickleBuffer` in the Python " +"layer." +msgstr "" +"Esta instância de :c:type:`PyTypeObject` representa o tipo de buffer " +"serializado com pickle do Python. Este é o mesmo objeto " +"que :class:`pickle.PickleBuffer` na camada Python." + +#: ../../c-api/picklebuffer.rst:25 +msgid "" +"Return true if *op* is a pickle buffer instance. This function always " +"succeeds." +msgstr "" +"Retorna verdadeiro se *op* for uma instância de buffer serializado com " +"pickle. Esta função sempre tem sucesso." + +#: ../../c-api/picklebuffer.rst:31 +msgid "Create a pickle buffer from the object *obj*." +msgstr "Cria um buffer serializado com pickle a partir do objeto *obj*." + +#: ../../c-api/picklebuffer.rst:33 +msgid "" +"This function will fail if *obj* doesn't support the :ref:`buffer protocol " +"`." +msgstr "" +"Esta função falhará se *obj* não oferecer suporte ao :ref:`protocolo de " +"buffer `." + +#: ../../c-api/picklebuffer.rst:35 +msgid "" +"On success, return a new pickle buffer instance. On failure, set an " +"exception and return ``NULL``." +msgstr "" +"Em caso de sucesso, retorna uma nova instância de buffer serializado com " +"pickle. Em caso de falha, define uma exceção e retorna ``NULL``." + +#: ../../c-api/picklebuffer.rst:38 +msgid "Analogous to calling :class:`pickle.PickleBuffer` with *obj* in Python." +msgstr "Análogo a chamar :class:`pickle.PickleBuffer` com *obj* em Python." + +#: ../../c-api/picklebuffer.rst:43 +msgid "" +"Get a pointer to the underlying :c:type:`Py_buffer` that the pickle buffer " +"wraps." +msgstr "" +"Obtém um ponteiro para o :c:type:`Py_buffer` subjacente que o buffer " +"serializado com pickle encapsula." + +#: ../../c-api/picklebuffer.rst:45 +msgid "" +"The returned pointer is valid as long as *picklebuf* is alive and has not " +"been released. The caller must not modify or free the " +"returned :c:type:`Py_buffer`. If the pickle buffer has been released, " +"raise :exc:`ValueError`." +msgstr "" +"O ponteiro retornado é válido enquanto *picklebuf* estiver ativo e não tiver " +"sido liberado. O chamador não deve modificar ou liberar " +"o :c:type:`Py_buffer` retornado. Se o buffer serializado com pickle tiver " +"sido liberado, levanta uma exceção :exc:`ValueError`." + +#: ../../c-api/picklebuffer.rst:49 +msgid "" +"On success, return a pointer to the buffer view. On failure, set an " +"exception and return ``NULL``." +msgstr "" +"Em caso de sucesso, retorna um ponteiro para a visualização do buffer. Em " +"caso de falha, define uma exceção e retorna ``NULL``." + +#: ../../c-api/picklebuffer.rst:55 +msgid "Release the underlying buffer held by the pickle buffer." +msgstr "Libera o buffer subjacente mantido pelo buffer serializado com pickle." + +#: ../../c-api/picklebuffer.rst:57 +msgid "" +"Return ``0`` on success. On failure, set an exception and return ``-1``." +msgstr "" +"Retorna ``0`` em caso de sucesso. Em caso de falha, define uma exceção e " +"retorna ``-1``." + +#: ../../c-api/picklebuffer.rst:59 +msgid "Analogous to calling :meth:`pickle.PickleBuffer.release` in Python." +msgstr "Análogo a chamar :meth:`pickle.PickleBuffer.release` em Python." + +#: ../../c-api/picklebuffer.rst:5 +msgid "object" +msgstr "objeto" + +#: ../../c-api/picklebuffer.rst:5 +msgid "PickleBuffer" +msgstr "PickleBuffer" diff --git a/c-api/refcounting.po b/c-api/refcounting.po index 176b48e6f..e48c9890f 100644 --- a/c-api/refcounting.po +++ b/c-api/refcounting.po @@ -1,61 +1,65 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 +# Rafael Fontenelle , 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-08-03 20:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../c-api/refcounting.rst:8 msgid "Reference Counting" -msgstr "Contagem de Referências" +msgstr "Contagem de referências" #: ../../c-api/refcounting.rst:10 msgid "" "The functions and macros in this section are used for managing reference " "counts of Python objects." msgstr "" +"As funções e macros nesta sessão são usadas para o gerenciamento de contagem " +"de referências de objetos Python." #: ../../c-api/refcounting.rst:16 msgid "Get the reference count of the Python object *o*." -msgstr "" +msgstr "Obtêm a contagem de referências do objeto 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." +"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." msgstr "" "Observe que o valor retornado pode não refletir realmente quantas " "referências ao objeto são realmente mantidas. Por exemplo, alguns objetos " -"são :term:`imortais ` e têm uma refcount muito alta que não reflete " -"o número real de referências. Consequentemente, não confie no valor " -"retornado para ser preciso, exceto um valor de 0 ou 1." +"são :term:`imortais ` e têm uma contagem de referências muito alta, " +"que não reflete o número real de referências. Consequentemente, não confie " +"no valor retornado para ser preciso, exceto um valor de 0 ou 1." #: ../../c-api/refcounting.rst:24 msgid "" "Use the :c:func:`Py_SET_REFCNT()` function to set an object reference count." msgstr "" +"Use a função :c:func:`Py_SET_REFCNT()` para definir uma contagem de " +"referências de um objeto." #: ../../c-api/refcounting.rst:26 msgid ":c:func:`Py_REFCNT()` is changed to the inline static function." @@ -81,12 +85,12 @@ msgstr "" #: ../../c-api/refcounting.rst:40 ../../c-api/refcounting.rst:53 #: ../../c-api/refcounting.rst:119 msgid "This function has no effect on :term:`immortal` objects." -msgstr "" +msgstr "Esta função não tem efeito sobre objetos :term:`imortais `." #: ../../c-api/refcounting.rst:44 ../../c-api/refcounting.rst:68 #: ../../c-api/refcounting.rst:147 msgid "Immortal objects are not modified." -msgstr "" +msgstr "Os objetos imortais não são modificados." #: ../../c-api/refcounting.rst:50 msgid "" @@ -96,10 +100,14 @@ msgstr "" #: ../../c-api/refcounting.rst:55 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 " +"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 "" +"Esta função é geralmente usada para transformar uma :term:`referência " +"emprestada` em uma :term:`referência forte` local. A " +"função :c:func:`Py_NewRef` pode ser usada para criar uma " +"nova :term:`referência forte`." #: ../../c-api/refcounting.rst:59 msgid "When done using the object, release is by calling :c:func:`Py_DECREF`." @@ -111,11 +119,10 @@ msgid "" "use :c:func:`Py_XINCREF`." msgstr "" -#: ../../c-api/refcounting.rst:64 ../../c-api/refcounting.rst:132 +#: ../../c-api/refcounting.rst:64 msgid "" -"Do not expect this function to actually modify *o* in any way. For at least " -"`some objects `_, this function has no " -"effect." +"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:74 @@ -123,10 +130,12 @@ msgid "" "Similar to :c:func:`Py_INCREF`, but the object *o* can be ``NULL``, in which " "case this has no effect." msgstr "" +"Semelhante a :c:func:`Py_INCREF`, mas o objeto *o* pode ser ``NULL``, caso " +"em que isso não tem efeito." #: ../../c-api/refcounting.rst:77 msgid "See also :c:func:`Py_XNewRef`." -msgstr "" +msgstr "Veja também :c:func:`Py_XNewRef`." #: ../../c-api/refcounting.rst:82 msgid "" @@ -150,21 +159,31 @@ msgstr "" msgid "For example::" msgstr "Por exemplo::" +#: ../../c-api/refcounting.rst:93 +msgid "" +"Py_INCREF(obj);\n" +"self->attr = obj;" +msgstr "" + #: ../../c-api/refcounting.rst:96 msgid "can be written as::" msgstr "" +#: ../../c-api/refcounting.rst:98 +msgid "self->attr = Py_NewRef(obj);" +msgstr "" + #: ../../c-api/refcounting.rst:100 msgid "See also :c:func:`Py_INCREF`." msgstr "" #: ../../c-api/refcounting.rst:107 msgid "Similar to :c:func:`Py_NewRef`, but the object *o* can be NULL." -msgstr "" +msgstr "Semelhante a :c:func:`Py_NewRef`, mas o objeto *o* pode ser NULL." #: ../../c-api/refcounting.rst:109 msgid "If the object *o* is ``NULL``, the function just returns ``NULL``." -msgstr "" +msgstr "Se o objeto *o* é ``NULL``, a função apenas retorna ``NULL``." #: ../../c-api/refcounting.rst:116 msgid "" @@ -191,10 +210,16 @@ msgid "" "use :c:func:`Py_XDECREF`." msgstr "" +#: ../../c-api/refcounting.rst:132 +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:138 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 " +"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 " @@ -242,8 +267,9 @@ msgstr "" #: ../../c-api/refcounting.rst:185 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." +"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:192 @@ -256,13 +282,23 @@ msgstr "" msgid "As in case of :c:func:`Py_CLEAR`, \"the obvious\" code can be deadly::" msgstr "" +#: ../../c-api/refcounting.rst:197 +msgid "" +"Py_DECREF(dst);\n" +"dst = src;" +msgstr "" + #: ../../c-api/refcounting.rst:200 msgid "The safe way is::" msgstr "" +#: ../../c-api/refcounting.rst:202 +msgid "Py_SETREF(dst, src);" +msgstr "" + #: ../../c-api/refcounting.rst:204 msgid "" -"That arranges to set *dst* to *src* _before_ releasing the reference to the " +"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 "" diff --git a/c-api/reflection.po b/c-api/reflection.po index 0d90700ee..2e5136b6e 100644 --- a/c-api/reflection.po +++ b/c-api/reflection.po @@ -1,26 +1,25 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-06-28 14:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: python-doc bot, 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -44,14 +43,16 @@ msgstr "" #: ../../c-api/reflection.rst:22 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." +"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 "" "Use :c:func:`PyEval_GetFrameLocals` para obter o mesmo comportamento que " -"chamar :func:`locals` no código Python, ou então chame :c:func:" -"`PyFrame_GetLocals` no resultado de :c:func:`PyEval_GetFrame` para acessar o " -"atributo :attr:`~frame.f_locals` do quadro atualmente em execução." +"chamar :func:`locals` no código Python, ou então " +"chame :c:func:`PyFrame_GetLocals` no resultado de :c:func:`PyEval_GetFrame` " +"para acessar o atributo :attr:`~frame.f_locals` do quadro atualmente em " +"execução." #: ../../c-api/reflection.rst:27 msgid "" @@ -74,31 +75,31 @@ msgstr "" 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." +"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." msgstr "" "Como esta função retorna uma :term:`referência emprestada`, o dicionário " "retornado para :term:`escopos otimizados ` é armazenado em " "cache no objeto frame e permanecerá ativo enquanto o objeto frame o fizer. " "Ao contrário de :c:func:`PyEval_GetFrameLocals` e :func:`locals`, chamadas " "subsequentes para esta função no mesmo quadro atualizarão o conteúdo do " -"dicionário em cache para refletir as mudanças no estado das variáveis ​​locais " +"dicionário em cache para refletir as mudanças no estado das variáveis locais " "em vez de retornar um novo snapshot." #: ../../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." +"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." msgstr "" -"Como parte da :pep:`667`, :c:func:`PyFrame_GetLocals`, :func:`locals` e :" -"attr:`FrameType.f_locals ` não fazem mais uso do dicionário " -"de cache compartilhado. Consulte a :ref:`entrada de O Que Há de Novo " -"` para detalhes adicionais." +"Como parte da :pep:`667`, :c:func:`PyFrame_GetLocals`, :func:`locals` " +"e :attr:`FrameType.f_locals ` não fazem mais uso do " +"dicionário de cache compartilhado. Consulte a :ref:`entrada de O Que Há de " +"Novo ` para detalhes adicionais." #: ../../c-api/reflection.rst:50 msgid "Use :c:func:`PyEval_GetFrameGlobals` instead." @@ -127,8 +128,8 @@ msgstr "Veja também :c:func:`PyThreadState_GetFrame`." #: ../../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." +"or ``NULL`` if no frame is currently executing. Equivalent to " +"calling :func:`locals` in Python code." msgstr "" "Retorna um dicionário das variáveis locais no quadro de execução atual ou " "``NULL`` se nenhum quadro estiver sendo executado no momento. Equivalente a " @@ -137,18 +138,18 @@ msgstr "" #: ../../c-api/reflection.rst:78 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`." +"independent snapshot in :term:`optimized scopes `, " +"call :c:func:`PyFrame_GetLocals` on the result of :c:func:`PyEval_GetFrame`." msgstr "" "Para acessar :attr:`~frame.f_locals` no quadro atual sem fazer um snapshot " -"independente em :term:`escopos otimizados `, chame :c:func:" -"`PyFrame_GetLocals` no resultado de :c:func:`PyEval_GetFrame`." +"independente em :term:`escopos otimizados `, " +"chame :c:func:`PyFrame_GetLocals` no resultado de :c:func:`PyEval_GetFrame`." #: ../../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." +"or ``NULL`` if no frame is currently executing. Equivalent to " +"calling :func:`globals` in Python code." msgstr "" "Retorna um dicionário das variáveis globais no quadro de execução atual ou " "``NULL`` se nenhum quadro estiver sendo executado no momento. Equivalente a " @@ -166,10 +167,10 @@ msgstr "" msgid "" "Return a description string, depending on the type of *func*. Return values " "include \"()\" for functions and methods, \" constructor\", \" instance\", " -"and \" object\". Concatenated with the result of :c:func:" -"`PyEval_GetFuncName`, the result will be a description of *func*." +"and \" object\". Concatenated with the result " +"of :c:func:`PyEval_GetFuncName`, the result will be a description of *func*." msgstr "" "Retorna uma sequência de caracteres de descrição, dependendo do tipo de " "*func*. Os valores de retorno incluem \"()\" para funções e métodos, \" " -"constructor\", \" instance\" e \" object\".. Concatenado com o resultado de :" -"c:func:`PyEval_GetFuncName`, o resultado será uma descrição de *func*." +"constructor\", \" instance\" e \" object\".. Concatenado com o resultado " +"de :c:func:`PyEval_GetFuncName`, o resultado será uma descrição de *func*." diff --git a/c-api/sequence.po b/c-api/sequence.po index f80cfbef9..3617ed9dd 100644 --- a/c-api/sequence.po +++ b/c-api/sequence.po @@ -1,26 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Adorilson Bezerra , 2021 -# Rafael Fontenelle , 2023 +# python-doc bot, 2025 +# Rafael Fontenelle , 2026 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-11 18:37+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2026-10-13 21:57+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2026\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -31,19 +31,24 @@ msgstr "Protocolo de sequência" #: ../../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." +"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." msgstr "" +"Retorna ``1`` se o objeto fornecer o protocolo de sequência e ``0`` caso " +"contrário. Note que ele retorna ``1`` para classes Python com um " +"método :meth:`~object.__getitem__` a menos que sejam subclasses " +"de :class:`dict` já que no caso geral é impossível determinar que tipo de " +"chaves a classe provê. Esta função sempre obtém sucesso." #: ../../c-api/sequence.rst:23 msgid "" "Returns the number of objects in sequence *o* on success, and ``-1`` on " "failure. This is equivalent to the Python expression ``len(o)``." msgstr "" -"Retorna o número de objetos em sequência *o* em caso de sucesso e ``-1`` em " -"caso de falha. Isso é equivalente à expressão Python ``len(o)``." +"Retorna o número de objetos na sequência *o* em caso de sucesso, ou ``-1`` " +"em caso de falha. Equivale à expressão Python ``len(o)``." #: ../../c-api/sequence.rst:29 msgid "" @@ -51,7 +56,7 @@ msgid "" "failure. This is the equivalent of the Python expression ``o1 + o2``." msgstr "" "Retorna a concatenação de *o1* e *o2* em caso de sucesso, e ``NULL`` em caso " -"de falha. Este é o equivalente da expressão Python ``o1 + o2``." +"de falha. Equivale à expressão Python ``o1 + o2``." #: ../../c-api/sequence.rst:35 msgid "" @@ -60,8 +65,7 @@ msgid "" "count``." msgstr "" "Retorna o resultado da repetição do objeto sequência *o* *count* vezes ou " -"``NULL`` em caso de falha. Este é o equivalente da expressão Python ``o * " -"count``." +"``NULL`` em caso de falha. Equivale à expressão Python ``o * count``." #: ../../c-api/sequence.rst:41 msgid "" @@ -70,8 +74,8 @@ msgid "" "the equivalent of the Python expression ``o1 += o2``." msgstr "" "Retorna a concatenação de *o1* e *o2* em caso de sucesso, e ``NULL`` em caso " -"de falha. A operação é feita *no local* quando *o1* suportar. Este é o " -"equivalente da expressão Python ``o1 += o2``." +"de falha. A operação é feita *localmente* se *o1* permitir. Equivale à " +"expressão Python ``o1 += o2``." #: ../../c-api/sequence.rst:48 msgid "" @@ -80,16 +84,16 @@ msgid "" "it. This is the equivalent of the Python expression ``o *= count``." msgstr "" "Retorna o resultado da repetição do objeto sequência *o* *count* vezes ou " -"``NULL`` em caso de falha. A operação é feita *localmente* quando *o* " -"suportar. Este é o equivalente da expressão Python ``o *= count``." +"``NULL`` em caso de falha. A operação é feita *localmente* se *o* permitir. " +"Equivale à expressão Python ``o *= count``." #: ../../c-api/sequence.rst:55 msgid "" "Return the *i*\\ th element of *o*, or ``NULL`` on failure. This is the " "equivalent of the Python expression ``o[i]``." msgstr "" -"Retorna o elemento *i* de *o* ou ``NULL`` em caso de falha. Este é o " -"equivalente da expressão Python ``o[i]``." +"Retorna o elemento *i* de *o* ou ``NULL`` em caso de falha. Equivale à " +"expressão Python ``o[i]``." #: ../../c-api/sequence.rst:61 msgid "" @@ -97,33 +101,35 @@ msgid "" "on failure. This is the equivalent of the Python expression ``o[i1:i2]``." msgstr "" "Retorna a fatia do objeto sequência *o* entre *i1* e *i2*, ou ``NULL`` em " -"caso de falha. Este é o equivalente da expressão Python ``o[i1:i2]``." +"caso de falha. Equivale à expressão Python ``o[i1:i2]``." #: ../../c-api/sequence.rst:67 msgid "" "Assign object *v* to the *i*\\ th element of *o*. Raise an exception and " "return ``-1`` on failure; return ``0`` on success. This is the equivalent " -"of the Python statement ``o[i] = v``. This function *does not* steal a " -"reference to *v*." +"of the Python statement ``o[i] = v``. This function *does not* " +"\":term:`steal`\" a reference to *v*." msgstr "" "Atribui o objeto *v* ao elemento *i* de *o*. Levanta uma exceção e retorna " -"``-1`` em caso de falha; retorna ``0`` em caso de sucesso. Isso é " -"equivalente à instrução Python ``o[i]=v``. Esta função *não* rouba uma " -"referência a *v*." +"``-1`` em caso de falha; retorna ``0`` em caso de sucesso. Isso é o " +"equivalente à instrução Python ``o[i] = v``. Esta função *não* " +"\":term:`rouba `\" uma referência a *v*." #: ../../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`." msgstr "" +"Se *v* for ``NULL``, o elemento será removido, mas este recurso foi " +"descontinuado em favor do uso de :c:func:`PySequence_DelItem`." #: ../../c-api/sequence.rst:78 msgid "" "Delete the *i*\\ th element of object *o*. Returns ``-1`` on failure. This " "is the equivalent of the Python statement ``del o[i]``." msgstr "" -"Exclui o elemento *i* do objeto *o*. Retorna ``-1`` em caso de falha. Isso é " -"equivalente à instrução Python ``del o[i]``." +"Exclui o elemento *i* do objeto *o*. Retorna ``-1`` em caso de falha. " +"Equivale à instrução Python ``del o[i]``." #: ../../c-api/sequence.rst:84 msgid "" @@ -131,7 +137,7 @@ msgid "" "to *i2*. This is the equivalent of the Python statement ``o[i1:i2] = v``." msgstr "" "Atribui o objeto sequência *v* à fatia no objeto sequência *o* de *i1* a " -"*i2*. Isso é equivalente à instrução Python ``o[i1:i2] = v``." +"*i2*. Equivale à instrução Python ``o[i1:i2] = v``." #: ../../c-api/sequence.rst:90 msgid "" @@ -139,7 +145,7 @@ msgid "" "on failure. This is the equivalent of the Python statement ``del o[i1:i2]``." msgstr "" "Exclui a fatia no objeto sequência *o* de *i1* a *i2*. Retorna ``-1`` em " -"caso de falha. Isso é equivalente à instrução Python ``del o[i1:i2]``." +"caso de falha. Equivale à instrução Python ``del o[i1:i2]``." #: ../../c-api/sequence.rst:96 msgid "" @@ -147,6 +153,9 @@ msgid "" "number of keys for which ``o[key] == value``. On failure, return ``-1``. " "This is equivalent to the Python expression ``o.count(value)``." msgstr "" +"Retorna a quantidade de ocorrências de *value* em *o*, isto é, retorna a " +"quantidade de chaves onde ``o[key] == value``. Em caso de falha, retorna " +"``-1``. Equivale à expressão Python ``o.count(value)``." #: ../../c-api/sequence.rst:103 msgid "" @@ -154,12 +163,17 @@ msgid "" "return ``1``, otherwise return ``0``. On error, return ``-1``. This is " "equivalent to the Python expression ``value in o``." msgstr "" +"Determina se *o* contém *value*. Se um item em *o* for igual a *value*, " +"retorna ``1``, senão, retorna ``0``. Em caso de erro, retorna ``-1``. " +"Equivale à expressão Python ``value in o``." #: ../../c-api/sequence.rst:110 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)``." msgstr "" +"Retorna o primeiro índice *i* tal que ``o[i] == value``. Em caso de erro, " +"retorna ``-1``. Equivale à expressão Python ``o.index(value)``." #: ../../c-api/sequence.rst:116 msgid "" @@ -167,6 +181,9 @@ msgid "" "or ``NULL`` on failure. The returned list is guaranteed to be new. This is " "equivalent to the Python expression ``list(o)``." msgstr "" +"Retorna um objeto lista com o mesmo conteúdo da sequência ou iterável *o*, " +"ou ``NULL`` em caso de falha. Garante-se que a lista retornada será nova. " +"Equivale à expressão Python ``list(o)``." #: ../../c-api/sequence.rst:125 msgid "" @@ -175,6 +192,10 @@ msgid "" "returned, otherwise a tuple will be constructed with the appropriate " "contents. This is equivalent to the Python expression ``tuple(o)``." msgstr "" +"Retorna o objeto tupla com o mesmo conteúdo da sequência ou iterável *o*, ou " +"``NULL`` em caso de falha. Se *o* for uma tupla, retorna uma nova " +"referência. Senão, uma tupla será construída com o conteúdo apropriado. " +"Equivale à expressão Python ``tuple(o)``." #: ../../c-api/sequence.rst:133 msgid "" @@ -183,6 +204,10 @@ msgid "" "iterable, raises :exc:`TypeError` with *m* as the message text. Returns " "``NULL`` on failure." msgstr "" +"Retorna a sequência ou iterável *o* como um objeto usável por outras funções " +"da família ``PySequence_Fast*``. Se o objeto não for uma sequência ou " +"iterável, levanta :exc:`TypeError` com *m* sendo o texto da mensagem. " +"Retorna ``NULL`` em caso de falha." #: ../../c-api/sequence.rst:138 msgid "" @@ -190,33 +215,49 @@ msgid "" "a :c:type:`PyTupleObject` or a :c:type:`PyListObject` and access the data " "fields of *o* directly." msgstr "" +"As funções ``PySequence_Fast*`` têm esse nome porque presumem que *o* é " +"um :c:type:`PyTupleObject` ou um :c:type:`PyListObject` e porque acessam os " +"campos de dados de *o* diretamente." #: ../../c-api/sequence.rst:142 msgid "" "As a CPython implementation detail, if *o* is already a sequence or list, it " "will be returned." msgstr "" +"Como detalhe de implementação de CPython, se *o* já for uma sequência ou " +"lista, ele será retornado." #: ../../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_GET_SIZE` is faster because it can assume *o* is a list or " -"tuple." +"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_GET_SIZE` is faster because it can assume *o* " +"is a list or tuple." msgstr "" +"Retorna o comprimento de *o*, presumindo que *o* foi retornado " +"por :c:func:`PySequence_Fast` e que *o* não seja ``NULL``. O tamanho também " +"pode ser obtido ao chamar :c:func:`PySequence_Size` em *o*, " +"mas :c:func:`PySequence_Fast_GET_SIZE` é mais rápida, ao supor que *o* é uma " +"lista ou tupla." #: ../../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." +"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." msgstr "" +"Retorna o elemento *i* de *o*, presumindo que *o* foi retornado " +"por :c:func:`PySequence_Fast`, que *o* seja ``NULL``, e que *i* esteja nos " +"limites." #: ../../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``." msgstr "" +"Retorna o vetor subjacente de ponteiros PyObject. Presume que *o* foi " +"retornado por :c:func:`PySequence_Fast` e que *o* não seja ``NULL``." #: ../../c-api/sequence.rst:166 msgid "" @@ -224,14 +265,21 @@ msgid "" "So, only use the underlying array pointer in contexts where the sequence " "cannot change." msgstr "" +"Note que, se uma lista for redimensionada, a realocação poderá reposicionar " +"o vetor de itens. Portanto, só use o ponteiro de vetor subjacente em " +"contextos onde a sequência não mudará." #: ../../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:" -"`PySequence_Check` on *o* is true and without adjustment for negative " -"indices." +"Return the *i*\\ th element of *o* or ``NULL`` on failure. Faster form " +"of :c:func:`PySequence_GetItem` but without checking " +"that :c:func:`PySequence_Check` on *o* is true and without adjustment for " +"negative indices." msgstr "" +"Retorna o elemento *i* de *o*, ou ``NULL`` em caso de falha. É uma forma " +"mais rápida de :c:func:`PySequence_GetItem`, mas sem verificar " +"se :c:func:`PySequence_Check` em *o* é verdadeiro e sem ajustar índices " +"negativos." #: ../../c-api/sequence.rst:21 ../../c-api/sequence.rst:123 msgid "built-in function" diff --git a/c-api/set.po b/c-api/set.po index 33518301f..2a381e5b1 100644 --- a/c-api/set.po +++ b/c-api/set.po @@ -1,27 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Vitor Buxbaum Orlandi, 2021 -# Rafael Fontenelle , 2023 +# python-doc bot, 2025 +# Rafael Fontenelle , 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-24 14:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2026-10-23 19:49+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -33,62 +32,56 @@ msgstr "Objeto Set" 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:" -"`PyNumber_InPlaceXor`)." +"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 "" -"Esta seção detalha a API pública para os objetos :class:`set` e :class:" -"`frozenset`. Qualquer funcionalidade não listada abaixo é melhor acessada " -"usando o protocolo de objeto abstrato (incluindo :c:func:" -"`PyObject_CallMethod`, :c:func:`PyObject_RichCompareBool`, :c:func:" -"`PyObject_Hash`, :c:func:`PyObject_Repr`, :c:func:`PyObject_IsTrue`, :c:func:" -"`PyObject_Print` e :c:func:`PyObject_GetIter`) ou o protocolo abstrato de " -"número (incluindo :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` e :c:func:" -"`PyNumber_InPlaceXor`)." +"Esta seção detalha a API pública para os objetos :class:`set` " +"e :class:`frozenset`. Qualquer funcionalidade não listada abaixo é melhor " +"acessada usando o protocolo de objeto abstrato " +"(incluindo :c:func:`PyObject_CallMethod`, :c:func:`PyObject_RichCompareBool`, :c:func:`PyObject_Hash`, :c:func:`PyObject_Repr`, :c:func:`PyObject_IsTrue`, :c:func:`PyObject_Print` " +"e :c:func:`PyObject_GetIter`) ou o protocolo abstrato de número " +"(incluindo :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` " +"e :c:func:`PyNumber_InPlaceXor`)." #: ../../c-api/set.rst:29 msgid "" "This subtype of :c:type:`PyObject` is used to hold the internal data for " -"both :class:`set` and :class:`frozenset` objects. It is like a :c:type:" -"`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 " +"both :class:`set` and :class:`frozenset` objects. It is like " +"a :c:type:`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." msgstr "" "Este subtipo de :c:type:`PyObject` é usado para manter os dados internos " -"para ambos os objetos :class:`set` e :class:`frozenset`. É como um :c:type:" -"`PyDictObject` em que tem um tamanho fixo para conjuntos pequenos (muito " -"parecido com o armazenamento de tupla) e apontará para um bloco de memória " -"de tamanho variável separado para conjuntos de tamanho médio e grande (muito " -"parecido com lista armazenamento). Nenhum dos campos desta estrutura deve " -"ser considerado público e todos estão sujeitos a alterações. Todo o acesso " -"deve ser feito por meio da API documentada, em vez de manipular os valores " -"na estrutura." +"para ambos os objetos :class:`set` e :class:`frozenset`. É como " +"um :c:type:`PyDictObject` em que tem um tamanho fixo para conjuntos pequenos " +"(muito parecido com o armazenamento de tupla) e apontará para um bloco de " +"memória de tamanho variável separado para conjuntos de tamanho médio e " +"grande (muito parecido com lista armazenamento). Nenhum dos campos desta " +"estrutura deve ser considerado público e todos estão sujeitos a alterações. " +"Todo o acesso deve ser feito por meio da API documentada, em vez de " +"manipular os valores na estrutura." #: ../../c-api/set.rst:40 msgid "" -"This is an instance of :c:type:`PyTypeObject` representing the Python :class:" -"`set` type." +"This is an instance of :c:type:`PyTypeObject` representing the " +"Python :class:`set` type." msgstr "" -"Essa é uma instância de :c:type:`PyTypeObject` representando o tipo Python :" -"class:`set`" +"Essa é uma instância de :c:type:`PyTypeObject` representando o tipo " +"Python :class:`set`" #: ../../c-api/set.rst:46 msgid "" -"This is an instance of :c:type:`PyTypeObject` representing the Python :class:" -"`frozenset` type." +"This is an instance of :c:type:`PyTypeObject` representing the " +"Python :class:`frozenset` type." msgstr "" -"Esta é uma instância de :c:type:`PyTypeObject` representando o tipo Python :" -"class:`frozenset`." +"Esta é uma instância de :c:type:`PyTypeObject` representando o tipo " +"Python :class:`frozenset`." #: ../../c-api/set.rst:49 msgid "" @@ -120,8 +113,9 @@ msgid "" "Return true if *p* is a :class:`set` object, a :class:`frozenset` object, or " "an instance of a subtype. This function always succeeds." msgstr "" -"Retorna verdadeiro se *p* for um objeto :class:`set`, um objeto :class:" -"`frozenset` ou uma instância de um subtipo. Esta função sempre tem sucesso." +"Retorna verdadeiro se *p* for um objeto :class:`set`, um " +"objeto :class:`frozenset` ou uma instância de um subtipo. Esta função sempre " +"tem sucesso." #: ../../c-api/set.rst:70 msgid "" @@ -136,9 +130,9 @@ 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." msgstr "" -"Retorna verdadeiro se *p* for um objeto :class:`set` ou um objeto :class:" -"`frozenset`, mas não uma instância de um subtipo. Esta função sempre tem " -"sucesso." +"Retorna verdadeiro se *p* for um objeto :class:`set` ou um " +"objeto :class:`frozenset`, mas não uma instância de um subtipo. Esta função " +"sempre tem sucesso." #: ../../c-api/set.rst:83 msgid "" @@ -166,8 +160,8 @@ msgstr "" msgid "" "Return a new :class:`frozenset` containing objects returned by the " "*iterable*. The *iterable* may be ``NULL`` to create a new empty frozenset. " -"Return the new set on success or ``NULL`` on failure. Raise :exc:" -"`TypeError` if *iterable* is not actually iterable." +"Return the new set on success or ``NULL`` on failure. " +"Raise :exc:`TypeError` if *iterable* is not actually iterable." msgstr "" "Retorna uma nova :class:`frozenset` contendo objetos retornados pelo " "iterável *iterable*. O *iterable* pode ser ``NULL`` para criar um novo " @@ -177,17 +171,17 @@ msgstr "" #: ../../c-api/set.rst:104 msgid "" -"The following functions and macros are available for instances of :class:" -"`set` or :class:`frozenset` or instances of their subtypes." +"The following functions and macros are available for instances " +"of :class:`set` or :class:`frozenset` or instances of their subtypes." msgstr "" -"As seguintes funções e macros estão disponíveis para instâncias de :class:" -"`set` ou :class:`frozenset` ou instâncias de seus subtipos." +"As seguintes funções e macros estão disponíveis para instâncias " +"de :class:`set` ou :class:`frozenset` ou instâncias de seus subtipos." #: ../../c-api/set.rst:112 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:`SystemError` if *anyset* is not " +"a :class:`set`, :class:`frozenset`, or an instance of a subtype." msgstr "" "Retorna o comprimento de um objeto :class:`set` ou :class:`frozenset`. " "Equivalente a ``len(anyset)``. Levanta um :exc:`SystemError` se *anyset* não " @@ -202,16 +196,16 @@ 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." +"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." msgstr "" "Retorna ``1`` se encontrado, ``0`` se não encontrado, e ``-1`` se um erro é " "encontrado. Ao contrário do método Python :meth:`~object.__contains__`, esta " "função não converte automaticamente conjuntos não hasheáveis em frozensets " "temporários. Levanta um :exc:`TypeError` se a *key* não for hasheável. " -"Levanta :exc:`SystemError` se *anyset* não é um :class:`set`, :class:" -"`frozenset`, ou uma instância de um subtipo." +"Levanta :exc:`SystemError` se *anyset* não é " +"um :class:`set`, :class:`frozenset`, ou uma instância de um subtipo." #: ../../c-api/set.rst:133 msgid "" @@ -220,8 +214,8 @@ msgid "" "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 " -"grow. Raise a :exc:`SystemError` if *set* is not an instance of :class:" -"`set` or its subtype." +"grow. Raise a :exc:`SystemError` if *set* is not an instance " +"of :class:`set` or its subtype." msgstr "" "Adiciona *key* a uma instância de :class:`set`. Também funciona com " "instâncias de :class:`frozenset` (como :c:func:`PyTuple_SetItem`, ele pode " @@ -229,8 +223,8 @@ msgstr "" "antes que eles sejam expostos a outro código). Retorna ``0`` em caso de " "sucesso ou ``-1`` em caso de falha. Levanta um :exc:`TypeError` se a *key* " "não for hasheável. Levanta uma :exc:`MemoryError` se não houver espaço para " -"crescer. Levanta uma :exc:`SystemError` se *set* não for uma instância de :" -"class:`set` ou seu subtipo." +"crescer. Levanta uma :exc:`SystemError` se *set* não for uma instância " +"de :class:`set` ou seu subtipo." #: ../../c-api/set.rst:142 msgid "" @@ -246,17 +240,18 @@ 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:`SystemError` " +"if *set* is not an instance of :class:`set` or its subtype." msgstr "" "Retorna ``1`` se encontrado e removido, ``0`` se não encontrado (nenhuma " -"ação realizada) e ``-1`` se um erro for encontrado. Não levanta :exc:" -"`KeyError` para chaves ausentes. Levanta uma :exc:`TypeError` se a *key* não " -"for hasheável. Ao contrário do método Python :meth:`~frozenset.discard`, " -"esta função não converte automaticamente conjuntos não hasheáveis em " -"frozensets temporários. Levanta :exc:`SystemError` se *set* não é uma " -"instância de :class:`set` ou seu subtipo." +"ação realizada) e ``-1`` se um erro for encontrado. Não " +"levanta :exc:`KeyError` para chaves ausentes. Levanta uma :exc:`TypeError` " +"se a *key* não for hasheável. Ao contrário do método " +"Python :meth:`~set.discard`, esta função não converte automaticamente " +"conjuntos não hasheáveis em frozensets temporários. " +"Levanta :exc:`SystemError` se *set* não é uma instância de :class:`set` ou " +"seu subtipo." #: ../../c-api/set.rst:158 msgid "" @@ -273,8 +268,8 @@ msgstr "" #: ../../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." +"``-1`` and raise :exc:`SystemError` if *set* is not an instance " +"of :class:`set` or its subtype." msgstr "" "Esvazia um conjunto existente de todos os elementos. Retorna ``0`` em caso " "de sucesso. Retorna ``-1`` e levanta :exc:`SystemError` se *set* não for uma " diff --git a/c-api/slice.po b/c-api/slice.po index 68198e235..10b536d53 100644 --- a/c-api/slice.po +++ b/c-api/slice.po @@ -1,26 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Rafael Fontenelle , 2024 +# python-doc bot, 2025 +# Rafael Fontenelle , 2026 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-12 14:15+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" +"POT-Creation-Date: 2026-10-27 21:02+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2026\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -89,7 +89,7 @@ msgstr "" msgid "You probably do not want to use this function." msgstr "Você provavelmente não deseja usar esta função." -#: ../../c-api/slice.rst:44 ../../c-api/slice.rst:75 +#: ../../c-api/slice.rst:44 ../../c-api/slice.rst:76 msgid "" "The parameter type for the *slice* parameter was ``PySliceObject*`` before." msgstr "" @@ -101,35 +101,59 @@ msgid "" "stop, and step indices from the slice object *slice* assuming a sequence of " "length *length*, and store the length of the slice in *slicelength*. Out of " "bounds indices are clipped in a manner consistent with the handling of " -"normal slices." +"normal slices. *length* must not be negative." msgstr "" "Substituição utilizável para :c:func:`PySlice_GetIndices`. Recupera os " "índices de início, parada e intermediário do objeto fatia *slice* presumindo " "uma sequência de comprimento *length* e armazena o comprimento da fatia em " "*slicelength*. Índices fora dos limites são cortados de maneira consistente " -"com o tratamento de fatias normais." +"com o tratamento de fatias normais. *length* não pode ser negativo." -#: ../../c-api/slice.rst:57 +#: ../../c-api/slice.rst:58 msgid "Return ``0`` on success and ``-1`` on error with an exception set." msgstr "" "Retorna ``0`` em caso de sucesso e ``-1`` em caso de erro com uma exceção " "definida." -#: ../../c-api/slice.rst:60 +#: ../../c-api/slice.rst:61 msgid "" "This function is considered not safe for resizable sequences. Its invocation " -"should be replaced by a combination of :c:func:`PySlice_Unpack` and :c:func:" -"`PySlice_AdjustIndices` where ::" +"should be replaced by a combination of :c:func:`PySlice_Unpack` " +"and :c:func:`PySlice_AdjustIndices` where ::" msgstr "" "Esta função não é considerada segura para sequências redimensionáveis. Sua " -"invocação deve ser substituída por uma combinação de :c:func:" -"`PySlice_Unpack` e :c:func:`PySlice_AdjustIndices` sendo ::" +"invocação deve ser substituída por uma combinação " +"de :c:func:`PySlice_Unpack` e :c:func:`PySlice_AdjustIndices` sendo ::" + +#: ../../c-api/slice.rst:65 +msgid "" +"if (PySlice_GetIndicesEx(slice, length, &start, &stop, &step, &slicelength) " +"< 0) {\n" +" // return error\n" +"}" +msgstr "" +"if (PySlice_GetIndicesEx(slice, length, &start, &stop, &step, &slicelength) " +"< 0) {\n" +" // retorna erro\n" +"}" -#: ../../c-api/slice.rst:68 +#: ../../c-api/slice.rst:69 msgid "is replaced by ::" msgstr "substituído por ::" -#: ../../c-api/slice.rst:79 +#: ../../c-api/slice.rst:71 +msgid "" +"if (PySlice_Unpack(slice, &start, &stop, &step) < 0) {\n" +" // return error\n" +"}\n" +"slicelength = PySlice_AdjustIndices(length, &start, &stop, step);" +msgstr "" +"if (PySlice_Unpack(slice, &start, &stop, &step) < 0) {\n" +" // retorna erro\n" +"}\n" +"slicelength = PySlice_AdjustIndices(length, &start, &stop, step);" + +#: ../../c-api/slice.rst:80 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:`!" @@ -143,17 +167,17 @@ msgstr "" "usando :c:func:`!PySlice_Unpack` e :c:func:`!PySlice_AdjustIndices`. Os " "argumentos *start*, *stop* e *step* são avaliados mais de uma vez." -#: ../../c-api/slice.rst:86 +#: ../../c-api/slice.rst:87 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 "" "Se ``Py_LIMITED_API`` estiver definido para um valor menor que " -"``0x03050400`` ou entre ``0x03060000`` e ``0x03060100`` (não incluso), :c:" -"func:`!PySlice_GetIndicesEx` é uma função descontinuada." +"``0x03050400`` ou entre ``0x03060000`` e ``0x03060100`` (não " +"incluso), :c:func:`!PySlice_GetIndicesEx` é uma função descontinuada." -#: ../../c-api/slice.rst:94 +#: ../../c-api/slice.rst:95 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 " @@ -168,13 +192,13 @@ msgstr "" "``PY_SSIZE_T_MIN``, e silenciosamente aumenta os valores de intermediário " "menores que ``-PY_SSIZE_T_MAX`` para ``-PY_SSIZE_T_MAX``." -#: ../../c-api/slice.rst:100 +#: ../../c-api/slice.rst:101 msgid "Return ``-1`` with an exception set on error, ``0`` on success." msgstr "" "Retorna ``-1`` com uma exceção definida em caso de erro, ``0`` em caso de " "sucesso." -#: ../../c-api/slice.rst:107 +#: ../../c-api/slice.rst:108 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 " @@ -184,7 +208,16 @@ msgstr "" "comprimento especificado. Índices fora dos limites são cortados de maneira " "consistente com o tratamento de fatias normais." -#: ../../c-api/slice.rst:111 +#: ../../c-api/slice.rst:112 +msgid "" +"*length* must not be negative. *step* must not be zero and must not be less " +"than ``-PY_SSIZE_T_MAX``, as guaranteed by :c:func:`PySlice_Unpack`." +msgstr "" +"*length* não pode ser negativo. *step* não pode ser zero e não pode ser " +"menor que ``-PY_SSIZE_T_MAX``, conforme garantido " +"por :c:func:`PySlice_Unpack`." + +#: ../../c-api/slice.rst:116 msgid "" "Return the length of the slice. Always successful. Doesn't call Python " "code." @@ -192,18 +225,26 @@ msgstr "" "Retorna o comprimento da fatia. Sempre bem-sucedido. Não chama o código " "Python." -#: ../../c-api/slice.rst:118 +#: ../../c-api/slice.rst:123 msgid "Ellipsis Object" msgstr "Objeto Ellipsis" -#: ../../c-api/slice.rst:123 +#: ../../c-api/slice.rst:128 +msgid "" +"The type of Python :const:`Ellipsis` object. Same " +"as :class:`types.EllipsisType` in the Python layer." +msgstr "" +"O tipo do objeto Python :const:`Ellipsis`. O mesmo " +"que :class:`types.EllipsisType` na camada Python." + +#: ../../c-api/slice.rst:134 msgid "" -"The Python ``Ellipsis`` object. This object has no methods. Like :c:data:" -"`Py_None`, it is an :term:`immortal` singleton object." +"The Python ``Ellipsis`` object. This object has no methods. " +"Like :c:data:`Py_None`, it is an :term:`immortal` singleton object." msgstr "" -"O objeto Python ``Ellipsis``. Este objeto não tem métodos. Como :c:data:" -"`Py_None`, é um objeto singleton :term:`imortal`." +"O objeto Python ``Ellipsis``. Este objeto não tem métodos. " +"Como :c:data:`Py_None`, é um objeto singleton :term:`imortal`." -#: ../../c-api/slice.rst:126 +#: ../../c-api/slice.rst:137 msgid ":c:data:`Py_Ellipsis` is immortal." msgstr ":c:data:`Py_Ellipsis` é imortal." diff --git a/c-api/stable.po b/c-api/stable.po index bbaafb0c5..ffde8fe9c 100644 --- a/c-api/stable.po +++ b/c-api/stable.po @@ -1,26 +1,25 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2023 -# Adorilson Bezerra , 2024 +# Rafael Fontenelle , 2026 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-06-21 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: Adorilson Bezerra , 2024\n" +"POT-Creation-Date: 2026-10-25 19:05+0000\n" +"PO-Revision-Date: 2025-09-15 01:03+0000\n" +"Last-Translator: Rafael Fontenelle , 2026\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -44,10 +43,10 @@ msgstr "" #: ../../c-api/stable.rst:15 msgid "" "CPython's Application Binary Interface (ABI) is forward- and backwards-" -"compatible across a minor release (if these are compiled the same way; see :" -"ref:`stable-abi-platform` below). So, code compiled for Python 3.10.0 will " -"work on 3.10.8 and vice versa, but will need to be compiled separately for " -"3.9.x and 3.11.x." +"compatible across a minor release (if these are compiled the same way; " +"see :ref:`stable-abi-platform` below). So, code compiled for Python 3.10.0 " +"will work on 3.10.8 and vice versa, but will need to be compiled separately " +"for 3.9.x and 3.11.x." msgstr "" "A Interface Binária de Aplicação (ABI) do CPython é compatível para frente e " "para trás através de uma versão menor (se elas forem compiladas da mesma " @@ -87,15 +86,15 @@ msgstr "Elas são discutidas em mais detalhes abaixo." msgid "" "Names prefixed by an underscore, such as ``_Py_InternalState``, are private " "API that can change without notice even in patch releases. If you need to " -"use this API, consider reaching out to `CPython developers `_ to discuss adding public API for your use " -"case." +"use this API, consider reaching out to `CPython developers `_ to discuss adding public API for " +"your use case." msgstr "" "Nomes prefixados por um sublinhado, como ``_Py_InternalState``, são APIs " "privadas que podem ser alteradas sem aviso prévio, mesmo em lançamentos de " "correção. Se você precisa usar essa API, considere entrar em contato com os " -"`desenvolvedores do CPython `_ para discutir a adição de uma API pública para o seu caso de uso." +"`desenvolvedores do CPython `_ para discutir a adição de uma API pública para o seu caso de uso." #: ../../c-api/stable.rst:40 msgid "Unstable C API" @@ -149,14 +148,14 @@ msgstr "API C Limitada" #: ../../c-api/stable.rst:67 msgid "" "Python 3.2 introduced the *Limited API*, a subset of Python's C API. " -"Extensions that only use the Limited API can be compiled once and work with " -"multiple versions of Python. Contents of the Limited API are :ref:`listed " +"Extensions that only use the Limited API can be compiled once and be loaded " +"on multiple versions of Python. Contents of the Limited API are :ref:`listed " "below `." msgstr "" "Python 3.2 introduziu a *API Limitada*, um subconjunto da API C do Python. " -"Extensões que apenas usam o Limited API podem ser compiladas uma vez e " -"funcionar com várias versões do Python. Os conteúdos da API Limitada estão :" -"ref:`listados abaixo `." +"Extensões que apenas usam o Limited API podem ser compiladas uma vez e ser " +"carregadas em várias versões do Python. Os conteúdos da API Limitada " +"estão :ref:`listados abaixo `." #: ../../c-api/stable.rst:74 msgid "" @@ -170,15 +169,14 @@ msgstr "" msgid "" "Define ``Py_LIMITED_API`` to the value of :c:macro:`PY_VERSION_HEX` " "corresponding to the lowest Python version your extension supports. The " -"extension will work without recompilation with all Python 3 releases from " -"the specified one onward, and can use Limited API introduced up to that " -"version." +"extension will be ABI-compatible with all Python 3 releases from the " +"specified one onward, and can use Limited API introduced up to that version." msgstr "" "Defina ``Py_LIMITED_API`` com o valor de :c:macro:`PY_VERSION_HEX` " "correspondente à versão mais baixa do Python que sua extensão suporta. A " -"extensão funcionará sem recompilação com todas as versões do Python 3 a " -"partir da especificada e poderá usar a API Limitada introduzida até aquela " -"versão." +"extensão terá compatibilidade com a ABI de todas as versões do Python 3 a " +"partir daquela especificada, e poderá usar a API Limitada introduzida até " +"aquela versão." #: ../../c-api/stable.rst:83 msgid "" @@ -206,12 +204,27 @@ msgstr "ABI Estável" #: ../../c-api/stable.rst:96 msgid "" "To enable this, Python provides a *Stable ABI*: a set of symbols that will " -"remain compatible across Python 3.x versions." +"remain ABI-compatible across Python 3.x versions." msgstr "" -"Para habilitar isso, o Python fornece uma *ABI estável*: um conjunto de " -"símbolos que permanecerão compatíveis em todas as versões do Python 3.x." +"Para habilitar isso, o Python fornece uma *ABI Estável*: um conjunto de " +"símbolos que permanecerão compatíveis com ABI em todas as versões do Python " +"3.x." -#: ../../c-api/stable.rst:99 +#: ../../c-api/stable.rst:101 +msgid "" +"The Stable ABI prevents ABI issues, like linker errors due to missing " +"symbols or data corruption due to changes in structure layouts or function " +"signatures. However, other changes in Python can change the *behavior* of " +"extensions. See Python's Backwards Compatibility Policy (:pep:`387`) for " +"details." +msgstr "" +"O ABI Estável previne problemas de ABI, como erros de ligador devido a " +"símbolos ausentes ou corrupção de dados devido a alterações em layouts de " +"estrutura ou assinaturas de função. No entanto, outras alterações no Python " +"podem alterar o *comportamento* das extensões. Veja a Política de " +"Retrocompatibilidade do Python (:pep:`387`) para detalhes." + +#: ../../c-api/stable.rst:107 msgid "" "The Stable ABI contains symbols exposed in the :ref:`Limited API `, but also other ones – for example, functions necessary to support " @@ -221,17 +234,17 @@ msgstr "" "api>`, mas também outros -- por exemplo, funções necessárias para suportar " "versões mais antigas da API Limitada." -#: ../../c-api/stable.rst:103 +#: ../../c-api/stable.rst:111 msgid "" "On Windows, extensions that use the Stable ABI should be linked against " -"``python3.dll`` rather than a version-specific library such as ``python39." -"dll``." +"``python3.dll`` rather than a version-specific library such as " +"``python39.dll``." msgstr "" "No Windows, as extensões que usam a ABI Estável devem ser vinculadas a " "``python3.dll`` em vez de uma biblioteca específica de versão, como " "``python39.dll``." -#: ../../c-api/stable.rst:107 +#: ../../c-api/stable.rst:115 msgid "" "On some platforms, Python will look for and load shared library files named " "with the ``abi3`` tag (e.g. ``mymodule.abi3.so``). It does not check if such " @@ -247,7 +260,7 @@ msgstr "" "com a API Limitada 3.10+ não sejam instaladas em versões mais baixas do " "Python." -#: ../../c-api/stable.rst:114 +#: ../../c-api/stable.rst:122 msgid "" "All functions in the Stable ABI are present as functions in Python's shared " "library, not solely as macros. This makes them usable from languages that " @@ -257,11 +270,11 @@ msgstr "" "compartilhada do Python, não apenas como macros. Isso as torna utilizáveis " "em linguagens que não utilizam o pré-processador C." -#: ../../c-api/stable.rst:120 +#: ../../c-api/stable.rst:128 msgid "Limited API Scope and Performance" msgstr "Escopo e Desempenho da API Limitada" -#: ../../c-api/stable.rst:122 +#: ../../c-api/stable.rst:130 msgid "" "The goal for the Limited API is to allow everything that is possible with " "the full C API, but possibly with a performance penalty." @@ -269,7 +282,7 @@ msgstr "" "O objetivo da API Limitada é permitir tudo o que é possível com a API C " "completa, mas possivelmente com uma penalidade de desempenho." -#: ../../c-api/stable.rst:125 +#: ../../c-api/stable.rst:133 msgid "" "For example, while :c:func:`PyList_GetItem` is available, its “unsafe” macro " "variant :c:func:`PyList_GET_ITEM` is not. The macro can be faster because it " @@ -280,7 +293,7 @@ msgstr "" "mais rápida porque pode depender de detalhes de implementação específicos da " "versão do objeto da lista." -#: ../../c-api/stable.rst:130 +#: ../../c-api/stable.rst:138 msgid "" "Without ``Py_LIMITED_API`` defined, some C API functions are inlined or " "replaced by macros. Defining ``Py_LIMITED_API`` disables this inlining, " @@ -292,7 +305,7 @@ msgstr "" "desativa esse inline, permitindo estabilidade à medida que as estruturas de " "dados do Python são aprimoradas, mas possivelmente reduzindo o desempenho." -#: ../../c-api/stable.rst:135 +#: ../../c-api/stable.rst:143 msgid "" "By leaving out the ``Py_LIMITED_API`` definition, it is possible to compile " "a Limited API extension with a version-specific ABI. This can improve " @@ -309,16 +322,17 @@ msgstr "" "disponível -- por exemplo, para pré-lançamentos de uma próxima versão do " "Python." -#: ../../c-api/stable.rst:144 +#: ../../c-api/stable.rst:152 msgid "Limited API Caveats" msgstr "Limitações da API Limitada" -#: ../../c-api/stable.rst:146 +#: ../../c-api/stable.rst:154 msgid "" "Note that compiling with ``Py_LIMITED_API`` is *not* a complete guarantee " -"that code conforms to the :ref:`Limited API ` or the :ref:" -"`Stable ABI `. ``Py_LIMITED_API`` only covers definitions, but " -"an API also includes other issues, such as expected semantics." +"that code conforms to the :ref:`Limited API ` or " +"the :ref:`Stable ABI `. ``Py_LIMITED_API`` only covers " +"definitions, but an API also includes other issues, such as expected " +"semantics." msgstr "" "Observe que compilar com ``Py_LIMITED_API`` *não* é uma garantia completa de " "que o código esteja em conformidade com a :ref:`API Limitada